summaryrefslogtreecommitdiff
path: root/openstackclient/tests/network
Commit message (Collapse)AuthorAgeFilesLines
* 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-092-66/+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-092-72/+23
| | | | | | | | | | | | | | | | | | | 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 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
* 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
* Merge "Remove the --dhcp option to network list"Jenkins2015-07-141-48/+0
|\
| * Remove the --dhcp option to network listTerryHowe2015-07-081-48/+0
| | | | | | | | | | | | | | | | | | | | The --dhcp option lists agents, not networks. This does not make a lot of sense. Another command should be created to list agents. BackwardsIncompatibleImpact Closes-Bug: #1472613 Change-Id: I5ecfe3fc046a07eb64a4dabd41dbd99de7c2215f
* | Remove testing of cliff command line optionsTerryHowe2015-07-082-31/+4
|/ | | | | | These options are part of cliff, let cliff test them. Change-Id: I802c25ba80048607eef6909a21709dcda63231cc
* fix confused domain argument for network create v2Guojian Shao2015-06-261-5/+4
| | | | | | | | | | | we have used domain scope arguments --project-domain, --user-domain and --group-domain in identity commands, for example, role add v3, to prevent resources conflict from same resource name existence. To keep with the style of identity commands, it's better to rename --domain to --project-domain. Closes-Bug: #1468988 Change-Id: Ic6ccb895cf9be4a3d5f0001525e3b80cd340da8b
* Add project and domain params to network createColleen Murphy2015-03-191-0/+100
| | | | | | | | | | | | | | | | | | | | | | Without this patch, openstackclient has no way to specify to which project a network belongs upon creation. Instead, it uses the project ID that the user is authenticating with to fill the tenant_id column. This is a problem because an admin user is unable to specify a project for a non-admin network. To fix this and to improve feature parity with the neutron client, this patch adds project and domain parameters to the network create command and uses the given project name to look up the project ID. Neutron does not allow the project to be changed after creation, so no such parameter has been added to the neutron set command. Neutron calls the field 'tenant_id', but this change exposes the parameter as '--project' to support the newer terminology. If no project is specified, the client defaults to the previous behavior of using the auth project. Change-Id: Ia33ff7d599542c5b88baf2a69b063a23089a3cc4
* Begin low-level API for Network v2Dean Troyer2015-01-222-84/+207
| | | | | | | | | api.network.APIv2 starts with network_list() support to flush out the skeleton of the Network API. list_dhcp_agent() supports the --dhcp option of 'network list' Change-Id: I9a2b90cde84eced1f2ea6a014b769e2bae668211
* 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
* Merge "Add network extension list"Jenkins2014-09-181-0/+35
|\
| * Add network extension listTerry Howe2014-07-261-0/+35
| | | | | | | | | | | | | | Network extension list support Change-Id: I013f68ef2c3329c8db59e2441dd8d4ffafd4470e Closes-Bug: #1337685
* | Network use enable/disable vs admin state up/downTerry Howe2014-08-181-4/+4
|/ | | | | | Use --enable and --disable vs --admin-state-up/--admin-state-down Change-Id: I90040b925cb537a8ba13d1dd609c51bb669cf149
* Merge "Allow network find to use alternate name"Jenkins2014-07-081-0/+72
|\
| * Allow network find to use alternate nameTerry Howe2014-07-071-0/+72
| | | | | | | | | | | | | | | | Add the name_attr to the network find method so it can search for things like floating_ip_address for floating IP addresses rather than just id. Change-Id: I827e3745b06397a54555d1286e477bf2e05bf789
* | Python 3: do not compare a list to a zip objectTerry Howe2014-07-071-5/+5
|/ | | | | | In Python 3, zip() returns a zip object, not a list. Change-Id: I1a472bec3e12b5ae3c3555cf690b99a57579ce83
* Move network stuff to v2 instead of v2_0Terry Howe2014-07-072-1/+1
| | | | | | Rename network stuff v2 Change-Id: Ia9b8feda20dfd35b0f3712b8e2419d0bf5da0acd
* Network CRUDTerry Howe2014-06-244-0/+371
bp/neutron https://wiki.openstack.org/wiki/OpenStackClient/Commands#Network_2 Change-Id: I89ee083154afa544b03587e84becace36d9d522a