108 Commits

Author SHA1 Message Date
Zuul
78b18030b5 Merge "Support for stateless security groups" 2020-04-08 08:31:28 +00:00
Tom Stappaerts
5e62411e5f Support for stateless security groups
Add support for stateful attribute of security groups,
using --stateful and --no-stateful flag on security group.
This allows a user to create security groups with stateful
false.

Change-Id: Ifd20b5fc47fd0ea0bb5aeda84820dcc0fb1e8847
Blueprint: stateless-security-groups
Depends-On: https://review.opendev.org/711513/
2020-03-31 12:05:18 +02:00
Bence Romsics
dba57c85d5 Add command: router add/remove route --route
Add commands to osc to call the two new API methods introduced by
new Neutron extension: extraroute-atomic.

Bump our openstacksdk requirement to >=0.38.0 which contains
the corresponding sdk change.

The lower-constraints of dogpile.cache and keystoneauth1 are bumped
because of requirements bumps in openstacksdk.

The lower-constraint of decorator is bumped because of problem already
fixed by amotoki here: https://review.opendev.org/701706

Change-Id: Ia9b9c216f1d1161ebedac31594a2c464d77f4ae2
Depends-On: https://review.opendev.org/674324
Partial-Bug: #1826396 (rfe)
Related-Change: https://review.opendev.org/655680 (spec)
2020-03-30 16:19:05 +02:00
Dean Troyer
31c47adebb Remove races in floating ip functional tests
Multiple subnets with the same name are occasionally created when
running tests in parallel.

Change-Id: Ifb85e39ee53b529e2b97abf782c7fba93d48e9e2
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-08-31 09:03:46 -05:00
Zuul
1a21f02bc7 Merge "Use cliff formattable columns in network commands" 2019-06-22 18:27:00 +00:00
Dean Troyer
6f1f44d422 Batch up minor cleanups for release
Change-Id: Id45788e17c5388cee54e79cab1c120cfcc8f9f62
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-05-20 08:41:28 -05:00
Akihiro Motoki
c44f26eb7e Use cliff formattable columns in network commands
Use cliff formattable columns not to convert complex fields
into a string when a machine readable format like JSON or YAML
is requested.

Partial-Bug: #1687955
Partially implement blueprint osc-formattable-columns

Change-Id: I9878f327e39f56852cc0fb6e4eee9105b7141da9
2019-05-09 21:51:57 -05:00
Dean Troyer
4f3cda730f Tweak network segment range fiunction tests
We seem to be having occasional overlaps in the ranges, as they were
identical in all tests, change each test to not overlap the others
so running in parallel is not racy.

Change-Id: I7ea467a3aa2e4a4b4a334c10ea6ba21409c46af0
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-04-12 13:52:46 -05:00
Glenn Van de Water
7741347041 Fix service discovery in functional tests
If a required service is not enabled then we skip the test.
The discovery is done by tests/functional/base.py:is_service_enabled
but this method is broken, credentials are not passed to the
'openstack service show' command so every call will fail and every test
that relies on it will be skipped. This commit fixed that method and
the issues that popped up when re-enabling tests.

Network segment range:
 - issue where we assumed network-segment-range extension is always
   present
 - issue where we compare integers and string representations of numbers

Subnet:
 - issue where we try to deepcopy an uncopyable object in UnsetSubnet

Change-Id: Id3cc907c1ed2a25b49cf6f4a7233e0401a02383a
Story: 2005169
Task: 29908
2019-03-13 16:16:24 +01:00
Kailun Qin
d52920b387 Add network segment range command object
Add network segment range command object in support of network segment
range management.

This patch set includes documentation, unit tests and functional tests
(currently skipped unit network segment range enabled in Neutron by
default) for the following new commands:
  - "os network segment range create"
  - "os network segment range delete"
  - "os network segment range list"
  - "os network segment range set"
  - "os network segment range show"

Co-authored-by: Allain Legacy <Allain.legacy@windriver.com>

[depends on removed by dtroyer as those are all +W and 
trying to pass the gate, OSC has it's freeze dealine looming]
 Depends: https://review.openstack.org/624708
 Depends: https://review.openstack.org/624709
 Depends: https://review.openstack.org/638386

Partially-implements: blueprint network-segment-range-management
Change-Id: I335692f2db5be07c1c164f09b13f1abb80b7ba33
2019-03-07 19:39:17 +00:00
liuyamin
5bec3b7e3b Replace assertEqual(True/False, expr) with assertTrue/assertFalse
In some cases, If the result of expr is a boolen value, we shoud
use assertTrue/assertFalse to instead. Because it is clear and simple.

Change-Id: I53b345fc3915a7b0e737e9dd4d58fe09c746d61c
2018-11-14 14:50:05 +08:00
Sławek Kapłoński
9b6d02d5f9 Make max_burst_kbps option as optional for bw limit QoS rule
Attribute max_burst_kbps of QoS bandwidth limit rule in Neutron's
is optional in API so it should be also optional on client's side.

Change-Id: Ie085b73fa885ff12f9ac080666cf3ca6a09b632a
Related-Bug:#1770622
Task: 19658
Story: 2002017
2018-05-25 12:54:41 -07:00
Dongcan Ye
b776f7099a Fix functional job failed
After Neutron patch I3c93818002c2d7753454547231ba08544b6fa1c0 merged,
the default value of segment description is an empty string.

This patch will determine whether the Neuron shim extension
standard-attr-segment supported.

Change-Id: I68a3c018f03e5bb53bd637844ac9d7742a765db0
2018-04-20 01:47:17 +00:00
Sean McGinnis
d601415259 Clean up W503 and E402 pep8 errors
pycodestyle 2.40 and later enforce these rules that were not previously
enforced. Rather than just skipping them, this cleans up the trivial
instances of these violations.

This does also include some other updates that were not triggering errors
in an attempt to keep some of the style consistent.

Change-Id: Id7c0a6b8f1f835e69d844b000e3ed751852ada63
Closes-bug: #1762803
2018-04-15 12:23:06 +09:00
Akihiro Motoki
0626f95579 Allow port list to shown undefined attributes
At now, OSC command implementation extracts resource attributes based on
a predefined column list, so if a user specifies an unknown attribute
not defined in the column lists, such attribute will be ignored.

In case of 'port list', the neutron port defines many attributes and
it is not a good idea to show all attributes even in the long mode
from the perspective of user experience.

This commit consumes osc_lib.utils.calculate_headers_and_attrs()
function to show undefined port attributes if requested in -c option.

Closes-Bug: #1707848
Depends-On: I6c6bc3c6e3c769c96869fd76b9d9c1661280850e
Change-Id: I130a6aed41d80603698b6cab0c9a1d1dc59df743
2017-11-24 22:45:06 +00:00
Sławek Kapłoński
07f0c7aa55 Display Network QoS rule type details
Neutron API now supports getting details of supported
QoS rule type.
This patch adds support for this feature to OpenStack client.

Change-Id: I74d16563ce2236a7c899f5994f1dab43ace02138
Depends-On: I448b5d4f8e4ef42eafe50d9d6c63d0be666f98fc
Related-Bug: #1686035
2017-11-05 17:52:08 -06:00
Dean Troyer
c901620a03 Attempt to de-race qos policy
We're getting about 1-in-6 failures on qos policy delete now, with the message
that the policy is in use by a network.  It shouldn't be, this is possibly
due to the small window where the policy is set as the default.  Let's
remove that and shore up the test using --share instead.

Change-Id: I8d669bd3c5c88dadd2927aee89e5ef72cf4001c4
2017-10-18 14:03:51 -05:00
Dean Troyer
59bba7c0d2 Unroll the network qos policy functional tests
These seem to have gotten a bit racy in the last revision, just do
it the long way now.

Change-Id: I3748b8b4f264dbfa8c991b32653682e5c86eeb4c
2017-09-17 13:52:12 -05:00
Dean Troyer
949e0cb3c6 Attempt to work around chronically failing server issues with aggregates and qos
So yeah, this is not kosher for functional tests, but we're testing the
client interaction, not the raciness of Nova or Neutron.  Failure to delete
is not our problem.

Change-Id: I21043f1de0fbacee1aec63110fb12a7cff42e0a0
2017-09-15 12:34:15 -05:00
Akihiro Motoki
c1404f14b8 Convert remaining network functional tests to JSON
Change-Id: Ib7dff5506cc69549b5b1fbb8bf6e649468563dd6
2017-08-23 21:15:24 +00:00
Akihiro Motoki
fe8a50b6b1 Convert network qos functional tests to JSON
Change-Id: Ie5cde2f927ec6abb6334ea01adfb06749384ed01
2017-08-23 21:15:12 +00:00
Akihiro Motoki
95e279176b Convert network security group functional tests to JSON
Change-Id: Icb63aa0dfbce9016fb824f97915a660cf130d120
2017-08-23 21:14:47 +00:00
Dean Troyer
b30f0f3f05 Convert network segment functional tests to JSON
Change-Id: I8dc1e992d54c63c93bbe2bdd7acba61a7a6773d0
2017-08-13 07:55:21 -05:00
Akihiro Motoki
198a486413 network functest: Remove condition for segment test
Previously fucntional tests for network segment feature are skipped
as neutron 'segment' API extension was disabled in the gate.
We now enable neutron 'segment' API extension, so we can safely drop
the check for the segment extension from the test code.

Also setup code in test_network_segment is moved from setUpClass to
setUp. There is no good reason to do them in setUpClass and
having them in setUp simplifies the test code.

no user once this commit is applied.

Change-Id: I183310b94d9b6d7f4311a3859b59dc22d36440db
2017-07-27 13:49:03 +00:00
Akihiro Motoki
57e5840710 Network tag support
Neutron tag mechanism now supports network, subnet, port,
subnetpool and router. Tag support for more resources is planned.

This commit introduces a common mixin class to implement
tag operation and individual resource consumes it.

To support tag remove, network unset command is added.

Implements blueprint neutron-client-tag
Change-Id: Iad59d052f46896d27d73c22d6d4bb3df889f2352
2017-07-23 21:54:32 +00:00
Rui Chen
f1d32dbe9b Clean up the changes of os.environ in functional tests
Use fixtures to restore the API version changes of os.environ
in each functional tests, aims to avoid the following test cases
failing in unexpected context.

And make sure setUpClass/tearDownClass call super class's
corresponding methods first.

Change-Id: Ie248fe9d3a9e25f1b076c9f2c363200f29a83817
Closes-Bug: #1696080
2017-07-20 16:39:32 +00:00
Jenkins
ac8cac4b63 Merge "Network L3 Router Commands for OSC" 2017-07-20 16:35:14 +00:00
Dean Troyer
8d7ee8da0e Fix dynamic names in network functional tests
Move all of the dynamic resource naming in Network functional tests into
setUpClass() methods (if they exist) rather than assigning those names
at load-time.

Change-Id: Ic550ff7d40c2b3ca5128cacccbe331790d6ae340
2017-07-19 16:33:54 -05:00
Ankur Gupta
18c532377a Network L3 Router Commands for OSC
Implements: blueprint network-l3-commands

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Ia24d76227e164062e89a74c1621b8acb830b26cf
2017-07-11 08:17:09 +00:00
Rodolfo Alonso Hernandez
c17819ab58 Add new parameter "is_default" to Network QoS policy.
Add a set of exclusive parameters to the Network QoS policy:
  --default: makes this policy the default policy for
             the project to which the qos policy belongs.
  --no-default: unset the property.

Closes-Bug: #1639220
Depends-On: If5ff2b00fa828f93aa089e275ddbd1ff542b79d4
Depends-On: Ibe7b7881cb190bfd5582f35b6de51a8bc21135de
Change-Id: I0269b837dc29bbd8ee2089d847cadb72d800fa30
2017-07-05 13:34:33 +00:00
Rodolfo Alonso Hernandez
ccb743cf0f Add direction field to QoS bandwidth limit.
This patch enables the direction ('ingress'/'egress') field
on the QoS bandwidth limit rule object and CRUD commands.

Closes-Bug: #1614121
Depends-On: Ia13568879c2b6f80fb190ccafe7e19ca05b0c6a8
Depends-On: I90c412a5c8757b3ffe8abfc1165a70bdb8744702
Change-Id: Ic6981474f22efbf294ac11c2e0304b04494a1bbe
2017-06-22 15:59:37 +00:00
Reedip
eb793dc8c6 Add default-quota to subnet pool commands
Add --default-quota option to subnet pool create and set commands.

Setting default-quota back to None may break the current Neutron
behavior, therefore support for Unset command is not provided in
this patch.

Neutron API:
a0e0e8b668/neutron/api/v2/attributes.py (L239)

Closes-Bug: #1667294
Change-Id: Ia4e7c23a49e91a090133c729353cdb8e62bc5674
2017-06-12 02:52:28 +00:00
Vu Cong Tuan
b52bbe1eec Trivial fix typos
Change-Id: I72a1da209df38e226ec02d9dbd0142ed4020c0d2
2017-05-30 16:38:27 +07:00
Dean Troyer
6f31634f17 Rework floating ip functional tests
Regualr expresstions were an interesting diversion, get rid of them
from the functional tests.  It did lead to better structure...

Change-Id: I1ff32ad7715ebd88401925ce3f6c412a66e82566
2017-05-10 09:48:38 -05:00
Dean Troyer
190711ecd7 Nova net functional tests round 3
* network segment
* network service
* port
* router
* security group
* security group rule
* subnet
* subnet pool
* extension
  The extension tests were duplicated to have both compute and network
  extensions tests so the nova-net case will still exercise the extension
  commands.

Also clean up formatting from previous reviews to make the Network functional
tests look and act consistently.

Change-Id: I286c40572faa31ddcef595cec740da933b2defc1
2017-04-28 14:40:45 -05:00
Jenkins
efcf3b22ad Merge "Fix Nova-net netowrk commands" 2017-04-28 19:18:03 +00:00
Dean Troyer
dd7da49325 Nova net functional tests round 2
* floating ip
* ip availability
* network qos policy
* network qos rule
* network qos rule type
* network rbac

Change-Id: Id3946bdff43bfef3a1d879c058bde4792bd299c6
2017-04-28 09:46:51 -05:00
Dean Troyer
e0d1af94a1 Nova net functional tests round 1
* address scope
* network agent
* network flavor
* network flavor profile
* network meter
* network meter rule

Also create a new common network functional test class
NetworkTests to house the setting of haz_network in a single place.
The individual test skipping stays in the final classes to re-enforce
the idea that some tests work with both Nova-net and Neutron.

Change-Id: Ie3910231c6fc9e2031438c599afa904f43c874a7
2017-04-28 06:39:21 -05:00
Dean Troyer
589a65c3fe Fix Nova-net netowrk commands
In cleaning up functional tests for nova-net, I discovered some
problems in network create:
* --subnet option is required in network create command
* Switch API to use /os-networks rather than /os-tenant-networks as this
  is what we were actually using via novaclient
* Fix functional tests for nova-net
* Normalize some private function names in network/v2/network.py

Change-Id: I426b864406756d58d140575a3a45ee9aee67ce84
2017-04-27 20:36:00 +00:00
jiahui.qiang
d519911c43 Functional test for subnet_pool
Refactor functional tests for testing more command options.

Change-Id: I0c9c3b04dd2b79766a8fe82cbc5315c030f4784d
2017-04-26 12:51:58 -05:00
Huanxuan Ao
db6081fb80 Fix network list functional test
An error in network func test broke our CI,
looks like the "is_default" should be "False"
by default for now.

Change-Id: I021eb8abd9bdf55c7c06031152c107312f104b34
2017-04-19 21:47:57 +08:00
Sindhu Devale
763c8c5670 "floating ip set/unset port" for OSC
Implements Neutron feature of floating ip associate/disassociate
into OpenStack Client.

Previously, network.find_ip() function only supported to
search floating ip by UUID. Hence, _find_floating_ip()
function is used in floating_ip.py, to search fip both by UUID
and ip_address. [1] adds the ability to find fip object using both UUID
and ip_address. This functionality however, won't be available until
the SDK is released. Hence, we continue to use _find_floating_ip()
method, which was cleaned up by [2] to remove the use of ip_cache.
Once, the SDK is released, we will remove all the usage of
_find_floating_ip() method and instead only use network.find_ip().

[1] https://review.openstack.org/#/c/449879/2
[2] https://review.openstack.org/#/c/447938/

Change-Id: I6c5222287c46ca42365917d2deae70bdb626347
Co-Authored-By: Reedip<reedip.banerjee@nectechnologies.in>
Co-Authored-By: RuiChen<chenrui.momo@gmail.com>
Closes-Bug: #1560297
2017-04-05 16:12:40 +00:00
Shashank Kumar Shankar
b51310a4bb Introduce neutron flavor associate, disassociate to OSC
This patch introduces network flavor associate and disassociate to
OSC. The following neutron equivalent commands are implemented in OSC:

    - neutron flavor-associate
    - neutron flavor-disassociate

Change-Id: Icba4dbf7300a36353142586359059cd6784049dc
2017-04-03 17:02:03 +00:00
Jenkins
dd81ca0692 Merge "Simplify logic around option lists in port set" 2017-03-27 17:33:23 +00:00
Jenkins
efc570dae2 Merge "OSC Network Flavor Profile" 2017-03-21 03:32:47 +00:00
Jenkins
fe3bbf63a8 Merge "Jsonify meter and meter rule functional tests" 2017-03-21 01:50:17 +00:00
Dean Troyer
82a86d2d58 Simplify logic around option lists in port set
Use a common pattern to handle option pairs --XYZ and --no-XYZ for managing
lists of attributes. This pattern looks at the presence of the option
in parsed_args first and branches as necessary.

Some specific steps are included for the SDK Network resources to reliably
set the 'dirty' flag for changed attributes via one or both of the following:
* iterate over lists of original resource attributes to force the creation
  of a new list object
* use [].extend() rather than += to add to the existing list (substitute
  {}.update() for dicts)

Change-Id: I0c3f9a52ffe1ae2b5b230cb13d6376dd9131aaf9
2017-03-20 16:55:48 -05:00
Jenkins
3e621c9a9c Merge "Introduce Neutron DHCP agent commands to OSC" 2017-03-20 21:31:53 +00:00
Jenkins
f16513aaf2 Merge "Make MAC address of port updatable" 2017-03-20 20:53:22 +00:00
Shashank Kumar Shankar
f4fd8f6e31 Introduce Neutron DHCP agent commands to OSC
This patch introduces neutron dhcp-agent related commands to OpenStack
client.

The equivalent neutron commands implemented in OSC:

neutron: dhcp-agent-list-hosting-net
OSC: network agent list --network

neutron: dhcp-agent-network-add
OSC: network agent add network

neutron: dhcp-agent-network-remove
OSC: network agent remove network

neutron: net-list-on-dhcp-agent
OSC: network list --agent

Change-Id: I77a933f4b3ce875c63cef5b6a32aee78fd844b03
2017-03-20 15:02:09 -04:00