1755 Commits

Author SHA1 Message Date
Terry Howe
7aa6e5e36c SDK integration extensions and server create networks
Finish up the SDK integration with server create network and port
find and extension list.

Change-Id: I18dbada784d8aa92a45a937f251023ddf899c53e
2015-12-09 11:39:20 -07:00
Jenkins
ccbffb2ef9 Merge "Use FakeVolume in server test cases." 2015-12-09 04:14:56 +00:00
Jenkins
dc5bd94213 Merge "Use FakeImage in server test cases." 2015-12-09 04:14:53 +00:00
Jenkins
e4cbc4485f Merge "Remove unuseful test data in test_netwrok.py" 2015-12-09 04:14:50 +00:00
Tang Chen
55480d014c Remove unuseful test data in test_netwrok.py
Change-Id: Ibd4f8bb602acdcc3421205d9dafc8dcafb9645df
Implements: blueprint osc-network-unit-test-refactor
Related-to: blueprint neutron-client
2015-12-09 13:38:36 +08:00
Jenkins
805e8f89c9 Merge "Migrate network client to SDK." 2015-12-09 04:14:47 +00:00
Jenkins
766354990d Merge "Migrate "network show" command to use SDK." 2015-12-09 04:14:45 +00:00
Jenkins
45a330ca4e Merge "Migrate "network set" command to use SDK." 2015-12-09 04:14:41 +00:00
Jenkins
f9c7baad0e Merge "Migrate "network delete" command to use SDK." 2015-12-09 03:50:46 +00:00
Jenkins
761657c8e8 Merge "Migrate "network create" command to use SDK." 2015-12-09 03:32:08 +00:00
Tang Chen
4be716eb27 Migrate network client to SDK.
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>
2015-12-09 09:30:29 +08:00
Tang Chen
2a2cb4f75d Migrate "network show" command to use SDK.
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>
2015-12-09 09:30:13 +08:00
Tang Chen
45c644d428 Migrate "network set" command to use SDK.
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>
2015-12-09 09:29:54 +08:00
Tang Chen
511e862294 Migrate "network delete" command to use SDK.
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>
2015-12-09 09:29:39 +08:00
Tang Chen
0b4fb0bb66 Migrate "network create" command to use SDK.
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>
2015-12-09 09:29:26 +08:00
Jenkins
9bff399ff3 Merge "Integrating mistralclient with openstackclient" 2015-12-08 18:15:49 +00:00
Tang Chen
56150de224 Migrate "network list" command to new version using SDK.
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>
2015-12-08 23:24:20 +08:00
Tang Chen
85d6aeea32 Trivial: Coding style fix in test_flavor.py
Change-Id: I3dcb3c4fbd9ff9c351426ae2ad9da009208a6485
2015-12-08 13:35:51 +08:00
Tang Chen
ec79d338f7 Use FakeVolume in server test cases.
We have a class FakeVolume to fake one or more volumes. So use it in
test_server.py.

Change-Id: I735ae7f678a6799e0ae4c7c25c8083d9ebf47b09
Implements: blueprint improve-volume-unittest-framework
2015-12-08 10:36:25 +08:00
Tang Chen
a4696dce1e Use FakeImage in server test cases.
We have a class FakeImage to fake one or more images. So use it in
test_server.py.

Change-Id: I276e4ade5aecefbe66b9722c1dfbac10b3bd14b6
Implements: blueprint improve-image-unittest-framework
2015-12-08 10:05:36 +08:00
Tang Chen
481b711fae SDK integration: Add a temporary method to create network client using sdk.
This patch adds a temporary method to create a network client using sdk.
This method will help to migrate network commands from neutronclient to sdk
one by one. The command which is being migrated will use this temporary
method to create the sdk client, and the rest ones will use the old client.

The temporary method will finally be removed and implement the same thing
in make_client().

This patch will also add sdk to requirements file.

And adds some formatter helper functions, which will be used in class
CreateNetwork, ListNetwork and ShowNetwork.

This patch is splited from TerryHowe <terrylhowe@gmail.com> 's original patch.

Change-Id: Ie9b35747680afeb66cf6922e2c654fbca7e03569
Implements: blueprint neutron-client
Co-Authored-By: TerryHowe <terrylhowe@gmail.com>
Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
2015-12-07 22:44:23 +08:00
Tang Chen
6a3bc765f4 Introduce class FakeNetwork to fake one or more networks.
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
2015-12-07 22:44:23 +08:00
Jenkins
695500496c Merge "Use formatter in server.py for "server list" tests." 2015-12-07 03:48:48 +00:00
Tang Chen
0d7be6fbcb Use formatter in server.py for "server list" tests.
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
2015-12-07 22:16:04 +08:00
OpenStack Proposal Bot
7d01a44822 Updated from global requirements
Change-Id: I7910586e32ec248e95f7f54fe776b3603f667c49
2015-12-06 20:47:37 +00:00
Jenkins
000b3c6dea Merge "Refactor network test: Remove unusful test code." 2015-12-06 04:07:46 +00:00
Jenkins
e19d49ba08 Merge "Refactor TestShowNetwork: Use TestNetwork in TestShowNetwork" 2015-12-06 04:04:12 +00:00
Jenkins
57c4385ef3 Merge "Refactor TestSetNetwork: Use TestNetwork in TestSetNetwork" 2015-12-06 03:52:30 +00:00
Jenkins
19d9ccb97a Merge "Refactor TestListNetwork: Use TestNetwork in TestListNetwork" 2015-12-06 03:30:27 +00:00
Jenkins
8e4a386153 Merge "Refactor TestDeleteNetwork: Use TestNetwork in TestDeleteNetwork" 2015-12-06 03:27:43 +00:00
Jenkins
0cafffa4b2 Merge "Trivial: Import network.common as network_common in server.py" 2015-12-05 23:24:18 +00:00
Jenkins
27037a43db Merge "Refactor TestCreateNetwork: Setup identity client in setUp() in TestCreateNetworkIdentityV2" 2015-12-05 20:17:03 +00:00
Jenkins
08ba88da48 Merge "Refactor TestCreateNetwork: Setup identity client in setUp() in TestCreateNetworkIdentityV3" 2015-12-05 19:50:15 +00:00
Tang Chen
dd1ca68f56 Trivial: Import network.common as network_common in server.py
In server.py, identity.common is imported as identity_common.
But network.common is imported as common, which is confuseing.
This patch imports network.common as network_common.

Change-Id: I74295bc88b22de398ab64fe556aedaca2453d17d
2015-12-06 01:18:13 +08:00
Jenkins
26a7e8d2ef Merge "Refactor TestCreateNetwork: Setup cmd in setUp() in TestCreateNetworkIdentityV2" 2015-12-05 17:17:25 +00:00
Jenkins
92a1a27edc Merge "Refactor TestCreateNetwork: Setup cmd in setUp() in TestCreateNetworkIdentityV3" 2015-12-05 17:11:49 +00:00
Jenkins
c1e4e25991 Merge "Refactor TestCreateNetwork: Split TestCreateNetwork into two classes for identity v2 and v3" 2015-12-05 16:35:21 +00:00
Jenkins
42c5d2ee1b Merge "Refactor network test: Introduce TestNetworkv2 and TestNetwork to improve unit test of network" 2015-12-05 15:53:05 +00:00
Jenkins
e93e1493b6 Merge "Trivial: Improve doc for "server create" command" 2015-12-05 09:14:43 +00:00
Tang Chen
0bb645cb99 Refactor network test: Remove unusful test code.
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
2015-12-05 10:52:05 +08:00
Tang Chen
0cc1492ccd Refactor TestShowNetwork: Use TestNetwork in TestShowNetwork
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
2015-12-05 10:52:05 +08:00
Tang Chen
84cf168d1c Refactor TestSetNetwork: Use TestNetwork in TestSetNetwork
Use TestNetwork in TestSetNetwork, and also setup test command
in setUp().

Change-Id: I4e72332fcf253407bb3d5f20aaf4be047046e146
Related-to: blueprint neutron-client
2015-12-05 10:52:05 +08:00
Tang Chen
697df67611 Refactor TestListNetwork: Use TestNetwork in TestListNetwork
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
2015-12-05 10:52:05 +08:00
Tang Chen
d1fffb2543 Refactor TestDeleteNetwork: Use TestNetwork in TestDeleteNetwork
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
2015-12-05 10:52:05 +08:00
Tang Chen
ee6855858f Refactor TestCreateNetwork: Setup identity client in setUp() in 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
2015-12-05 10:52:05 +08:00
Tang Chen
16d07e7101 Refactor TestCreateNetwork: Setup identity client in setUp() in 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
2015-12-05 10:52:05 +08:00
Tang Chen
3cc38d2844 Refactor TestCreateNetwork: Setup cmd in setUp() in TestCreateNetworkIdentityV2
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
2015-12-05 10:52:05 +08:00
Tang Chen
af6269d310 Refactor TestCreateNetwork: Setup cmd in setUp() in TestCreateNetworkIdentityV3
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
2015-12-05 10:52:05 +08:00
Tang Chen
038334ff98 Refactor TestCreateNetwork: Split TestCreateNetwork into two classes for 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
2015-12-05 10:52:05 +08:00
Tang Chen
29b9945677 Refactor network test: Introduce TestNetworkv2 and TestNetwork to improve 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
2015-12-05 10:52:05 +08:00