summaryrefslogtreecommitdiff
path: root/openstackclient/tests
Commit message (Collapse)AuthorAgeFilesLines
* Migrate network client to SDK.Tang Chen2015-12-093-72/+35
| | | | | | | | | | | | | | | | | | | The previous patches have migrate all network commands to the new version using sdk. This patch will remove the temporary method, and implement a new make_client() to create sdk network client. And also, find() in openstackclient/network/common.py must support sdk. The logic of this function will become much easier than before, so this patch also removes two useless test cases of find(). This patch will also remove the patched methods in tests. Change-Id: Ic2f7bca073beb9757172d16f95d9b82c48cbbc12 Implements: blueprint neutron-client Co-Authored-By: Terry Howe <terrylhowe@gmail.com> Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
* Migrate "network show" command to use SDK.Tang Chen2015-12-091-20/+49
| | | | | | | | | | | | | | | | | | | | | This patch makes "network show" command use sdk. Since we have to keep the other commands runnable with the old network client, we use a temporary method to create sdk network client. And as a result, the tests need to patch a method to fake the temporary method, which will be removed at last. There are two same test cases in the unit tests. This patch will remove one. And since the output has changed, we also need to fix function test cases. Change-Id: I4c06b4efad2db430767bbaa882b0876df3ab483a Implements: blueprint neutron-client Co-Authored-By: Terry Howe <terrylhowe@gmail.com> Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
* Migrate "network set" command to use SDK.Tang Chen2015-12-091-21/+29
| | | | | | | | | | | | | | | This patch makes "network set" command use sdk. Since we have to keep the other commands runnable with the old network client, we use a temporary method to create sdk network client. And as a result, the tests need to patch a method to fake the temporary method, which will be removed at last. Change-Id: I794ac4b82d9200747298f1a9ee44611140e9b6d0 Implements: blueprint neutron-client Co-Authored-By: Terry Howe <terrylhowe@gmail.com> Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
* Migrate "network delete" command to use SDK.Tang Chen2015-12-091-10/+12
| | | | | | | | | | | | | | | This patch makes "network delete" command use sdk. Since we have to keep the other commands runnable with the old network client, we use a temporary method to create sdk network client. And as a result, the tests need to patch a method to fake the temporary method, which will be removed at last. Change-Id: I1f2c404e4b0ff6727e4c535ce543aa406f2290ce Implements: blueprint neutron-client Co-Authored-By: Terry Howe <terrylhowe@gmail.com> Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
* Migrate "network create" command to use SDK.Tang Chen2015-12-091-51/+107
| | | | | | | | | | | | | | | This patch makes "network create" command use sdk. Since we have to keep the other commands runnable with the old network client, we use a temporary method to create sdk network client. And as a result, the tests need to patch a method to fake the temporary method, which will be removed at last. Change-Id: I06559c675be1188747257f72f18d6b4d420d0285 Implements: blueprint neutron-client Co-Authored-By: Terry Howe <terrylhowe@gmail.com> Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
* Migrate "network list" command to new version using SDK.Tang Chen2015-12-081-46/+46
| | | | | | | | | | | | | | | This patch makes "network list" command use sdk. Since we have to keep the other commands runnable with the old network client, we use a temporary method to create sdk network client. And as a result, the tests need to patch a method to fake the temporary method, which will be removed at last. Change-Id: I0882501cd7bb2c17917e10a6da4298f1452c9765 Implements: blueprint neutron-client Co-Authored-By: Terry Howe <terrylhowe@gmail.com> Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
* Trivial: Coding style fix in test_flavor.pyTang Chen2015-12-081-4/+4
| | | | Change-Id: I3dcb3c4fbd9ff9c351426ae2ad9da009208a6485
* Merge "Use formatter in server.py for "server list" tests."Jenkins2015-12-071-1/+1
|\
| * Use formatter in server.py for "server list" tests.Tang Chen2015-12-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | We should use the formatter in the original code to set the expected data in each test case. The same problem exists in other test cases, like "server create". But data structure in TestServerCreate is different from TestServerList, so will fix the problem in another patch. Change-Id: I233f7a91cd4cc1e996941e26ea85490fa3290572
* | Introduce class FakeNetwork to fake one or more networks.Tang Chen2015-12-071-0/+89
|/ | | | | | | | | | Introduce a new class FakeNetwork to fake one or more Network objects so that we don't need to initialize objects once and once again in each test case. Change-Id: I519e5368025946a737002a2e97bc218b65a78fa2 Implements: blueprint osc-network-unit-test-refactor Related-to: blueprint neutron-client
* Merge "Refactor network test: Remove unusful test code."Jenkins2015-12-061-35/+0
|\
| * Refactor network test: Remove unusful test code.Tang Chen2015-12-051-35/+0
| | | | | | | | | | | | | | | | openstackclient/tests/network/common.py won't be used anymore. Remove it. Change-Id: I641f6d44852931e31ecda22261bfbc9f451446de Implements: blueprint osc-network-unit-test-refactor Related-to: blueprint neutron-client
* | Merge "Refactor TestShowNetwork: Use TestNetwork in TestShowNetwork"Jenkins2015-12-061-12/+8
|\ \ | |/
| * Refactor TestShowNetwork: Use TestNetwork in TestShowNetworkTang Chen2015-12-051-12/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are severail problems in TestShowNetwork: 1. NETWORK_ITEM is not used. 2. Some redundant code. 3. The param n_mock is used to fake find_attr(), but the name is confusing. So rename it to find_attr(). This patch fixes them. Change-Id: I7bc909057125013fb9d215e92c61f847300f93e2 Implements: blueprint osc-network-unit-test-refactor Related-to: blueprint neutron-client
* | Merge "Refactor TestSetNetwork: Use TestNetwork in TestSetNetwork"Jenkins2015-12-061-25/+24
|\ \ | |/
| * Refactor TestSetNetwork: Use TestNetwork in TestSetNetworkTang Chen2015-12-051-25/+24
| | | | | | | | | | | | | | | | Use TestNetwork in TestSetNetwork, and also setup test command in setUp(). Change-Id: I4e72332fcf253407bb3d5f20aaf4be047046e146 Related-to: blueprint neutron-client
* | Merge "Refactor TestListNetwork: Use TestNetwork in TestListNetwork"Jenkins2015-12-061-51/+44
|\ \ | |/
| * Refactor TestListNetwork: Use TestNetwork in TestListNetworkTang Chen2015-12-051-51/+44
| | | | | | | | | | | | | | | | | | | | | | | | Abstract cloumns and data out in TestListNetwork so that they can be reused by each case. Also rename n_mock to network_list because it is used to fake function network_list(). Change-Id: I3f65f7bd6c587c167dc1cf8b6d34e003c6454e57 Implements: blueprint osc-network-unit-test-refactor Related-to: blueprint neutron-client
* | Merge "Refactor TestDeleteNetwork: Use TestNetwork in TestDeleteNetwork"Jenkins2015-12-061-9/+19
|\ \ | |/
| * Refactor TestDeleteNetwork: Use TestNetwork in TestDeleteNetworkTang Chen2015-12-051-9/+19
| | | | | | | | | | | | | | | | | | Make TestDeleteNetwork inherit from TestNetwork, and have the same class architecture as the other test classes. Change-Id: I37047d7d13931b2a8f25665d6427efc05fc4f989 Implements: blueprint osc-network-unit-test-refactor Related-to: blueprint neutron-client
* | Merge "Refactor TestCreateNetwork: Setup identity client in setUp() in ↵Jenkins2015-12-051-22/+18
|\ \ | |/ | | | | TestCreateNetworkIdentityV2"
| * Refactor TestCreateNetwork: Setup identity client in setUp() in ↵Tang Chen2015-12-051-22/+18
| | | | | | | | | | | | | | | | | | | | TestCreateNetworkIdentityV2 This patch setup the v2 identity client only once in setUp() for TestCreateNetworkIdentityV2. Change-Id: I9d7a83e5e67e810a5c5f760fb9c40ce450f7dc99 Implements: blueprint osc-network-unit-test-refactor Related-to: blueprint neutron-client
* | Merge "Refactor TestCreateNetwork: Setup identity client in setUp() in ↵Jenkins2015-12-051-17/+24
|\ \ | |/ | | | | TestCreateNetworkIdentityV3"
| * Refactor TestCreateNetwork: Setup identity client in setUp() in ↵Tang Chen2015-12-051-17/+24
| | | | | | | | | | | | | | | | | | | | TestCreateNetworkIdentityV3 This patch setup the v3 identity client only once in setUp() for TestCreateNetworkIdentityV3. Change-Id: Ia20db01af85f868a88bf905174b8556979b0a39a Implements: blueprint osc-network-unit-test-refactor Related-to: blueprint neutron-client
* | Merge "Refactor TestCreateNetwork: Setup cmd in setUp() in ↵Jenkins2015-12-051-11/+12
|\ \ | |/ | | | | TestCreateNetworkIdentityV2"
| * Refactor TestCreateNetwork: Setup cmd in setUp() in TestCreateNetworkIdentityV2Tang Chen2015-12-051-11/+12
| | | | | | | | | | | | | | | | This patch setup the tested command only once in setUp() for TestCreateNetworkIdentityV2. Change-Id: I689980674c9500c0c040d27164ec61f5fcf40ee5 Implements: blueprint osc-network-unit-test-refactor Related-to: blueprint neutron-client
* | Merge "Refactor TestCreateNetwork: Setup cmd in setUp() in ↵Jenkins2015-12-051-18/+15
|\ \ | |/ | | | | TestCreateNetworkIdentityV3"
| * Refactor TestCreateNetwork: Setup cmd in setUp() in TestCreateNetworkIdentityV3Tang Chen2015-12-051-18/+15
| | | | | | | | | | | | | | | | This patch setup the tested command only once in setUp() for TestCreateNetworkIdentityV3. Change-Id: Iff5119fa24c9cc0caa72ff0e8f63e8dcac72470a Implements: blueprint osc-network-unit-test-refactor Related-to: blueprint neutron-client
* | Merge "Refactor TestCreateNetwork: Split TestCreateNetwork into two classes ↵Jenkins2015-12-051-1/+11
|\ \ | |/ | | | | for identity v2 and v3"
| * Refactor TestCreateNetwork: Split TestCreateNetwork into two classes for ↵Tang Chen2015-12-051-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | identity v2 and v3 In TestCreateNetwork, both Identity v2 and v3 clients are tested. As a result, we should initialize the identity client again and again in each test function. To reduce redundant code, this patch split TestCreateNetwork to TestCreateNetworkIdentityV2 and V3. And then initialize the identity client only once in each of them. Change-Id: I349fe7f827524beb541efe7dd9460c534254b80c Implements: blueprint osc-network-unit-test-refactor Related-to: blueprint neutron-client
* | Merge "Refactor network test: Introduce TestNetworkv2 and TestNetwork to ↵Jenkins2015-12-052-0/+35
|\ \ | |/ | | | | improve unit test of network"
| * Refactor network test: Introduce TestNetworkv2 and TestNetwork to improve ↵Tang Chen2015-12-052-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | unit test of network The class inherit architecture in network unit test is different from other test classes, which leads to lots of redundant code. This patch will make it the same as the other test classes. And it will be more convenience for the coming up refactor. Change-Id: I6f239dd54b9401ff2bbcf7ffdeb18769a450f573 Implements: blueprint osc-network-unit-test-refactor Related-to: blueprint neutron-client
* | Merge "Introduce FakeImage class"Jenkins2015-12-041-0/+133
|\ \ | |/ |/|
| * Introduce FakeImage classxiexs2015-12-021-0/+133
| | | | | | | | | | | | | | | | | | | | Introduce FakeImage to improve the current image unittest framework with following two advantages: 1. generate more than one faking images 2. all faking images generated by random Change-Id: Ide326fa2a047ddeea478bef97000083617a0b744 Implements: blueprint improve-image-unittest-framework
* | Merge "Add multi deletion testcase for openstack volume delete"Jenkins2015-12-031-8/+32
|\ \
| * | Add multi deletion testcase for openstack volume deletexiexs2015-12-021-8/+32
| | | | | | | | | | | | Change-Id: Id8e6e8311e46e4c8644d41d773aeb27416ca6a7e
* | | Merge "Switch to ksa Session"Jenkins2015-12-023-6/+7
|\ \ \
| * | | Switch to ksa SessionDean Troyer2015-12-023-6/+7
| |/ / | | | | | | | | | | | | | | | | | | | | | * Change session imports to keystoneauth1 * Change keystoneclient.exception imports to keystoneauth1 * Change exceptions raised from internal API from keystoneclient to openstack.common Change-Id: I046d89f561d6fe04baae53726f9749d2e7fe2056
* | | 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 "Introduce FakeVolume class"Jenkins2015-12-011-0/+84
|\ \ | |/ |/|
| * Introduce FakeVolume classxiexs2015-11-301-0/+84
| | | | | | | | | | | | | | | | | | | | Introduce FakeVolume to improve the current volume unittest framework with following two advantages: 1. generate more than one faking volumes 2. all faking volumes generated by random Change-Id: I9d56efa4fd4f03c82cd4e29622b6312566dbc453 Implements: blueprint improve-volume-unittest-framework
* | 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 "Consistency of the --all argument for snapshots"Jenkins2015-12-011-1/+32
|\ \
| * | Consistency of the --all argument for snapshotsJean-Philippe Evrard2015-11-301-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change is inspired by the volume.py. It allow the user to use openstack snapshot list --all. Closes-Bug: #1517386 Change-Id: I72a53fcd0c5c5af539cd88b37e71b4331fa67473
* | | Merge "Add project name/ID validation for "openstack quota show""Jenkins2015-12-012-0/+123
|\ \ \
| * | | Add project name/ID validation for "openstack quota show"xiexs2015-11-292-0/+123
| | |/ | |/| | | | | | | | | | | | | | | | A validation is necessary to check the existence of project. This patch is similar to Ia2d8c96527820e25b074e6486d3f39c5ad7eae60. Change-Id: Id8895ba7a21ecad05942619a82a87c0dc68eae53
* | | Merge "Add status column for "openstack image list""Jenkins2015-11-302-17/+28
|\ \ \
| * | | Add status column for "openstack image list"xiexs2015-11-292-17/+28
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Actually, the status column is useful for the user. So, it`s better to output this info by default (or, user had to specify the extra option, i.e. --long). Change-Id: Id2a9f86f0de5310f8f5ff9a46bf1b7411094b519 Closes-Bug: #1519181