Skip to content

Commit 311c939

Browse files
committed
Merge branch 'master' into vlan
2 parents b389527 + 146875c commit 311c939

File tree

4 files changed

+35
-7
lines changed

4 files changed

+35
-7
lines changed

clib/mininet_test_base.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,10 @@ def change_port_config(self, port, config_name, config_value,
15451545
if config_name is None:
15461546
del conf['dps'][self.DP_NAME]['interfaces'][port]
15471547
else:
1548-
conf['dps'][self.DP_NAME]['interfaces'][port][config_name] = config_value
1548+
if config_value is None:
1549+
del conf['dps'][self.DP_NAME]['interfaces'][port][config_name]
1550+
else:
1551+
conf['dps'][self.DP_NAME]['interfaces'][port][config_name] = config_value
15491552
self.reload_conf(
15501553
conf, self.faucet_config_path,
15511554
restart, cold_start, hup=hup)
@@ -1877,12 +1880,13 @@ def verify_ping_mirrored(self, first_host, second_host, mirror_host, both_mirror
18771880
self.assertGreaterEqual(received_pings, expected_pings)
18781881
self.assertLessEqual(received_pings, max_expected_pings)
18791882

1880-
def verify_bcast_ping_mirrored(self, first_host, second_host, mirror_host, tagged=False):
1883+
def verify_bcast_ping_mirrored(self, first_host, second_host, mirror_host, tagged=False, require_learned=True):
18811884
"""Verify that broadcast to a mirrored port, is mirrored."""
1882-
self.ping((first_host, second_host))
1883-
for host in (first_host, second_host):
1884-
self.require_host_learned(host)
1885-
self.retry_net_ping(hosts=(first_host, second_host))
1885+
if require_learned:
1886+
self.ping((first_host, second_host))
1887+
for host in (first_host, second_host):
1888+
self.require_host_learned(host)
1889+
self.retry_net_ping(hosts=(first_host, second_host))
18861890
tcpdump_filter = (
18871891
'ether src %s and ether dst ff:ff:ff:ff:ff:ff and '
18881892
'icmp[icmptype] == 8') % second_host.MAC()

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
-r ../requirements.txt
2-
sphinx==3.0.2
2+
sphinx==3.0.3
33
sphinx_rtd_theme==0.4.3
44
sphinxcontrib-svg2pdfconverter

faucet/dp.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,6 +1539,16 @@ def _add_changed_vlan_port(port, port_dp):
15391539
changed_acl_ports.add(port_no)
15401540
logger.info('port %s ACL changed (ACL %s to %s)' % (
15411541
port_no, old_acl_ids, new_acl_ids))
1542+
# If any of the changed VLANs have tagged ports we will need to restore their flows,
1543+
# even if those tagged ports didn't change, as the delete VLAN operation uses
1544+
# a wildcard delete.
1545+
for port_no in same_ports:
1546+
old_port = self.ports[port_no]
1547+
new_port = new_dp.ports[port_no]
1548+
for tagged_vlan in new_port.tagged_vlans:
1549+
if tagged_vlan.vid in changed_vlans:
1550+
logger.info('port %s has a changed tagged VLAN' % port_no)
1551+
changed_ports.add(port_no)
15421552

15431553
if changed_acl_ports:
15441554
same_ports -= changed_acl_ports

tests/integration/mininet_tests.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5513,6 +5513,20 @@ def test_tagged(self):
55135513
(second_host, self.port_map['port_2'])),
55145514
MIN_MBPS, first_host_ip, second_host_ip,
55155515
sync_counters_func=lambda: self.one_ipv4_ping(first_host, second_host_ip))
5516+
tagged_ports = (self.port_map['port_1'], self.port_map['port_2'], self.port_map['port_4'])
5517+
for port in tagged_ports:
5518+
self.wait_until_matching_flow(
5519+
{'vlan_vid': 100, 'in_port': port},
5520+
table_id=self._VLAN_TABLE,
5521+
actions=['GOTO_TABLE:%u' % self._ETH_SRC_TABLE])
5522+
self.change_port_config(
5523+
self.port_map['port_3'], 'mirror', None,
5524+
restart=True, cold_start=False)
5525+
for port in tagged_ports:
5526+
self.wait_until_matching_flow(
5527+
{'vlan_vid': 100, 'in_port': port},
5528+
table_id=self._VLAN_TABLE,
5529+
actions=['GOTO_TABLE:%u' % self._ETH_SRC_TABLE])
55165530

55175531

55185532
class FaucetTaggedVLANPCPTest(FaucetTaggedTest):

0 commit comments

Comments
 (0)