Merge "[Fullstack] Consolidate segmentation_id update tests into single test" into stable/2023.1
This commit is contained in:
commit
4eb13b54cb
|
@ -74,33 +74,32 @@ class TestSegmentationId(BaseSegmentationIdTest):
|
||||||
]
|
]
|
||||||
num_hosts = 1
|
num_hosts = 1
|
||||||
|
|
||||||
def test_change_segmentation_id_no_ports_in_network(self):
|
def test_change_segmentation_id(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):
|
|
||||||
network = self._create_network()
|
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.safe_client.create_subnet(
|
||||||
self.project_id, network['id'], '20.0.0.0/24')
|
self.project_id, network['id'], '20.0.0.0/24')
|
||||||
|
|
||||||
|
# Create some unbound and binding_failed ports
|
||||||
# Unbound port
|
# Unbound port
|
||||||
self.safe_client.create_port(self.project_id, network['id'])
|
self.safe_client.create_port(self.project_id, network['id'])
|
||||||
# Port failed to bind
|
# Port failed to bind
|
||||||
self.safe_client.create_port(self.project_id, network['id'],
|
self.safe_client.create_port(self.project_id, network['id'],
|
||||||
"non-existing-host")
|
"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):
|
# Create bound port
|
||||||
network = self._create_network()
|
|
||||||
|
|
||||||
self.safe_client.create_subnet(
|
|
||||||
self.project_id, network['id'], '20.0.0.0/24')
|
|
||||||
self.safe_client.create_port(self.project_id, network['id'],
|
self.safe_client.create_port(self.project_id, network['id'],
|
||||||
self.environment.hosts[0].hostname)
|
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)
|
self._update_segmentation_id(network)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue