summaryrefslogtreecommitdiff
path: root/openstackclient/tests/network
Commit message (Collapse)AuthorAgeFilesLines
* Support "network create" command in nova networkTang Chen2016-03-021-0/+114
| | | | | | | | | | | | This patch only provide network name and subnet setting for "network create" command. The other options, such as --project which depends on identity v2 or v3, will make the unit tests too complicated. So I prefer to implement them in other patches. Change-Id: I9ec93f0af813c8fae4170c36e16bbe8f0f53cbb6 Partial-Bug: 1543672
* Merge "TrivialOrder: Rearrange Class Names"Jenkins2016-03-011-29/+29
|\
| * TrivialOrder: Rearrange Class Namesreedip2016-03-011-29/+29
| | | | | | | | | | | | | | | | | | | | | | As per the comment given by Steve Martinelli in https://review.openstack.org/#/c/278209/ , the following patch just rearranges the classes as per the Alphabetical order. TrivialFix Change-Id: Ib8f0f703df4ef7d7ee6180ff8bd8a47062ae5b0f
* | Merge "Refactor security group list to use SDK"Jenkins2016-03-011-9/+142
|\ \ | |/ |/|
| * Refactor security group list to use SDKRichard Theis2016-02-291-9/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored the 'os security group list' command to use the SDK when neutron is enabled, but continue to use the nova client when nova network is enabled. This refactor also removes the logic for displaying project names instead of project IDs when the --all-projects option is specified. This logic was removed because it is inconsistent with the other network commands. Since neutron will always display security groups across all projects for an admin, the --all-projects option is now hidden when neutron is enabled and the Project column is always displayed. Change-Id: I934a1f5084ef3c5f929d0ffd38ebf5064d799941 Partial-Bug: #1519511 Related-to: blueprint neutron-client
* | Subnet: Add "subnet delete" command using SDKreedip2016-03-011-0/+29
|/ | | | | | | | This patch adds "subnet delete" command to osc using sdk. Change-Id: I6be27406b16909c6db2b95417355be302e218a8d Implements: blueprint neutron-client Closes-bug: #1542362
* Router: Add --route and --clear-routes options to "router set" commandTang Chen2016-02-271-0/+57
| | | | | | | | | | | | | | | | | --route option is used to set routes to the router. It is used like this: --route destination=subnet,gateway=ip-address destination: destination subnet CIDR gateway: nexthop IP address --clear-routes is used to clear all routes on the router. Change-Id: I97ce4871113c684b29c98cdad4dec9cc80ed20f7 Implements: blueprint neutron-client Partial-bug: #1519503
* Merge "Floating IP: Neutron support for "ip floating show" command"Jenkins2016-02-252-2/+122
|\
| * Floating IP: Neutron support for "ip floating show" commandTang Chen2016-02-242-2/+122
| | | | | | | | | | | | Change-Id: I30350076621c83c758927444e5f8bcc2b7d0fc74 Partial-Bug: 1519502 Related-to: blueprint neutron-client
* | Merge "Fixed a bunch of spacing"Jenkins2016-02-254-0/+11
|\ \ | |/ |/|
| * Fixed a bunch of spacingBrandon Palm2016-02-234-0/+11
| | | | | | | | | | | | | | Nothing too complicated here. I fixed a bunch of spacing issues that I saw in OSC. Change-Id: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d
* | Merge "Add "security group rule show" command"Jenkins2016-02-232-4/+122
|\ \
| * | Add "security group rule show" commandRichard Theis2016-02-232-4/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the "os security group rule show" command which will use the SDK when neutron is enabled, and use the nova client when nova network is enabled. Change-Id: I41efaa4468ec15e4e86d74144cc72edc25a29024 Partial-Bug: #1519512 Implements: blueprint neutron-client
* | | Fix wrong return value in TestDeleteFloatingIPNetworkTang Chen2016-02-231-1/+1
| |/ |/| | | | | | | | | delete_ip() should return None, not the fake floating IP. Change-Id: I1476189a09a94c76c90f9a3986e3ae57dc66d796
* | Add "os subnet show" command using SDKBrad Behle2016-02-222-2/+83
| | | | | | | | | | | | | | | | | | | | | | Implement the openstack client subnet show command using SDK calls. This shows the details of a specific subnet. Co-Authored-By: Terry Howe <terrylhowe@gmail.com> Partially implements: blueprint neutron-client Closes-Bug: #1542359 Change-Id: Iaf18b9e44af35ca0cd61033b468e0c60cd3b05d6
* | Refactor: Set "project_id" for FakeXXX in a consistent styleTang Chen2016-02-201-10/+9
| | | | | | | | | | | | | | | | | | | | | | OpenStack SDK will translate "project_id" into "tenant_id" automatically when referring to "tenant_id" attribute with the name "project_id". So when faking an object returned fron SDK, we need to fake this behavior. The original way is ugly. This patch turns it into a consistent style, and give better comments. Change-Id: I0dfb1f7552fc28eb4e7ebf5c614c9f3bde79ad80
* | Merge "Subnet Pool: Add "subnet pool show" command"Jenkins2016-02-192-1/+90
|\ \ | |/ |/|
| * Subnet Pool: Add "subnet pool show" commandTang Chen2016-02-192-1/+90
| | | | | | | | | | | | Change-Id: I8dda7bbf1e27b0ac773f62a5cd293387da96f8df Closes-Bug: 1544590 Implements: blueprint neutron-client
* | Merge "Use assertIsNone() instead of assertEqual(None, xxx)"Jenkins2016-02-192-4/+4
|\ \
| * | Use assertIsNone() instead of assertEqual(None, xxx)Tang Chen2016-02-192-4/+4
| | | | | | | | | | | | Change-Id: Ibbd7d6d27b2ff20304e3121fbadd5d50c1836d9b
* | | Merge "Subnet Pool: Add "subnet pool list" command"Jenkins2016-02-192-1/+74
|\ \ \ | | |/ | |/|
| * | Subnet Pool: Add "subnet pool list" commandTang Chen2016-02-192-1/+74
| |/ | | | | | | | | | | Change-Id: I7935be2488fb728ced9680d75880870e5d315655 Closes-Bug: 1544589 Implements: blueprint neutron-client
* | Floating IP: Fix "ip floating list" in neutron networkTang Chen2016-02-192-10/+19
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation of "ip floating list" in the commit below is incorrect: Change-Id: I253f66f6bc64470e1a18ffea506048eb53f67d5c This is because the FloatingIP objects returned from Nova and Neutron network are different. They need different handling. This patch fixes this problem. The output for Neutron network would be: +--------------------------------------+---------------------+------------------+------+ | ID | Floating IP Address | Fixed IP Address | Port | +--------------------------------------+---------------------+------------------+------+ | 1976df86-e66a-4f96-81bd-c6ffee6407f1 | 172.24.4.3 | None | None | +--------------------------------------+---------------------+------------------+------+ The output for Neutron network would be: +----+---------------------+------------------+-----------+--------+ | ID | Floating IP Address | Fixed IP Address | Server ID | Pool | +----+---------------------+------------------+-----------+--------+ | 1 | 172.24.4.1 | None | None | public | +----+---------------------+------------------+-----------+--------+ Change-Id: I1295e922df695414511d9a07ca4a8e2428040064 Partial-Bug: 1519502 Related-to: blueprint neutron-client
* Merge "Subnet Pool: Add "subnet pool delete" command"Jenkins2016-02-182-0/+118
|\
| * Subnet Pool: Add "subnet pool delete" commandTang Chen2016-02-182-0/+118
| | | | | | | | | | | | Change-Id: Ic5ba5effcaea2410421a81da8ffce7c0295179e7 Closes-Bug: 1544587 Partially implements: blueprint neutron-client
* | Merge "Support "network show" command in nova network"Jenkins2016-02-181-0/+109
|\ \
| * | Support "network show" command in nova networkTang Chen2016-02-171-0/+109
| | | | | | | | | | | | | | | | | | | | | | | | "network show" command is not implemented in nova network. This patch implements it. Change-Id: I1fadd890fe36c4e3ac5c9ed389b20c5b2fff8aca partial-Bug: 1543672
* | | Merge "Support "network list" command in nova network"Jenkins2016-02-181-3/+50
|\ \ \ | |/ /
| * | Support "network list" command in nova networkTang Chen2016-02-171-3/+50
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "network list" command is not implemented in nova network. This patch implements it. The Network object in novaclient is quite different from the one in sdk. And the output of "network list" using Nova network is also quite different from using Neutron. It is like this: # openstack network list +--------------------------------------+---------+-------------+ | ID | Name | Subnet | +--------------------------------------+---------+-------------+ | 96a98ec4-31f6-45f6-99e6-9384569b3bb5 | private | 10.0.0.0/24 | +--------------------------------------+---------+-------------+ --long and --external options have not been implemented because the attrs in Network object in novaclient is too much different. This patch also introduces a new FakeNetwork class in compute/v2/fake.py to fake nova network. Change-Id: Id1fdf81fb2fa8b39f2c76b7bae37ac4fecafd0f7 Depends-On: I1b59264cd40aaf1062f4e8db233ccb7fd0e95f0e partial-Bug: 1543672
* | Merge "Refactor security group rule delete to use SDK"Jenkins2016-02-182-13/+161
|\ \ | |/ |/|
| * Refactor security group rule delete to use SDKRichard Theis2016-02-102-13/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored the 'os security group rule 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 also introduces new FakeSecurityGroupRule classes for testing network and compute security group rules. And fixes were made to the network FakeSecurityGroup class. Change-Id: I8d0917925aa464e8255defae95a2a2adfb6cfb75 Partial-Bug: #1519512 Related-to: blueprint neutron-client
* | Define FakeFloatingIP class in tests/compute for nova network commandsTang Chen2016-02-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "ip floating list" command is not available for Neutron now because the implementation is incorrect. The FloatingIP objects returned from Nova and Neutron network are quite different. So they need different FakeFloatingIP class to do the tests. This patch copies class FakeFloatingIP in tests/network to tests/compute for Nova network tests. Will fix the problem in "ip floating list" command and change FakeFloatingIP in tests/network to fit Neutron network tests. Change-Id: Ia29d257868e0f1dc6cd7cfe3819875e5913f76ec Partial-Bug: 1519502 Partially implements: blueprint neutron-client
* | Merge "Rename parameter "identifier" to "network" in network commands"Jenkins2016-02-151-4/+4
|\ \
| * | Rename parameter "identifier" to "network" in network commandsTang Chen2016-02-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In other commands, the name or ID of an object is just the name of the object. For example, name or ID of a server is "server", router is "router". So, do not use "identifier" in network commands. Also, the parameter in doc file network.rst is not "identifier", but "network". Change-Id: I1ec3beefbb878a207bca280b994ca176ef04ee2d
* | | Merge "Use assertRaises() to check if an exception is raised"Jenkins2016-02-152-24/+15
|\ \ \
| * | | Use assertRaises() to check if an exception is raisedTang Chen2016-02-142-24/+15
| |/ / | | | | | | | | | | | | | | | | | | In some test cases, try/except is used to check if an exception has been raised. We should use assertRaises() instead. Change-Id: I15c8e757dcab77fd6f895feb018184e1eb7e617b
* | | Support "network delete" command in nova networkTang Chen2016-02-141-0/+47
|/ / | | | | | | | | | | | | | | | | "network delete" command is not implemented in nova network. This patch implements it. Change-Id: I5dac1eed6eb8e67298bb446418835a6ab85c859c Depends-On: I1b59264cd40aaf1062f4e8db233ccb7fd0e95f0e partial-Bug: 1543672
* | Floating IP: Neutron support for "ip floating list" commandTang Chen2016-02-142-1/+80
| | | | | | | | | | | | Change-Id: I253f66f6bc64470e1a18ffea506048eb53f67d5c partial-Bug: 1519502 Related-to: blueprint neutron-client
* | Floating IP: Neutron support for "ip floating delete" commandJude Job2016-02-142-1/+181
| | | | | | | | | | | | | | | | | | | | This patch implements "ip floating delete" command for both compute and network. Also includes unit tests. Change-Id: Ie61f0faad65ec90f9d9956ae463412be8d963d05 partial-Bug: 1519502 Related-to: blueprint neutron-client Co-Authored-By: Tang Chen <chen.tang@easystack.cn>
* | Merge "Add NetworkAndCompute Lister and ShowOne classes"Jenkins2016-02-131-27/+91
|\ \
| * | Add NetworkAndCompute Lister and ShowOne classesRichard Theis2016-02-121-27/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch set introduces the NetworkAndComputeLister and NetworkAndComputeShowOne classes which are related to the NetworkAndComputeCommand class. These classes are for commands that must support neutron and nova network. The new classes allows both the parser and actions to be unique. Change-Id: I1b59264cd40aaf1062f4e8db233ccb7fd0e95f0e Partial-Bug: #1519511 Partial-Bug: #1519512 Related-to: blueprint neutron-client
* | | Trivial: Fix a typo in test_network.pyTang Chen2016-02-111-1/+1
|/ / | | | | | | Change-Id: I5fe4865473ea885b54d02b5d174a632221f815c8
* | Fix DisplayCommandBase comments for cliff Lister subclass testsTang Chen2016-02-092-5/+15
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As bug #1477199 describes, the wrong comment below is all over the unit test code of OSC. # DisplayCommandBase.take_action() returns two tuples There is no such class named DisplayCommandBase in OSC. It is in cliff. All OSC command classes inherit from the base classes in cliff, class Command, class Lister and class ShowOne. It is like this: Object |--> Command |--> DisplayCommandBase |--> Lister |--> ShowOne take_action() is an abstract method of class Command, and generally is overwritten by subclasses. * Command.take_action() returns nothing. * Lister.take_action() returns a tuple which contains a tuple of columns and a generator used to generate the data. * ShowOne.take_action() returns an iterator which contains a tuple of columns and a tuple of data. So, this problem should be fixed in 3 steps: 1. Remove all DisplayCommandBase comments for tests of classes inheriting from class Command in cliff as it returns nothing. 2. Fix all DisplayCommandBase comments for tests of classes inheriting from class Lister in cliff. Lister.take_action() returns a tuple and a generator. 3. Fix all DisplayCommandBase comments for tests of classes inheriting from class ShowOne in cliff. ShowOne.take_action() returns two tuples. This patch finishes step 2 in all but identity tests. There are too many such comments in identity tests. So fix them all in another patch. Change-Id: I00f38d12f55abe20fa708f6349073da658622f8d Partial-bug: #1477199
* 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-033-0/+280
|\ \
| * | Refactor security group delete to use SDKRichard Theis2016-02-023-0/+280
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
|\ \