Remove "active" attribute from the allowed_address_pairs

Attribute "active" is going to be added to the allowed_address_pairs
in the patch [1] and will not be available in older branches.
To make our existing allowed_address_pairs API tests to be passing in
both cases, with and without that "active" attribute, this patch
removes that field from the allowed_address_pairs which are returned
by the Neutron server.

We could make expected results of those tests to be dependend on the
available Neutron's API extensions but in that case existing tests may
fail randomly as all tests are always using same IP addresses thus
allowed_address_pair may be active=True or active=False.

To properly check active/inactive allowed address pairs there will be
additional tests added to the neutron-tempest-plugin in the follow up
patch.

[1] https://review.opendev.org/c/openstack/neutron/+/601336

Related-Bug: #1928466
Change-Id: I368ca13291055f43896beb905cf19ff933fa797c
This commit is contained in:
Slawek Kaplonski 2021-06-04 13:55:31 +02:00
parent 661cc06f5e
commit 1536b57c8f
1 changed files with 2 additions and 0 deletions

View File

@ -81,6 +81,8 @@ class AllowedAddressPairTestJSON(base.BaseNetworkTest):
body = self.client.update_port(
port_id, allowed_address_pairs=allowed_address_pairs)
allowed_address_pair = body['port']['allowed_address_pairs']
for pair in allowed_address_pair:
pair.pop('active', None)
self.assertCountEqual(allowed_address_pair, allowed_address_pairs)
@decorators.idempotent_id('9599b337-272c-47fd-b3cf-509414414ac4')