[AIM] Fix most common random UT failures

Fix TestGbpDetailsForML2 UTs to avoid both allocating and specifying
fixed_ips for ports on the same subnet, which sometimes collided.

Fix test_preexisting_external_network UT to cascade-delete the
ExternalNetwork's ExternalSubnet, which sometime prevented the
ExternalNetwork from actually being deleted.

Change-Id: I7226129135a59d35fa8d76d132163b2241334fed
This commit is contained in:
Robert Kukura 2020-03-23 17:32:47 -04:00
parent 18344dd4be
commit 9c876051e8
2 changed files with 5 additions and 4 deletions

View File

@ -2776,7 +2776,7 @@ class TestGbpDetailsForML2(AIMBaseTestCase,
self.fmt, network, gw2_ip, cidr='10.0.2.0/24',
subnetpool_id=pool_id)['subnet']
# Make a DHCP port on each subnet
dhcp_subnet1 = [{'subnet_id': subnet1['id']}]
dhcp_subnet1 = [{'subnet_id': subnet1['id'], 'ip_address': '10.0.1.5'}]
dhcp_p1 = self._make_port(self.fmt, net1['id'],
device_owner='dhcp:',
fixed_ips=dhcp_subnet1)['port']

View File

@ -611,11 +611,12 @@ class TestNeutronMapping(AimValidationTestCase):
self.aim_mgr.delete(self.aim_ctx, l3out)
self._validate_repair_validate()
# Delete pre-existing AIM ExternalNetwork and test.
self.aim_mgr.delete(self.aim_ctx, ext_net)
# Delete pre-existing AIM ExternalNetwork, along with its
# child ExternalSubnet, and test.
self.aim_mgr.delete(self.aim_ctx, ext_net, cascade=True)
self._validate_repair_validate()
# Delete pre-existing AIM ExternalSubnet and test.
# Delete just the pre-existing AIM ExternalSubnet and test.
self.aim_mgr.delete(self.aim_ctx, ext_sn)
self._validate_repair_validate()