summaryrefslogtreecommitdiff
path: root/openstackclient/tests/network/v2
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Support listing network availability zones"Jenkins2016-02-041-0/+53
|\
| * Support listing network availability zonesRichard Theis2016-02-021-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the "os availability zone list" command to support listing network availability zones along with the currently listed compute and volume availability zones. This adds the --network option to the command in order to only list network availability zones. By default, all availability zones are listed. The --long option was also updated to include a "Zone Resource" column which is applicable to network availability zones. Example zone resources include "network" and "router". If the Network API does not support listing availability zones then a warning message will be issued when the --network option is specified. This support requires an updated release of the SDK in order to pull in [1]. [1] https://bugs.launchpad.net/python-openstacksdk/+bug/1532274 Change-Id: I78811d659b793d9d2111ea54665d5fe7e4887264 Closes-Bug: #1534202
* | Merge "Refactor security group delete to use SDK"Jenkins2016-02-032-0/+177
|\ \
| * | Refactor security group delete to use SDKRichard Theis2016-02-022-0/+177
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored the 'os security group delete' command to use the SDK when neutron is enabled, but continue to use the nova client when nova network is enabled. This patch set introduces a new NetworkAndComputeCommand class to be used for commands that must support neutron and nova network. The new class allows both the parser and actions to be unique. The current DeleteSecurityGroup class is now a subclass of this new class and has moved under the network v2 commands. This patch set also introduces a new FakeSecurityGroup class for testing security groups. And finally, this patch set updates the command documentation for security group and security group rule to indicate that Network v2 is also used. Change-Id: Ic21376b86b40cc6d97f360f3760ba5beed154537 Partial-Bug: #1519511 Related-to: blueprint neutron-client
* | Merge "Network: Abstract get_body() out to be a private helper."Jenkins2016-02-032-9/+11
|\ \
| * | Network: Abstract get_body() out to be a private helper.Tang Chen2016-02-022-9/+11
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | get_body() is needed in each network files to construct a dict to pass to sdk proxy. And it is also used by several functions in each file. So define it as a file level private helper function. The unified prototype should be: def _get_attrs(client_manager, parsed_args): 1. The name, in sdk, the parameter passed to proxy is named "attrs". And it is a private method. So let's call it _get_attrs(). 2. The parameters, besides parsed_args, when we deal with project and project_domain, we have to make use of identity_client. So let's pass in the client manager. Change-Id: Ib044ebd4ddedbcd805f46334a7fe99e4ebb5b249
* | Merge "Add "os port show" command"Jenkins2016-02-032-4/+125
|\ \
| * | Add "os port show" commandRichard Theis2016-02-022-4/+125
| |/ | | | | | | | | | | | | | | Add "os port show" command. Change-Id: Id87c81640e74c60ae8f247c722c64fdadff022a2 Partial-Bug: #1519909 Partially-Implements: blueprint neutron-client
* | Merge "Add availability zone support for router commands"Jenkins2016-02-032-0/+30
|\ \ | |/ |/|
| * Add availability zone support for router commandsJas2016-01-292-0/+30
| | | | | | | | | | | | | | | | | | | | This patch allows the adding of availability_zone_hints during router create. Also allows for the display of availability_zones during list and and show commands. Change-Id: Ifbc5c218bc7103d28076d726212ce25321bcf7f1 Partial-bug: #1519503 Partially-implements: blueprint neutron-client
* | Fix showing network quotas for a projectRichard Theis2016-02-021-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OpenStack SDK is now used for the network client. However, the 'openstack quota show' command wasn't updated for the client change. As a result, the command will fail to show network quotas when a project name is specified. For example: $ openstack quota show admin 'Proxy' object has no attribute 'show_quota' This patch set fixes the command by using the OpenStack SDK to get network quotas for a project. Change-Id: I59a7b6780a7b80cd09e79d40d214751b25d3016e Related-To: blueprint neutron-client Closes-Bug: #1528249
* | Merge "Add availability zone support for network commands"Jenkins2016-01-312-2/+25
|\ \
| * | Add availability zone support for network commandsBrad Behle2016-01-282-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add --availability-zone-hint parm to network create. Also add availability_zones and availability_zone_hints to the network list and network show commands Change-Id: Ib4dc2e3e7897939be7bef6b25a095c8222b885bc Partially-implements: blueprint neutron-client
* | | Use correct terminology for subnetsDean Troyer2016-01-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenStack uses 'CIDR' incorrectly in many places. We are not going to perpetuate that usage. The correct name here is simply 'subnet' as the data is the network address for the subnet, in CIDR notation. Also, some additional cleanups as suggested in comments to https://review.openstack.org/#/c/84782 Depends-on: I3c0748074a6511ff92500516b3129886d2476eed Change-Id: Ib44c49dc1739ce7d881432e482dd16f8928eef49
* | | Subnet ListTerry Howe2016-01-252-0/+176
|/ / | | | | | | | | | | | | | | Subnet list command Partially implements: blueprint neutron-client Partial-Bug: #1523258 Change-Id: I3c0748074a6511ff92500516b3129886d2476eed
* | Add support to delete the portsSaiKiran2016-01-202-0/+130
|/ | | | | | | | This patch adds "port delete" command to osc. Change-Id: I5c92b2f573249df4e6551506584ccafb4ff290b2 Implements: blueprint neutron-client Partial-Bug: #1519909
* Merge "Map some of the SDK field names"Jenkins2016-01-012-8/+11
|\
| * Map some of the SDK field namesTerry Howe2015-12-102-8/+11
| | | | | | | | | | | | | | | | The keys() method returns the keys returned from Neutron, but the SDK maps some things like tenant_id to project_id. This makes the output a little prettier. Change-Id: Ibd8c890b61ffc94021f93fc1051fcf5dabd1e9ea
* | Replace assertEqual(None, *) with assertIsNone in testsSaiKiran2015-12-172-6/+6
| | | | | | | | | | | | | | | | In python-openstackclient some test cases using asserEqual(None, *) instead of assertIsNone(). assertIsNone method provides clear error message. Change-Id: I3069a6436d11efa513ae94f21ceab46c498d6e25 Closes-Bug: #1527054
* | Merge "Router: Add "router show" command using SDK"Jenkins2015-12-161-0/+58
|\ \
| * | Router: Add "router show" command using SDKTang Chen2015-12-171-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds "router show" command to osc using sdk. Change-Id: Idb0f7f0376926e97f9f70a52ef21511e7ffa9d92 Implements: blueprint neutron-client Partial-bug: #1519503
* | | Merge "Router: Add "router set" command using SDK"Jenkins2015-12-161-0/+90
|\ \ \ | |/ /
| * | Router: Add "router set" command using SDKTang Chen2015-12-171-0/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds "router set" command to osc using sdk. NOTE: Setting ha property of a router is not supported for now. Will suppport it in another patch. Change-Id: I9c15249ae61a87291f0728ad1c8f0a98aa8119bf Implements: blueprint neutron-client Partial-bug: #1519503
* | | Merge "Network: Improve no option test for "network create"."Jenkins2015-12-161-0/+10
|\ \ \ | |/ / |/| |
| * | Network: Improve no option test for "network create".Tang Chen2015-12-151-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Currently, test_create_no_options() case actually takes a 'name' arg. Rename it to test_create_default_options, and add a test_create_no_options case taking nothing. Change-Id: I4f9d2e8cbfa843faea641d3cc959f96894c9cd5d
* | | Router: Add "router delete" command using SDKTang Chen2015-12-161-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds "router delete" command to osc using sdk. Change-Id: I47d0ca7f7984942ffceaeb1c9ac69efd09145f40 Implements: blueprint neutron-client Partial-bug: #1519503
* | | Router: Add "router create" command using SDKTang Chen2015-12-152-1/+66
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds "router create" command to osc using sdk. NOTE: Test for --project needs support for fake identity client v2 and v3. These tests will be added in other patches. NOTE: external_gateway_info and routes are not supported to be passed to create command now. They will be supported in another tow patches. NOTE: Creating a ha router is not supported for now. Will support it in another patch. Change-Id: I7642295d27c27dd498331ae1da1c293706d8f6af Implements: blueprint neutron-client Partial-bug: #1519503
* | Router: Add "router list" command using SDKTang Chen2015-12-111-0/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add "router list" command. It takes one "--long" option. By default, the command will print router id, name, status, admin state up, distributed, ha and project id. With "--long" option, it will also print routes and external gateway info. Change-Id: I9d21904c41c11ee1fa107f985744878a1dc2f970 Implements: blueprint neutron-client Partial-bug: #1519503
* | Router: Add class FakeRouter to test "router xxx" commandTang Chen2015-12-111-0/+81
|/ | | | | | | | | A unit test class similar to FakeServer, which is able to fake one or more routers. It will be used by the router CRUD patches. Change-Id: I9b87c6c95282902c3a829da51229a35d4265a1e4 Implements: blueprint neutron-client Partial-bug: #1519503
* Trivial: Do not use plural format in command parameter in "network delete"Tang Chen2015-12-111-1/+1
| | | | | | | | | | Since "network delete" could delete more than one network, add a (s) to the doc. And also, rename the parameter "networks" to "network". The naming style is not using plural format in parameter. Change-Id: Id434ea905af34457f84ea6bcb18addef5800429a
* Remove old code after sdk integrationTerry Howe2015-12-092-9/+0
| | | | | | We won't need this anymore. Change-Id: Ib10be1dedb8db81f0cba6e45b8a9b0aade2ab473
* SDK integration extensions and server create networksTerry Howe2015-12-091-9/+11
| | | | | | | Finish up the SDK integration with server create network and port find and extension list. Change-Id: I18dbada784d8aa92a45a937f251023ddf899c53e
* Remove unuseful test data in test_netwrok.pyTang Chen2015-12-091-36/+0
| | | | | | Change-Id: Ibd4f8bb602acdcc3421205d9dafc8dcafb9645df Implements: blueprint osc-network-unit-test-refactor Related-to: blueprint neutron-client
* Migrate network client to SDK.Tang Chen2015-12-091-48/+14
| | | | | | | | | | | | | | | | | | | 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>
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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