summaryrefslogtreecommitdiff
path: root/openstackclient/tests/network/v2/test_router.py
Commit message (Collapse)AuthorAgeFilesLines
* move unit tests to new "unit" test moduleSteve Martinelli2016-09-081-751/+0
| | | | | | | | this will better isolate the unit tests from the functional tests. unfortunately, the "integration" tests had to be lumped into the "unit" tests since we need the separation in testr.conf Change-Id: Ifd12198c1f90e4e3c951c73bfa1884ab300d8ded
* Add command to unset information from Routersreedip2016-06-271-0/+51
| | | | | | | | This patch introduces the ``router unset`` command to clear the routing information from the routers. Implements: blueprint network-property-unset Change-Id: Iac8d32ca42fb28878805b4b58ab411b67fa6555b
* Error handling of "router delete" commandHuanxuan Ao2016-06-201-7/+59
| | | | | | | | "Router delete" command supports multi deletion but no error handling. This patch add the error handling follow the rule in doc/source/command-error.rst Change-Id: I3376d957b4dc28d8282599dc909ecc5ed2b5f46a
* osc-lib: utilsDean Troyer2016-06-131-1/+2
| | | | | | | | Use osc-lib directly for utils. Leave openstackclient.common.utils for deprecation period. Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
* Make set/unset commands in network return normally when nothing specifiedTang Chen2016-06-081-5/+12
| | | | | | | | | | | | | | set/unset commands should ends up normally instead of raising an exception when nothing is specified to modify. The main reason is: When nothing is specified, the command sets/unsets nothing, which is a normal behavior, and ends up normally. No API call fails. No error happens. This patch also adds a releasenote for both network, and volume commands that fix patch has been merged. Change-Id: I78c348066078decd350417a431f3b8bea8fcf9ef Partial-bug: #1588588
* Added --no-route to the router set commandHideki Saito2016-05-161-0/+36
| | | | | | | | Deprecated --clear-routes Closes-Bug #1565034 Change-Id: I4a8975edc026aecd2a362fd1929c984cfab8ade6
* Trivial: Remove unuseful comments for assertRaise() checkingTang Chen2016-05-061-8/+0
| | | | | | | | "Missing required args should bail here" is not understandable and not necessary. The code is obvious enough. And some of the comments are misused because of code copy. So remove them. Change-Id: I031395f2c882386c7a708db5cf4eee75393dc639
* Remove unnecessary type conversions in network unit testsTang Chen2016-05-061-1/+1
| | | | | | | | | In some tests, when comparing the results data with the expected ones, many unnecessary type conversions are used. So remove them to clean up. Change-Id: I560ca78a3ab5e7b99087bfe1667de500f92c68de Partial-bug: #1550633
* Fix router set --route optionRichard Theis2016-04-181-6/+9
| | | | | | | | | | | Fix the "--route" option on the "os router set" command. The option did not properly format the new routes to set which resulted in a "HttpException: Bad Request" error. In addition, the output for routes was fixed to improve readability and to align with the "--route" option on the "os router set" command. Change-Id: I9c514153ec201e2feae32be6dd281771e3298b9c Closes-Bug: #1564460
* Move keys() methods in each resource class to FakeResourceTang Chen2016-04-111-2/+21
| | | | | | | | | | | | | | FakeXXX classes in network don't need to fake any method, except keys(). But keys() can be put in FakeResource since it just returns all attributes in _info. This patch moves removes all unnecessary fake methods code, moves keys() method to FakeResource. This patch also finds out some missing attributes in network and router tests. Change-Id: I799822c8715b9ac4f95b98f8350f196757d79d3e
* Merge "Add Subnet add/remove support to router"Jenkins2016-04-091-0/+79
|\
| * Add Subnet add/remove support to routerreedip2016-03-221-0/+79
| | | | | | | | | | | | | | | | | | | | | | The following patch adds the support for "router add subnet" and "router remove subnet" to the OSC as a part of migration of Neutron's CLI commands. Partial-Bug: #1546849 Implements: blueprint neutron-client-advanced-router Change-Id: Ia3770c41026194bdb1543d4e67446f81936d44d1
* | Merge "Add "router remove port" to osc"Jenkins2016-04-091-0/+40
|\ \ | |/
| * Add "router remove port" to oscreedip2016-03-211-0/+40
| | | | | | | | | | | | | | | | | | | | This patch proposes the migration of port deletion of Neutron's "router-interface-delete" to OSC's "router remove port". Change-Id: Ifceabce080aacac9f6410c809fcc097760e0c5ee Partial-Bug: #1546849 Implements: blueprint neutron-client-advanced-router
* | Merge "Add "router add port" to osc"Jenkins2016-04-081-0/+41
|\ \ | |/
| * Add "router add port" to oscreedip2016-03-211-0/+41
| | | | | | | | | | | | | | | | | | | | This patch proposes the migration of port addition of Neutron's "router-interface-add" to OSC's "router add port". Change-Id: I3a8a76d384caa32975f8e77f50f3cf3c3be13786 Closes-Bug: #1546849 Depends-On: I9783bc4ccceae3d361dce52d51483ef2187920a9 Implements: blueprint neutron-client-advanced-router
* | Follow Boolean Option rulereedip2016-03-311-7/+5
| | | | | | | | | | | | | | | | | | | | | | OSC has a specific rule for handling boolean based options in [1]. This patch modifies the exisiting code so that it matches the criteria that have been specified in [1]. [1]: http://docs.openstack.org/developer/python-openstackclient/command-options.html#boolean-options Closes-Bug: #1559418 Change-Id: I182381d5579efbc75a5d3e8a91f412398abf5c3c
* | Use assert_called_once_with() instead of assert_called_with()Tang Chen2016-03-221-11/+15
|/ | | | | | | If one API is only called once, we'd better use assert_called_once_with() to check the call. Change-Id: Id05055bb90592d218826732259ed84fc366734ce
* Fix incorrect unit test for routerTang Chen2016-03-031-2/+2
| | | | | | | | | | | Command "router show" will display router's "tenant_id" as "project_id". But in the unit test, it checks "tenant_id", which is incorrect. This patch fix this problem, and add a _get_columns() helper function to simplify the code. Change-Id: I0087ef7dfd0130b6c47222495848c4f2b9804b1b
* 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
* Use assertRaises() to check if an exception is raisedTang Chen2016-02-141-14/+9
| | | | | | | In some test cases, try/except is used to check if an exception has been raised. We should use assertRaises() instead. Change-Id: I15c8e757dcab77fd6f895feb018184e1eb7e617b
* Fix DisplayCommandBase comments for cliff Lister subclass testsTang Chen2016-02-091-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add availability zone support for router commandsJas2016-01-291-0/+28
| | | | | | | | | | 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
* Replace assertEqual(None, *) with assertIsNone in testsSaiKiran2015-12-171-3/+3
| | | | | | | | In python-openstackclient some test cases using asserEqual(None, *) instead of assertIsNone(). assertIsNone method provides clear error message. Change-Id: I3069a6436d11efa513ae94f21ceab46c498d6e25 Closes-Bug: #1527054
* 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
* 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
* 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-151-0/+62
| | | | | | | | | | | | | | | 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