Skip to content

Commit a450c22

Browse files
authored
Merge pull request #3542 from anarkiwi/vlan
deflake 8021XVLANTest
2 parents 146875c + 311c939 commit a450c22

File tree

1 file changed

+24
-35
lines changed

1 file changed

+24
-35
lines changed

tests/integration/mininet_tests.py

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,62 +1274,51 @@ def test_untagged(self):
12741274
self.one_ipv4_ping(
12751275
self.eapol1_host, self.eapol2_host.IP(),
12761276
require_host_learned=False, expected_result=True)
1277-
self.wait_until_no_matching_flow(
1278-
{'eth_src': self.eapol1_host.MAC(),
1279-
'vlan_vid': vid},
1277+
1278+
self.wait_until_matching_flow(
1279+
{'eth_src': self.eapol1_host.MAC(), 'vlan_vid': radius_vid2},
1280+
table_id=self._ETH_SRC_TABLE)
1281+
self.wait_until_matching_flow(
1282+
{'eth_src': self.eapol1_host.MAC(), 'vlan_vid': radius_vid2},
12801283
table_id=self._ETH_SRC_TABLE)
12811284
self.wait_until_no_matching_flow(
1282-
{'eth_src': self.eapol1_host.MAC(),
1283-
'vlan_vid': radius_vid1},
1285+
{'eth_src': self.eapol1_host.MAC(), 'vlan_vid': vid},
12841286
table_id=self._ETH_SRC_TABLE)
1285-
self.wait_until_matching_flow(
1286-
{'eth_src': self.eapol1_host.MAC(),
1287-
'vlan_vid': radius_vid2},
1287+
self.wait_until_no_matching_flow(
1288+
{'eth_src': self.eapol1_host.MAC(), 'vlan_vid': radius_vid1},
12881289
table_id=self._ETH_SRC_TABLE)
12891290
self.wait_until_no_matching_flow(
1290-
{'eth_dst': self.eapol1_host.MAC(),
1291-
'vlan_vid': vid},
1291+
{'eth_dst': self.eapol1_host.MAC(), 'vlan_vid': vid},
12921292
table_id=self._ETH_DST_TABLE)
12931293
self.wait_until_no_matching_flow(
1294-
{'eth_dst': self.eapol1_host.MAC(),
1295-
'vlan_vid': radius_vid1},
1296-
table_id=self._ETH_DST_TABLE)
1297-
self.wait_until_matching_flow(
1298-
{'eth_dst': self.eapol1_host.MAC(),
1299-
'vlan_vid': radius_vid2},
1294+
{'eth_dst': self.eapol1_host.MAC(), 'vlan_vid': radius_vid1},
13001295
table_id=self._ETH_DST_TABLE)
13011296

13021297
# test port up/down. removes the dynamic vlan & host cache.
13031298
self.flap_port(port_no2)
13041299

1305-
self.wait_until_no_matching_flow(
1306-
{'eth_src': self.eapol2_host.MAC()},
1307-
table_id=self._ETH_SRC_TABLE)
1308-
self.wait_until_no_matching_flow(
1309-
{'eth_dst': self.eapol2_host.MAC(),
1310-
'vlan_vid': radius_vid1},
1311-
table_id=self._ETH_DST_TABLE,
1312-
actions=['POP_VLAN', 'OUTPUT:%s' % port_no2])
1313-
1314-
# check ports are back in the right vlans.
1315-
self.wait_until_no_matching_flow(
1300+
self.wait_until_matching_flow(
13161301
{'in_port': port_no2},
13171302
table_id=self._VLAN_TABLE,
1318-
actions=['SET_FIELD: {vlan_vid:%u}' % radius_vid2])
1303+
actions=['SET_FIELD: {vlan_vid:%u}' % vid])
13191304
self.wait_until_matching_flow(
1305+
{'vlan_vid': vid},
1306+
table_id=self._FLOOD_TABLE,
1307+
actions=['POP_VLAN', 'OUTPUT:%s' % port_no2])
1308+
self.wait_until_no_matching_flow(
13201309
{'in_port': port_no2},
13211310
table_id=self._VLAN_TABLE,
1322-
actions=['SET_FIELD: {vlan_vid:%u}' % vid])
1323-
1324-
# check flood ports are in the right vlans
1311+
actions=['SET_FIELD: {vlan_vid:%u}' % radius_vid2])
13251312
self.wait_until_no_matching_flow(
13261313
{'vlan_vid': radius_vid2},
13271314
table_id=self._FLOOD_TABLE,
13281315
actions=['POP_VLAN', 'OUTPUT:%s' % port_no1, 'OUTPUT:%s' % port_no2])
1329-
1330-
self.wait_until_matching_flow(
1331-
{'vlan_vid': vid},
1332-
table_id=self._FLOOD_TABLE,
1316+
self.wait_until_no_matching_flow(
1317+
{'eth_src': self.eapol2_host.MAC()},
1318+
table_id=self._ETH_SRC_TABLE)
1319+
self.wait_until_no_matching_flow(
1320+
{'eth_dst': self.eapol2_host.MAC(), 'vlan_vid': radius_vid1},
1321+
table_id=self._ETH_DST_TABLE,
13331322
actions=['POP_VLAN', 'OUTPUT:%s' % port_no2])
13341323

13351324
self.post_test_checks()

0 commit comments

Comments
 (0)