The root account in the Fedora image used for the tests has a properly specified path, so the extra verbiage just clutters up the screen. --- scripts/nwfilter/210-no-mac-spoofing.t | 20 ++++++++++---------- scripts/nwfilter/220-no-ip-spoofing.t | 26 +++++++++++++------------- scripts/nwfilter/230-no-mac-broadcast.t | 2 +- scripts/nwfilter/240-no-arp-spoofing.t | 6 +++--- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/scripts/nwfilter/210-no-mac-spoofing.t b/scripts/nwfilter/210-no-mac-spoofing.t index b4a4990..3438f4a 100644 --- a/scripts/nwfilter/210-no-mac-spoofing.t +++ b/scripts/nwfilter/210-no-mac-spoofing.t @@ -98,16 +98,16 @@ my $ssh = Net::OpenSSH->new($guestip, diag "fiddling with mac"; my $cmdfile = <<EOF; echo "DEV=`ip link | head -3 | tail -1 | awk '{print \\\$2}' | sed -e 's/://'` -/sbin/ip addr show dev \\\$DEV -/sbin/ip link set \\\$DEV down -/sbin/ip link set \\\$DEV address ${macfalse} -/sbin/ip link set \\\$DEV up -/sbin/ip addr show dev \\\$DEV -/bin/ping -c 10 ${gateway} 2>&1 -/sbin/ip link set \\\$DEV down -/sbin/ip link set \\\$DEV address ${mac} -/sbin/ip link set \\\$DEV up -/sbin/ip addr show dev \\\$DEV" > /test.sh +ip addr show dev \\\$DEV +ip link set \\\$DEV down +ip link set \\\$DEV address ${macfalse} +ip link set \\\$DEV up +ip addr show dev \\\$DEV +ping -c 10 ${gateway} 2>&1 +ip link set \\\$DEV down +ip link set \\\$DEV address ${mac} +ip link set \\\$DEV up +ip addr show dev \\\$DEV" > /test.sh EOF diag $cmdfile; my ($stdout, $stderr) = $ssh->capture2($cmdfile); diff --git a/scripts/nwfilter/220-no-ip-spoofing.t b/scripts/nwfilter/220-no-ip-spoofing.t index f3e4a38..9e1bb70 100644 --- a/scripts/nwfilter/220-no-ip-spoofing.t +++ b/scripts/nwfilter/220-no-ip-spoofing.t @@ -82,20 +82,20 @@ diag "preparing ip spoof"; my $cmdfile = <<EOF; echo "DEV=\\\$(ip link | head -3 | tail -1 | awk '{print \\\$2}' | sed -e 's/://') MASK=\\\$(ip addr show \\\$DEV | grep 'inet ' | awk '{print \\\$2}' | sed -e 's/.*\\///;q') -/sbin/ip addr show \\\$DEV +ip addr show \\\$DEV kill \\\$(pidof dhclient) -/sbin/ip link set \\\$DEV down -/sbin/ip addr flush dev \\\$DEV -/sbin/ip addr add 192.168.122.183/\\\$MASK dev \\\$DEV -/sbin/ip link set \\\$DEV up -/sbin/ip addr show \\\$DEV -/bin/sleep 1 -/bin/ping -c 1 192.168.122.1 -/sbin/ip link set \\\$DEV down -/sbin/ip addr flush dev \\\$DEV -/sbin/ip addr add ${guestip}/\\\$MASK dev \\\$DEV -/sbin/ip link set \\\$DEV up -/sbin/ip addr show \\\$DEV" > /test.sh +ip link set \\\$DEV down +ip addr flush dev \\\$DEV +ip addr add 192.168.122.183/\\\$MASK dev \\\$DEV +ip link set \\\$DEV up +ip addr show \\\$DEV +sleep 1 +ping -c 1 192.168.122.1 +ip link set \\\$DEV down +ip addr flush dev \\\$DEV +ip addr add ${guestip}/\\\$MASK dev \\\$DEV +ip link set \\\$DEV up +ip addr show \\\$DEV" > /test.sh EOF diag $cmdfile; my ($stdout, $stderr) = $ssh->capture2($cmdfile); diff --git a/scripts/nwfilter/230-no-mac-broadcast.t b/scripts/nwfilter/230-no-mac-broadcast.t index f05a9c2..758005c 100644 --- a/scripts/nwfilter/230-no-mac-broadcast.t +++ b/scripts/nwfilter/230-no-mac-broadcast.t @@ -91,7 +91,7 @@ my $ssh = Net::OpenSSH->new($guestip, # now generate a mac broadcast paket diag "generate mac broadcast"; my $cmdfile = <<EOF; -echo '/bin/ping -c 1 192.168.122.255 -b' > /test.sh +echo 'ping -c 1 192.168.122.255 -b' > /test.sh EOF diag $cmdfile; my ($stdout, $stderr) = $ssh->capture2($cmdfile); diff --git a/scripts/nwfilter/240-no-arp-spoofing.t b/scripts/nwfilter/240-no-arp-spoofing.t index 33febe9..dfc8e08 100644 --- a/scripts/nwfilter/240-no-arp-spoofing.t +++ b/scripts/nwfilter/240-no-arp-spoofing.t @@ -94,9 +94,9 @@ my $ssh = Net::OpenSSH->new($guestip, # now generate a arp spoofing packets diag "generate arpspoof script"; my $cmdfile = <<EOF; -echo "/usr/sbin/arpspoof ${spoofid} & -/bin/sleep 10 -kill -15 `/sbin/pidof arpspoof`" > /test.sh +echo "arpspoof ${spoofid} & +sleep 10 +kill -15 \\\$(pidof arpspoof)" > /test.sh EOF diag "content of cmdfile:"; -- 2.13.6 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list