[libvirt] [PATCH tck] Find ebtables in /sbin or /usr/sbin

If ebtables binary is not found in /sbin, use /usr/sbin. --- scripts/nwfilter/100-ping-still-working.t | 3 ++- scripts/nwfilter/210-no-mac-spoofing.t | 3 ++- scripts/nwfilter/220-no-ip-spoofing.t | 3 ++- scripts/nwfilter/230-no-mac-broadcast.t | 3 ++- scripts/nwfilter/240-no-arp-spoofing.t | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/nwfilter/100-ping-still-working.t b/scripts/nwfilter/100-ping-still-working.t index 0bfdc00..1105d70 100644 --- a/scripts/nwfilter/100-ping-still-working.t +++ b/scripts/nwfilter/100-ping-still-working.t @@ -64,7 +64,8 @@ my $guestip = get_ip_from_leases($mac); diag "ip is $guestip"; # check ebtables entry -my $ebtable = `/sbin/ebtables -L;/sbin/ebtables -t nat -L`; +my $ebtables = (-e '/sbin/ebtables') ? '/sbin/ebtables' : '/usr/sbin/ebtables'; +my $ebtable = `$ebtables -L;$ebtables -t nat -L`; diag $ebtable; # fixme to include mac adress ok($ebtable =~ "vnet0", "check ebtables entry"); diff --git a/scripts/nwfilter/210-no-mac-spoofing.t b/scripts/nwfilter/210-no-mac-spoofing.t index fb20351..d7c57e6 100644 --- a/scripts/nwfilter/210-no-mac-spoofing.t +++ b/scripts/nwfilter/210-no-mac-spoofing.t @@ -64,7 +64,8 @@ my $guestip = get_ip_from_leases($mac); diag "ip is $guestip"; # check ebtables entry -my $ebtable = `/sbin/ebtables -L;/sbin/ebtables -t nat -L`; +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 $_ = $mac; diff --git a/scripts/nwfilter/220-no-ip-spoofing.t b/scripts/nwfilter/220-no-ip-spoofing.t index 063bb5b..5e8e0d7 100644 --- a/scripts/nwfilter/220-no-ip-spoofing.t +++ b/scripts/nwfilter/220-no-ip-spoofing.t @@ -64,7 +64,8 @@ my $guestip = get_ip_from_leases($mac); diag "ip is $guestip"; # check ebtables entry -my $ebtable = `/sbin/ebtables -L;/sbin/ebtables -t nat -L`; +my $ebtables = (-e '/sbin/ebtables') ? '/sbin/ebtables' : '/usr/sbin/ebtables'; +my $ebtable = `$ebtables -L;$ebtables -t nat -L`; diag $ebtable; # check if IP address is listed ok($ebtable =~ "$guestip", "check ebtables entry"); diff --git a/scripts/nwfilter/230-no-mac-broadcast.t b/scripts/nwfilter/230-no-mac-broadcast.t index 09a758b..a7d3b8e 100644 --- a/scripts/nwfilter/230-no-mac-broadcast.t +++ b/scripts/nwfilter/230-no-mac-broadcast.t @@ -63,7 +63,8 @@ my $guestip = get_ip_from_leases($mac); diag "ip is $guestip"; # check ebtables entry -my $ebtable = `/sbin/ebtables -L;/sbin/ebtables -t nat -L`; +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 $_ = $mac; diff --git a/scripts/nwfilter/240-no-arp-spoofing.t b/scripts/nwfilter/240-no-arp-spoofing.t index c31ea48..596a0ce 100644 --- a/scripts/nwfilter/240-no-arp-spoofing.t +++ b/scripts/nwfilter/240-no-arp-spoofing.t @@ -65,7 +65,8 @@ my $guestip = get_ip_from_leases($mac); diag "ip is $guestip"; # check ebtables entry -my $ebtable = `/sbin/ebtables -L;/sbin/ebtables -t nat -L`; +my $ebtables = (-e '/sbin/ebtables') ? '/sbin/ebtables' : '/usr/sbin/ebtables'; +my $ebtable = `$ebtables -L;$ebtables -t nat -L`; diag $ebtable; # check if IP address is listed ok($ebtable =~ "$guestip", "check ebtables entry"); -- 1.8.4.5

On Friday, March 28, 2014 11:09:02 AM Mike Latimer wrote:
If ebtables binary is not found in /sbin, use /usr/sbin.
--- scripts/nwfilter/100-ping-still-working.t | 3 ++- scripts/nwfilter/210-no-mac-spoofing.t | 3 ++- scripts/nwfilter/220-no-ip-spoofing.t | 3 ++- scripts/nwfilter/230-no-mac-broadcast.t | 3 ++- scripts/nwfilter/240-no-arp-spoofing.t | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-)
I just realized this patch (and the subsequent 100-ping-still-working patch) were based on the yet-to-be-pushed patches Daniel posted on Friday (series entitled 'Fix testes which need a full OS image'). Let me know if this is a problem for either of these patches. -Mike

On Fri, Mar 28, 2014 at 11:09:02AM -0600, Mike Latimer wrote:
If ebtables binary is not found in /sbin, use /usr/sbin.
--- scripts/nwfilter/100-ping-still-working.t | 3 ++- scripts/nwfilter/210-no-mac-spoofing.t | 3 ++- scripts/nwfilter/220-no-ip-spoofing.t | 3 ++- scripts/nwfilter/230-no-mac-broadcast.t | 3 ++- scripts/nwfilter/240-no-arp-spoofing.t | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-)
ACK & pushed. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (2)
-
Daniel P. Berrange
-
Mike Latimer