[libvirt] [tck PATCH v2 1/4] nwfilter tests: auto-add test appliance ssh key to known_hosts on host

Laine Stump laine at laine.org
Fri Mar 2 02:49:57 UTC 2018


Without this option, attempts to ssh into the test appliance will fail
unless someone has previously ssh'ed into the appliance manually and
accepted its key.

Signed-off-by: Laine Stump <laine at laine.org>
---

New in V2.

This isn't necessarily related to the $subject of the cover letter,
but it's easier to send it along with the other patches.

 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 ++-
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/scripts/nwfilter/210-no-mac-spoofing.t b/scripts/nwfilter/210-no-mac-spoofing.t
index 3438f4a..148fbeb 100644
--- a/scripts/nwfilter/210-no-mac-spoofing.t
+++ b/scripts/nwfilter/210-no-mac-spoofing.t
@@ -92,7 +92,8 @@ ok($ping =~ "10 received", "ping $guestip test");
 diag "ssh'ing into $guestip";
 my $ssh = Net::OpenSSH->new($guestip,
                             user => "root",
-                            password => $tck->root_password());
+                            password => $tck->root_password(),
+                            master_opts => [-o => "StrictHostKeyChecking=no"]);
 
 # now bring eth0 down, change MAC and bring it up again
 diag "fiddling with mac";
diff --git a/scripts/nwfilter/220-no-ip-spoofing.t b/scripts/nwfilter/220-no-ip-spoofing.t
index 9e1bb70..09bd51c 100644
--- a/scripts/nwfilter/220-no-ip-spoofing.t
+++ b/scripts/nwfilter/220-no-ip-spoofing.t
@@ -75,7 +75,8 @@ ok($ebtable =~ "$guestip", "check ebtables entry");
 diag "ssh'ing into $guestip";
 my $ssh = Net::OpenSSH->new($guestip,
                             user => "root",
-                            password => $tck->root_password());
+                            password => $tck->root_password(),
+                            master_opts => [-o => "StrictHostKeyChecking=no"]);
 
 # now bring eth0 down, change IP and bring it up again
 diag "preparing ip spoof";
diff --git a/scripts/nwfilter/230-no-mac-broadcast.t b/scripts/nwfilter/230-no-mac-broadcast.t
index 758005c..6f5318a 100644
--- a/scripts/nwfilter/230-no-mac-broadcast.t
+++ b/scripts/nwfilter/230-no-mac-broadcast.t
@@ -86,7 +86,8 @@ system("/usr/sbin/tcpdump -v -i virbr0 -n host 192.168.122.255 and ether host ff
 diag "ssh'ing into $guestip";
 my $ssh = Net::OpenSSH->new($guestip,
                             user => "root",
-                            password => $tck->root_password());
+                            password => $tck->root_password(),
+                            master_opts =>  [-o => "StrictHostKeyChecking=no"]);
 
 # now generate a mac broadcast paket 
 diag "generate mac broadcast";
diff --git a/scripts/nwfilter/240-no-arp-spoofing.t b/scripts/nwfilter/240-no-arp-spoofing.t
index dfc8e08..a8ab7a5 100644
--- a/scripts/nwfilter/240-no-arp-spoofing.t
+++ b/scripts/nwfilter/240-no-arp-spoofing.t
@@ -89,7 +89,8 @@ system("/usr/sbin/tcpdump -v -i virbr0 not ip  > /tmp/tcpdump.log &");
 diag "ssh'ing into $guestip";
 my $ssh = Net::OpenSSH->new($guestip,
                             user => "root",
-                            password => $tck->root_password());
+                            password => $tck->root_password(),
+                            master_opts => [-o => "StrictHostKeyChecking=no"]);
 
 # now generate a arp spoofing packets 
 diag "generate arpspoof script";
-- 
2.14.3




More information about the libvir-list mailing list