@@ -74,33 +74,32 @@ class TestSegmentationId(BaseSegmentationIdTest):
74
74
]
75
75
num_hosts = 1
76
76
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 ):
83
78
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 )
84
82
85
83
self .safe_client .create_subnet (
86
84
self .project_id , network ['id' ], '20.0.0.0/24' )
87
85
86
+ # Create some unbound and binding_failed ports
88
87
# Unbound port
89
88
self .safe_client .create_port (self .project_id , network ['id' ])
90
89
# Port failed to bind
91
90
self .safe_client .create_port (self .project_id , network ['id' ],
92
91
"non-existing-host" )
93
92
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 )
98
96
99
- self .safe_client .create_subnet (
100
- self .project_id , network ['id' ], '20.0.0.0/24' )
97
+ # Create bound port
101
98
self .safe_client .create_port (self .project_id , network ['id' ],
102
99
self .environment .hosts [0 ].hostname )
103
100
101
+ # Test update segmentation_id to some othe value when bound ports are
102
+ # created in the network
104
103
self ._update_segmentation_id (network )
105
104
106
105
0 commit comments