[Fullstack] Consolidate segmentation_id update tests into single test

There were 3 tests which were testing update of the segmentation_id for
the network with:
* no ports
* unbound or binding failed ports,
* bound ports.

Due to the nature of the fullstack tests, each of tests required to
spawn neutron server, neutron ovs agent, etc.
Now all of those tests are consolidated into one test end execution time
of test cases from that class went down from about 125 seconds to around
45 seconds.

Change-Id: I4c0444700bff734cf1947f0e0a3e44ea0e11a155
(cherry picked from commit 8935b7a133)
This commit is contained in:
Slawek Kaplonski 2023-12-06 11:46:41 +01:00 committed by Rodolfo Alonso Hernandez
parent e5c743b820
commit f8628b5c04
1 changed files with 11 additions and 12 deletions

View File

@ -74,33 +74,32 @@ class TestSegmentationId(BaseSegmentationIdTest):
]
num_hosts = 1
def test_change_segmentation_id_no_ports_in_network(self):
network = self._create_network()
# Now change segmentation_id to some other value
self._update_segmentation_id(network)
def test_change_segmentation_id_with_unbound_ports_in_network(self):
def test_change_segmentation_id(self):
network = self._create_network()
# Now change segmentation_id to some other value when there are no
# ports created in network
network = self._update_segmentation_id(network)
self.safe_client.create_subnet(
self.project_id, network['id'], '20.0.0.0/24')
# Create some unbound and binding_failed ports
# Unbound port
self.safe_client.create_port(self.project_id, network['id'])
# Port failed to bind
self.safe_client.create_port(self.project_id, network['id'],
"non-existing-host")
self._update_segmentation_id(network)
# Test update segmentation_id to some othe value with unbound and
# binding_failed ports created in the network
network = self._update_segmentation_id(network)
def test_change_segmentation_id_with_bound_ports_in_network(self):
network = self._create_network()
self.safe_client.create_subnet(
self.project_id, network['id'], '20.0.0.0/24')
# Create bound port
self.safe_client.create_port(self.project_id, network['id'],
self.environment.hosts[0].hostname)
# Test update segmentation_id to some othe value when bound ports are
# created in the network
self._update_segmentation_id(network)