Skip to content

Commit c47c600

Browse files
slawqoralonsoh
authored andcommitted
[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 8935b7a)
1 parent 5250b62 commit c47c600

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

neutron/tests/fullstack/test_segmentation_id.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,33 +74,32 @@ class TestSegmentationId(BaseSegmentationIdTest):
7474
]
7575
num_hosts = 1
7676

77-
def test_change_segmentation_id_no_ports_in_network(self):
78-
network = self._create_network()
79-
# Now change segmentation_id to some other value
80-
self._update_segmentation_id(network)
81-
82-
def test_change_segmentation_id_with_unbound_ports_in_network(self):
77+
def test_change_segmentation_id(self):
8378
network = self._create_network()
79+
# Now change segmentation_id to some other value when there are no
80+
# ports created in network
81+
network = self._update_segmentation_id(network)
8482

8583
self.safe_client.create_subnet(
8684
self.project_id, network['id'], '20.0.0.0/24')
8785

86+
# Create some unbound and binding_failed ports
8887
# Unbound port
8988
self.safe_client.create_port(self.project_id, network['id'])
9089
# Port failed to bind
9190
self.safe_client.create_port(self.project_id, network['id'],
9291
"non-existing-host")
9392

94-
self._update_segmentation_id(network)
95-
96-
def test_change_segmentation_id_with_bound_ports_in_network(self):
97-
network = self._create_network()
93+
# Test update segmentation_id to some othe value with unbound and
94+
# binding_failed ports created in the network
95+
network = self._update_segmentation_id(network)
9896

99-
self.safe_client.create_subnet(
100-
self.project_id, network['id'], '20.0.0.0/24')
97+
# Create bound port
10198
self.safe_client.create_port(self.project_id, network['id'],
10299
self.environment.hosts[0].hostname)
103100

101+
# Test update segmentation_id to some othe value when bound ports are
102+
# created in the network
104103
self._update_segmentation_id(network)
105104

106105

0 commit comments

Comments
 (0)