Merge "[Fullstack] Consolidate segmentation_id update tests into single test" into stable/2023.1

This commit is contained in:
Zuul 2024-01-31 13:40:48 +00:00 committed by Gerrit Code Review
commit 4eb13b54cb
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)