[tck PATCH 4/4] nwfilter: allow for ebtables *not* removing leading 0 from mac addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The ebtables command in RHEL8 prints 00 in a MAC address as.... "00",
unlike e.g. Fedora 29, which prints it as "0". Allow for both.

Signed-off-by: Laine Stump <laine@xxxxxxxxx>
---
 scripts/nwfilter/100-ping-still-working.t | 4 ++--
 scripts/nwfilter/210-no-mac-spoofing.t    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/nwfilter/100-ping-still-working.t b/scripts/nwfilter/100-ping-still-working.t
index a88eb02..656722d 100644
--- a/scripts/nwfilter/100-ping-still-working.t
+++ b/scripts/nwfilter/100-ping-still-working.t
@@ -76,9 +76,9 @@ diag "ip is $guestip";
 my $ebtables = (-e '/sbin/ebtables') ? '/sbin/ebtables' : '/usr/sbin/ebtables';
 my $ebtable = `$ebtables -L;$ebtables -t nat -L`;
 diag $ebtable;
-# ebtables shortens :00: to :0: so we need to do that too
+# ebtables *might* shorten :00: to :0: so we need to allow for both when searching
 $_ = $mac;
-s/00/0/g;
+s/0([0-9])/0{0,1}$1/g;
 ok($ebtable =~ $_, "check ebtables entry");
 
 # ping guest1
diff --git a/scripts/nwfilter/210-no-mac-spoofing.t b/scripts/nwfilter/210-no-mac-spoofing.t
index 78c500c..95f003a 100644
--- a/scripts/nwfilter/210-no-mac-spoofing.t
+++ b/scripts/nwfilter/210-no-mac-spoofing.t
@@ -81,9 +81,9 @@ diag "guest ip is $guestip";
 my $ebtables = (-e '/sbin/ebtables') ? '/sbin/ebtables' : '/usr/sbin/ebtables';
 my $ebtable = `$ebtables -L;$ebtables -t nat -L`;
 diag $ebtable;
-# ebtables shortens :00: to :0: so we need to do that too
+# ebtables *might* shorten :00: to :0: so we need to allow for both when searching
 $_ = $mac;
-s/00/0/g; 
+s/0([0-9])/0{0,1}$1/g;
 ok($ebtable =~ $_, "check ebtables entry");
 
 my $macfalse = "52:54:00:f9:21:22";
-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux