@@ -4479,6 +4479,8 @@ def ip(self, args):
4479
4479
vip: 128
4480
4480
flood: 384
4481
4481
interfaces:
4482
+ %s:
4483
+ mirror: %s
4482
4484
%s:
4483
4485
native_vlan: 99
4484
4486
tagged_vlans: [%s]
@@ -4489,10 +4491,12 @@ def ip(self, args):
4489
4491
tagged_vlans: [%s]
4490
4492
hairpin_unicast: True
4491
4493
description: "b2"
4492
- """ % (global_vid (), '%(port_1)d' , ',' .join (STR_VIDS ), '%(port_2)d' , ',' .join (STR_VIDS ))
4494
+ """ % (global_vid (), '%(port_3)d' , '%(port_1)d' , '%(port_1)d' ,
4495
+ ',' .join (STR_VIDS ), '%(port_2)d' , ',' .join (STR_VIDS ))
4493
4496
4494
4497
def test_tagged (self ):
4495
- hosts = self .net .hosts [:2 ]
4498
+ first_host , second_host , mirror_host = self .net .hosts [:3 ]
4499
+ hosts = (first_host , second_host )
4496
4500
required_ipds = set ()
4497
4501
for i , host in enumerate (hosts , start = 1 ):
4498
4502
setup_commands = []
@@ -4545,31 +4549,30 @@ def test_tagged(self):
4545
4549
self .assertFalse (required_ipds )
4546
4550
4547
4551
# verify routing performance
4548
- host , other_host = hosts
4549
- for host_ip , other_ip in (
4552
+ for first_host_ip , second_host_ip in (
4550
4553
(self .netbase (self .NEW_VIDS [0 ], 1 ), self .netbase (self .NEW_VIDS [0 ], 2 )),
4551
4554
(self .netbase (self .NEW_VIDS [0 ], 1 ), self .netbase (self .NEW_VIDS [- 1 ], 2 )),
4552
4555
(self .netbase (self .NEW_VIDS [- 1 ], 1 ), self .netbase (self .NEW_VIDS [0 ], 2 ))):
4553
4556
self .verify_iperf_min (
4554
- ((host , self .port_map ['port_1' ]),
4555
- (other_host , self .port_map ['port_2' ])),
4556
- 1 , host_ip .ip , other_ip .ip )
4557
+ ((first_host , self .port_map ['port_1' ]),
4558
+ (second_host , self .port_map ['port_2' ])),
4559
+ 1 , first_host_ip .ip , second_host_ip .ip )
4557
4560
4558
4561
# verify L3 reachability between hosts within each subnet
4559
4562
for vid in self .NEW_VIDS :
4560
4563
macvlan_int = 'macvlan%u' % vid
4561
- host_ip = self .netbase (vid , 1 )
4562
- other_ip = self .netbase (vid , 2 )
4563
- self .ping (host , other_ip .ip , macvlan_int )
4564
- self .ping (other_host , host_ip .ip , macvlan_int )
4564
+ first_host_ip = self .netbase (vid , 1 )
4565
+ second_host_ip = self .netbase (vid , 2 )
4566
+ self .ping (first_host , second_host_ip .ip , macvlan_int )
4567
+ self .ping (second_host , first_host_ip .ip , macvlan_int )
4565
4568
4566
4569
# verify L3 hairpin reachability
4567
4570
macvlan1_int = 'macvlan%u' % self .NEW_VIDS [0 ]
4568
4571
macvlan2_int = 'macvlan%u' % self .NEW_VIDS [1 ]
4569
4572
macvlan2_ip = self .netbase (self .NEW_VIDS [1 ], 1 )
4570
4573
macvlan1_gw = self .netbase (self .NEW_VIDS [0 ], 254 )
4571
4574
macvlan2_gw = self .netbase (self .NEW_VIDS [1 ], 254 )
4572
- netns = self .hostns (host )
4575
+ netns = self .hostns (first_host )
4573
4576
setup_cmds = []
4574
4577
setup_cmds .extend (
4575
4578
[self .ip ('link set %s netns %s' % (macvlan2_int , netns ))])
@@ -4580,8 +4583,12 @@ def test_tagged(self):
4580
4583
setup_cmds .append ('ip netns exec %s %s' % (netns , exec_cmd ))
4581
4584
setup_cmds .append (
4582
4585
self .ip ('route add %s via %s' % (macvlan2_ip , macvlan1_gw .ip )))
4583
- self .quiet_commands (host , setup_cmds )
4584
- self .ping (host , macvlan2_ip .ip , macvlan1_int )
4586
+ self .quiet_commands (first_host , setup_cmds )
4587
+ self .ping (first_host , macvlan2_ip .ip , macvlan1_int )
4588
+
4589
+ # Verify mirror.
4590
+ self .verify_ping_mirrored (first_host , second_host , mirror_host )
4591
+ self .verify_bcast_ping_mirrored (first_host , second_host , mirror_host )
4585
4592
4586
4593
4587
4594
class FaucetTaggedGlobalIPv6RouteTest (FaucetTaggedGlobalIPv4RouteTest ):
@@ -4638,6 +4645,8 @@ def ip(self, args):
4638
4645
vip: 128
4639
4646
flood: 384
4640
4647
interfaces:
4648
+ %s:
4649
+ mirror: %s
4641
4650
%s:
4642
4651
native_vlan: 99
4643
4652
tagged_vlans: [%s]
@@ -4648,7 +4657,8 @@ def ip(self, args):
4648
4657
tagged_vlans: [%s]
4649
4658
hairpin_unicast: True
4650
4659
description: "b2"
4651
- """ % (global_vid (), '%(port_1)d' , ',' .join (STR_VIDS ), '%(port_2)d' , ',' .join (STR_VIDS ))
4660
+ """ % (global_vid (), '%(port_3)d' , '%(port_1)d' , '%(port_1)d' ,
4661
+ ',' .join (STR_VIDS ), '%(port_2)d' , ',' .join (STR_VIDS ))
4652
4662
4653
4663
4654
4664
0 commit comments