summaryrefslogtreecommitdiff
path: root/openstackclient/tests/compute
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge "Use class FakeServer in TestServerResize."Jenkins2015-11-251-21/+18
|\ \ | |/
| * Use class FakeServer in TestServerResize.Tang Chen2015-11-211-21/+18
| | | | | | | | | | | | | | | | There are the same problems with TestServerCreate in TestServerResize. Use the new class FakeServer to fix them. Change-Id: Ibde3e68a7bc55bbbf8357ba98be2559a6d0d41b6 Implements: blueprint osc-unit-test-framework-improvement
* | Merge "Use class FakeServer in TestServerImageCreate."Jenkins2015-11-251-10/+8
|\ \ | |/
| * Use class FakeServer in TestServerImageCreate.Tang Chen2015-11-211-10/+8
| | | | | | | | | | | | | | | | There are the same problems with TestServerCreate in TestServerImageCreate. Use the new class FakeServer to fix them. Change-Id: Ie723fa95620549f09a81ef72953f46877ef9252a Implements: blueprint osc-unit-test-framework-improvement
* | Merge "Use class FakeServer in TestServerDelete."Jenkins2015-11-251-16/+15
|\ \ | |/
| * Use class FakeServer in TestServerDelete.Tang Chen2015-11-211-16/+15
| | | | | | | | | | | | | | | | There are the same problems with TestServerCreate in TestServerDelete. Use the new class FakeServer to fix them. Change-Id: Icdcc90cc93ed1080187fb0edca885b0db56ab35d Implements: blueprint osc-unit-test-framework-improvement
* | Merge "Use class FakeServer in TestServerCreate."Jenkins2015-11-251-38/+68
|\ \ | |/
| * Use class FakeServer in TestServerCreate.Tang Chen2015-11-211-38/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the current TestServerCreate, there are several problems: 1. The fake create() returns a server with no 'networks' field. The new_server is used to fake the created server which is supposed to be returned by create(), but it has a 'networks' field. They have the same name and id, but they are actually not the same server. As a result, when checking the return value from create(), 'networks' is not checked. 2. The fake server is not accessable in the test functions. So each time a test function wants to get the server name or id, it has to use the constants defined in compute_fakes. This is not good. We should make the fake server accessable in all test functions to ensure they actually get the same server. This patch fix them both by using the new class FakeServer to fake a server. Change-Id: I8ffc8e233f8710034329ed33fccb2c734898ec2d Implements: blueprint osc-unit-test-framework-improvement
* | Merge "Unable to set some compute quotas"Jenkins2015-11-251-0/+16
|\ \
| * | Unable to set some compute quotasRichard Theis2015-11-201-0/+16
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OpenStackClient mapping of 'openstack quota set' arguments isn't correct for compute quota items that have to different names. For example, the --injected-file-size argument is mapped to injected_file_size, but the compute quotas item is actually injected_file_content_bytes. This incorrect mapping prevented the impacted compute quota items from being set. The problem impacts the following 'openstack quota set' arguments: --injected-file-size --injected-path-size --properties --secgroup-rules --secgroups This patch set also expands the compute quota unit tests to verify all compute quota items that can be set. Change-Id: I0a2f241e425f4811e4ae55be183ac0c8b0805c2a Closes-Bug: #1475831
* | Add "openstack server shelve" into OSCxiexs2015-11-241-0/+54
|/ | | | | | | | Currently, the shelve operation is not supported by OSC. So, this patch attempts to add it into OSC. Change-Id: I92545300bef006a069338168d2de800e8a58af69 Implements: blueprint introduce-shelve-into-osc
* Add unit tests for "server pause" command.Tang Chen2015-11-201-0/+57
| | | | | | | | This patch adds unit tests for "server pause" command, including one and multiple servers. Change-Id: If5551e77d7dd4f7f48c6ee4a7f80f8313817f492 Implements: blueprint osc-unit-test-framework-improvement
* Split the vol_id from a dev mappingxiexs2015-11-112-0/+83
| | | | | | | Add a split into the dev mapping to get the right vol_id. Change-Id: I1a7bf6351491b1321c5ca0fa4a27f29825400eaf Closes-Bug: #1514394
* Merge "Add compute service delete"Jenkins2015-11-112-0/+58
|\
| * Add compute service deleteAlex Schultz2015-10-162-0/+58
| | | | | | | | | | | | | | | | This change adds 'compute service delete <service>' to the openstack client. This is the equivalent of 'nova service-delete <id>' Change-Id: I69ef1cac72cbe125c2114f8e958e22350a70f367 Closes-Bug: #1503510
* | Use fake server name instead of id when testing "server_name" param.Tang Chen2015-11-071-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | "server create" command takes a server name parameter. The server id is generated by openstack. When we intended to pass a server name to the unit tests of "server create" command, we passed server id. It won't be any problem because the fake server id is also a string, but we should pass a fake server name because we have a string to fake one. Change-Id: I9944f0ea2a6c457e4fad8215a54778bca08965ab
* | Trivial clean up: do not use plural form in command arguments.Tang Chen2015-10-241-3/+3
| | | | | | | | | | | | | | | | It is a general rule that we don't use plural form for the name of command arguments. But class DeleteServer() is still using "servers". So use "server instead". Change-Id: I2d76de14ec34b88547b9f728b41e9bd93b2a22c5
* | Support pagination params for flavor listliyingjun2015-10-211-5/+15
|/ | | | | | | | Missing 'marker' and 'limit' params for `openstack flavor list` shell command. It would be nice to have this when there are many flavors. Closes-bug: #1505874 Change-Id: I088ac5d24f0d7595f5cbce14f063e296a449eb26
* Add tags to `image set`NiallBunting2015-10-061-2/+4
| | | | | | | | | | | | This adds --tag to the v2 version of `image set`. This is another step to compatability between the osc image api. Added merge of tags into existing tags and handling duplicates, and tests for same. Co-Authored-By: Steve Martinelli <stevemar@ca.ibm.com> Change-Id: Ie800fcbf8bbc0978c54ace3278750a18023e8ce4
* Properly handle port arguments for ICMPDean Troyer2015-09-031-0/+338
| | | | | | | | | | The Compute API requires 'from_port' and 'to_port' to be -1 for ICMP security group rules. It happily accepts them empty or None but the resulting rules do not work. So we force the values for ICMP rules. Closes-bug: #1477629 Change-Id: Iba57211014caca16be7c9a28d15d4db2a6c51b8d
* Fix quota set failed problemjiaxi2015-07-281-0/+18
| | | | | | | | | | | | | | | | When using the command: openstack quota set, the compute quota below can't be set successfully,the value of compute quota stay unchanged, 'fixed-ips', 'floating-ips', 'injected-files', 'key-pairs'. What's more,I add a TODO comment in the code for two reason. 1. volume quota set works fine for the moment. 2. To indicate that this issue about volume needs discuss and report another bug, if it's confirmed. This bug is only about compute quota. Change-Id: Ic1028d561f5a0030cf65ac18fc117bf01e945478 Partial-Bug: #1420104
* Merge "Fix address parsing for server ssh command"Jenkins2015-07-121-0/+54
|\
| * Fix address parsing for server ssh commandTerryHowe2015-07-081-0/+54
| | | | | | | | | | | | | | | | | | There seem to be three formats for the server address field and the old code only supported the old format. This code adds a parser for all three formats. Change-Id: I7f12d2c69ff70556907ea6f31a0e0bba91b68b49 Closes-Bug: #1469843
* | Fix wrong mock method calllin-hua-cheng2015-07-111-1/+1
|/ | | | | | | | | | | | | | | | | | | | There is no assert_called() method in mock, replace it with assert_called_with() method. The old method used to work with mock 1.0.1 because it was a noop in magicmock. Needs https://review.openstack.org/#/c/200583 to pass the requirements check. https://review.openstack.org/#/c/193935/ changed the OS_* vars we source by forcing v2password as the auth method. change our identity v3 test setup by setting v3password Co-Authored-By: Steve Martinelli <stevemar@ca.ibm.com> Closes-Bug: 1473454 Depends-on: I0cfab6d13e5d9e744cb302c86a2c21269923e75d Change-Id: Id22765c7e044797e03d19ad1b103fadec2726aa2
* Add --wait to server deleteMatt Riedemann2015-05-291-0/+47
| | | | | | | | | | | | | | This allows the server delete command to wait for the server to be deleted (obviously). The wait method is the same model that Tempest uses, i.e. wait for a 404 on server GET (successful deletion), fail if the server went to ERROR status, or fail if a timeout is reached. The default timeout of 300 seconds is also what Tempest uses. Closes-Bug: #1460112 Change-Id: I0e66c400903e82832944d1cad61e7eb30177c3e8
* Add image show testsDean Troyer2015-05-011-4/+4
| | | | | | | | | Image v2 uses warlock objects rather than the usua Resource objects so we need to test for those. This adds a subset of the Image v2 schema that should be enough to test for proper warlock image handling. Depends-On: Ic95db2f63d9f5f37e29f0d7e048397da311fbf8c Change-Id: Ib89cce87f110a554f40e726718e31d39b500a6ae
* Fix security group create description bugDean Troyer2015-04-222-0/+203
| | | | | | | | --description is optional in our CLI but the server requires it to be non-empty. Set a default value of the given name. Closes-Bug: #1434172 Change-Id: I81507a77ad8d815000ff411784ae71e229c77f78
* Add the ability to set and unset flavor propertiesMarek Aufart2015-03-191-1/+76
| | | | | | | | | | Added flavor set and unset command which allow manage flavor properties called extra_specs. Command flavor show output was extended with these properties. Closes-Bug: 1434137 Change-Id: Ie469bade802de18aab9d58eda3fff46064008163
* Rename --verify for server resize to avoid conflictzhiyuan_cai2015-02-161-5/+5
| | | | | | | | | | | | | | Currently server resize command has a verify argument for user to confirm resize operation. But this argument is also registered by openstack client shell which is used to enable server certificate verification. So verify argument can not be correctly passed to server resize command. This patch renames --verify to --confirm (nova client has a resize-confirm command) to solve this problem. Change-Id: I751aa3df16c3b637b82944dd350afc5cbab62120 Closes-Bug: #1416542
* Added capabilities/options to 'openstack flavor list'Igor_Bolotin2015-02-031-0/+274
| | | | | | | | | | | | | | | | | | | | | | command to match capabilities already provided by 'nova flavor-list': —public | --private | --all options allows to list public only (default), private only or all flavors. —long displays more field. This option also fetches properties (extra-specs) for each flavor using separate API call for each flavor and it’s too slow to be done by default. However as an administrator - sometimes I need to be able to see them for all flavors. Removed empty “Extra Specs” column as well as "Swap" and "RXTX Factor" from default output. DocImpact Closes-Bug: #1416780 Change-Id: I30cfa2c75e28daf17b936543a177c23ae1743c37
* Add 'find by name' to --nic for creating serverzhiyuan_cai2015-01-272-0/+82
| | | | | | | Add 'find by name' feature to --nic option for creating server. Closes-Bug: #1353040 Change-Id: Idd0a30415d8360a57e33efedf2467593652683d4
* add multi-delete support for compute/image/net/volumewanghong2014-12-231-1/+1
| | | | | | | | | | | | | | This is part1, add support for these objects: compute.server imagev1.image imagev2.image network.network volume.volume volume.backup volume.snapshot Closes-Bug: #1400597 Change-Id: Ice21fee85203a8a55417e0ead8b509b8fd6705c1
* Add arg to 'server image create' testsDean Troyer2014-11-141-4/+6
| | | | | | | The 'protected' column was not being checked. Also add it to image.fakes.IMAGE. Change-Id: Ie431e9871a7da78b5a3924bfbc51d5575d994d86
* Fix server create for boot-from-volumeDean Troyer2014-10-241-12/+10
| | | | | | | | | | | | | | | | * server create required --image even when booting the server from a volume. Change options to require either --image or --volume to specify the server boot disk. Using --volume currently uses device 'vda' for the block mapping and ignores any other block mappings given in --block-device-mapping. * server create and server show are both affected by bug 1378842 where an excepion was thrown when no image ID was present in the returned server object, which is the case for a server booted from a volume. * Fix the remaining assertEqual() order problems in test_server.py Closes-Bug: 1378842 Closes-Bug: 1383338 Change-Id: I5daebf4e50a765d4920088dfead95b6295af6a4d
* Close files on server create, add testsDean Troyer2014-10-142-0/+175
| | | | | | | | | | The files opened for the --files and --user-data options were never closed, potentially leaking memory in a long-running client. Close them if they are file objects. Add a couple of basic tests for server create. Change-Id: I1658b0caa2d6af17308149cb52196ee28266ddf2
* Fix server resizeDean Troyer2014-07-082-0/+149
| | | | | | | | So apparently we've never resized a server??? Fixed command args and add some tests. Change-Id: I6c3f6fec22390e9d269b7117a42a190d2b4b80ba
* Add support for extension listMatt Fischer2014-06-111-0/+21
| | | | | | | | | | | | - Add support in the common section for extension list. This only supports Identity for now. Once the APIs for volume and compute are supported in the respective APIs, they will be added. Once network is added to this client, it will be added (the API already supports it). - Include extension fakes for volume and compute for pre-enablement. Change-Id: Iebb0156a779887d2ab06488a2a27b70b56369376 Closes-Bug: #1319115
* Fix server image createDean Troyer2014-05-081-5/+1
| | | | | | | | The final find_resource() call errored because servers.create_image() returns an image ID rather than an Image resource. Reset expectations and arguments. Change-Id: I1b9132f66091f9df76198724156acb7a6fb2f6fe
* Remove copyright from empty filesAlexander Ignatov2014-01-202-28/+0
| | | | | | | | | According to policy change in HACKING: http://docs.openstack.org/developer/hacking/#openstack-licensing empty files should no longer contain copyright notices. Change-Id: Iba09a00f24dfbd1cd03c1c9f70ea216788e64d93 Closes-Bug: #1262424
* Add server image create commandDean Troyer2013-11-182-7/+97
| | | | | | Translation of 'nova image-create', with tests! Change-Id: I8a833aeff6f291e4774063ed235876eb2ba9c13c
* Complete basic test infrastructureDean Troyer2013-11-184-50/+132
| | | | | | | This finally gets all of the API tests into a common framework regarding test classes and so forth. Change-Id: If675347129c50dcba0bfc5b6c58f5a2ca57ff46c
* Move tests into project package.Monty Taylor2013-06-302-0/+64
There are several reasons for this. One is that the majority of OpenStack packages behave this way. The second is that it makes writing software that extends something easier to test (which is a clear usecase for openstackclient) And third, tests/__init__.py implies a global package named "tests" - which I'm pretty sure we're not providing. Change-Id: Ic708ffd92aea78c2ffc1a8579af0587af4fca4ff