summaryrefslogtreecommitdiff
path: root/openstackclient/tests/compute
Commit message (Collapse)AuthorAgeFilesLines
* Add class TestServerList to provide basic unit test for "server list" command.Tang Chen2015-12-021-0/+81
| | | | | | | | | | | | This patch provide a class to test "server list" command. Only one simplest case in this patch. Some of the options in "server list" are complicated. And the server object contains lots of attributes need to be handled in specific ways. So other test cases will be added in other patches. Change-Id: Id9fdba8f149bd74187aa42516067dacebc6962b5 Implements: blueprint osc-unit-test-framework-improvement
* Enable setup_servers_mock() to take attributes param.Tang Chen2015-12-021-1/+5
| | | | | | | | | | setup_servers_mock() is now able to set methods to the fake servers. But it cannot set attributes. This patch enable it to do so. This will be useful in "server list" test cases. Change-Id: Ic30d750ebe4650244707a368cdd5d622a8f1b8ed Implements: blueprint osc-unit-test-framework-improvement
* Merge "Add unit testcases for "openstack flavor delete""Jenkins2015-12-011-0/+46
|\
| * Add unit testcases for "openstack flavor delete"xiexs2015-11-301-0/+46
| | | | | | | | Change-Id: If23a71c678193e5c9c91300fddd17e79f674bf82
* | Merge "Add project name/ID validation for "openstack quota show""Jenkins2015-12-011-0/+2
|\ \
| * | Add project name/ID validation for "openstack quota show"xiexs2015-11-291-0/+2
| |/ | | | | | | | | | | | | A validation is necessary to check the existence of project. This patch is similar to Ia2d8c96527820e25b074e6486d3f39c5ad7eae60. Change-Id: Id8895ba7a21ecad05942619a82a87c0dc68eae53
* | Merge "Add testcases for compute.v2.service"Jenkins2015-11-302-5/+109
|\ \
| * | Add testcases for compute.v2.servicexiexs2015-12-012-5/+109
| |/ | | | | | | | | | | | | | | | | Add a set of testcases to test the classes of ListService and SetService in the compute.v2.service. And to be consistent with cinder term, use service_binary to represent the service binary. Change-Id: I9fe740f07c9ce3afdba7b7cca152d614170abb96
* | Merge "Add "openstack server unshelve" into OSC"Jenkins2015-11-301-20/+40
|\ \ | |/ |/|
| * Add "openstack server unshelve" into OSCxiexs2015-11-281-20/+40
| | | | | | | | | | | | | | | | The unshelve operation is not supported by OSC, and this patch tries to add it. Change-Id: Ic60a4616cb63ad21c1a3c8e02611da8bad3a8bd0 Implements: blueprint introduce-shelve-into-osc
* | Remove old fake flavor data.Tang Chen2015-11-281-12/+0
| | | | | | | | | | | | | | | | The new class FakeFlavor has been introduced to fake one or more flavors. So use it and remove the old fake flavor data. Change-Id: Ie3a33b36ae6e597c6a0b1d17ad13c73cf4b73bc9 Implements: blueprint improve-flavor-unit-test
* | Use FakeFlavor in TestServerCreate.Tang Chen2015-11-281-11/+7
| | | | | | | | | | Change-Id: Ib82f845258b1ad78cbc8b23d28fa42e7ccc8097a Implements: blueprint improve-flavor-unit-test
* | User FakeFlavor in TestServerResize.Tang Chen2015-11-281-8/+5
| | | | | | | | | | Change-Id: Iac9b4583befaa4eb79ec59c39b97c613884ef2f7 Implements: blueprint improve-flavor-unit-test
* | Use FakeFlavor in TestFlavorUnset.Tang Chen2015-11-281-7/+4
| | | | | | | | | | Change-Id: Ifbd360db39d380efd9632300367b13283ac75f54 Implements: blueprint improve-flavor-unit-test
* | Use FakeFlavor in TestFlavorSet.Tang Chen2015-11-281-5/+4
| | | | | | | | | | Change-Id: I335298b07afb3f969c76748527dda06cb5393fa8 Implements: blueprint improve-flavor-unit-test
* | Use FakeFlavor in TestFlavorList.Tang Chen2015-11-281-11/+8
| | | | | | | | | | Change-Id: I3595877bed41bc476934ca924f1f9c8c0ad79176 Implements: blueprint improve-flavor-unit-test
* | Introduce class FakeFlavor to fake one or more flavors.Tang Chen2015-11-281-0/+64
| | | | | | | | | | Change-Id: I1b20e7d50e478ce8114ca08aa455b7acad4ea7f5 Implements: blueprint improve-flavor-unit-test
* | Refactor: Move FakeFlavorResource to compute_fakes.py.Tang Chen2015-11-282-19/+24
| | | | | | | | | | | | | | Just like FakeServer and FakeResource, FakeFlavorResource should be in compute_fakes.py. Change-Id: I8315256fb90377605fa2190e24c9674f6aaf6efd Implements: blueprint improve-flavor-unit-test
* | Refactor: Abstract datalist out in TestFlavorList to avoid redundant code.Tang Chen2015-11-281-53/+20
| | | | | | | | | | | | | | | | datalist has been set in each test case in TestFlavorList, which is not necessary. This patch abstract it out and remove all redundant code. Change-Id: I6f735f7d9fa29a8ab435adaef17ca559df1fdcee Implements: blueprint improve-flavor-unit-test
* | Refactor: Abstract columns out in TestFlavorList to avoid redundant code.Tang Chen2015-11-281-53/+20
|/ | | | | | | | The columns has been set in each test case of TestFlavorList, which is not necessary. This patch abstract it out and remove all redundant code. Change-Id: Ideb2872f073755ac251bd603fd906410ea86c4ef Implements: blueprint improve-flavor-unit-tes
* Add unit tests for "server stop" command.Tang Chen2015-11-271-0/+20
| | | | | Change-Id: Idfa82f7f3aee3824aedf8b551be7942659530457 Implements: blueprint osc-unit-test-framework-improvement
* Add unit tests for "server start" command.Tang Chen2015-11-271-0/+20
| | | | | Change-Id: I19060419a17b8e081e8f51c08959f24b84e7e570 Implements: blueprint osc-unit-test-framework-improvement
* Add unit tests for "server resume" command.Tang Chen2015-11-271-0/+20
| | | | | Change-Id: I8961e72b6901a52612cf62f52c02b6c2ff3dcd94 Implements: blueprint osc-unit-test-framework-improvement
* Add unit tests for "server suspend" command.Tang Chen2015-11-271-0/+20
| | | | | Change-Id: Idfdd98fd27d97e1216abe9b14d3dea7c8f2a5a68 Implements: blueprint osc-unit-test-framework-improvement
* Add unit tests for "server unlock" command.Tang Chen2015-11-271-0/+20
| | | | | Change-Id: I4fbf115f925a6ffdeaec3d856d22224fa7730729 Implements: blueprint osc-unit-test-framework-improvement
* Add unit tests for "server lock" command.Tang Chen2015-11-271-0/+20
| | | | | Change-Id: I0396fc4836ee918298bbe3860b7c1f42d3b97e33 Implements: blueprint osc-unit-test-framework-improvement
* Add unit tests for "server unpause" command.Tang Chen2015-11-271-0/+20
| | | | | Change-Id: Ia74d9875b8aa413b84d0077d22adb75b866a5701 Implements: blueprint osc-unit-test-framework-improvement
* Abstract a helper function for server.xxx() tests.Tang Chen2015-11-271-59/+24
| | | | | | | | The test cases for server.xxx() are all the same, with one or more faked servers. So use a helper function to reduce code duplicate. Change-Id: I660c7731e2de8bf4d815b414a621d8d9ca6d5a8b Implements: blueprint osc-unit-test-framework-improvement
* Add multiple servers test case to TestServerDelete.Tang Chen2015-11-271-0/+22
| | | | | | | This patch adds a multiple servers test case to class TestServerDelete. Change-Id: I8b0c37ec2a8e7b23889e25c9004f867f2907f630 Implements: blueprint osc-unit-test-framework-improvement
* Use setup_servers_mock() in the base class in TestServerDelete.Tang Chen2015-11-271-16/+17
| | | | | | | | Use setup_servers_mock() in class TestServerDelete to coordinate the test class format. Change-Id: I1901d6b781d97820667984241f4d68764d045854 Implements: blueprint osc-unit-test-framework-improvement
* Move setup_servers_mock() to class TestServer.Tang Chen2015-11-271-23/+13
| | | | | | | | | This function will be used in almost every test case. So move it to the base class to avoid define it each time a test case is added. Change-Id: I060b54f0935b42a85042ad217d851fea649ec8d9 Implements: blueprint osc-unit-test-framework-improvement
* Move FakeServer to tests.common.v2.compute.fakeslin-hua-cheng2015-11-252-10/+87
| | | | | | | FakeServer should not be in tests.fakes since this should be just for generic re-usable classes. Change-Id: I19209952de69626dfa3caadc5d1cc69b7feadeba
* Merge "Remove the old fake server data."Jenkins2015-11-251-9/+0
|\
| * Remove the old fake server data.Tang Chen2015-11-211-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The old fake server framework has be replaced with the new class FakeServer, which is stronger in: 1. faking multiple servers with random names and ids 2. faking methods in a server 3. easier to use So remove the old fake server data, and use class FakeServer from now on. Change-Id: Ife8ee37a7ce14d9a3201104bce8075a918a97613 Implements: blueprint osc-unit-test-framework-improvement
* | 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