[libvirt] [PATCH tck 2/6] nwfilter startup and shutdown delay

Mike Latimer mlatimer at suse.com
Mon Oct 5 23:18:39 UTC 2015


When using larger test domains, additional time is required to ensure the
domain is fully started and ready for the nwfilter tests. These same domains
can also required a longer time to gracefully shutdown. This patch increases
both timeouts, and modifies 220-no-ip-spoofing.t to match the startup changes
introduced in libvirt-tck commit 83ef279c.

Signed-off-by: Mike Latimer <mlatimer at suse.com>
---
 lib/Sys/Virt/TCK/NetworkHelpers.pm        |  2 +-
 scripts/nwfilter/100-ping-still-working.t |  2 +-
 scripts/nwfilter/210-no-mac-spoofing.t    |  2 +-
 scripts/nwfilter/220-no-ip-spoofing.t     | 13 +++++++++++--
 scripts/nwfilter/230-no-mac-broadcast.t   |  2 +-
 scripts/nwfilter/240-no-arp-spoofing.t    |  2 +-
 6 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/lib/Sys/Virt/TCK/NetworkHelpers.pm b/lib/Sys/Virt/TCK/NetworkHelpers.pm
index deda0f3..7e7aab7 100644
--- a/lib/Sys/Virt/TCK/NetworkHelpers.pm
+++ b/lib/Sys/Virt/TCK/NetworkHelpers.pm
@@ -21,7 +21,7 @@ sub get_ip_from_arp{
 sub shutdown_vm_gracefully {
     my $dom = shift;
 
-    my $target = time() + 30;
+    my $target = time() + 60;
     $dom->shutdown;
     while ($dom->is_active()) {
 	sleep(1);
diff --git a/scripts/nwfilter/100-ping-still-working.t b/scripts/nwfilter/100-ping-still-working.t
index cf03d90..1433396 100644
--- a/scripts/nwfilter/100-ping-still-working.t
+++ b/scripts/nwfilter/100-ping-still-working.t
@@ -64,7 +64,7 @@ do {
 } while ($stats->{"tx_packets"} < 10 && $tries < 10);
 
 # Wait a little bit more to make sure dhcp is started in the guest
-sleep(10);
+sleep(20);
 
 my $mac = get_first_macaddress($dom);
 diag "mac is $mac";
diff --git a/scripts/nwfilter/210-no-mac-spoofing.t b/scripts/nwfilter/210-no-mac-spoofing.t
index 14c54db..aba5ce1 100644
--- a/scripts/nwfilter/210-no-mac-spoofing.t
+++ b/scripts/nwfilter/210-no-mac-spoofing.t
@@ -63,7 +63,7 @@ do {
 } while ($stats->{"tx_packets"} < 10 && $tries < 10);
 
 # Wait a little bit more to make sure dhcp is started in the guest
-sleep(10);
+sleep(20);
 
 # ping guest first nic
 my $mac =  get_first_macaddress($dom);
diff --git a/scripts/nwfilter/220-no-ip-spoofing.t b/scripts/nwfilter/220-no-ip-spoofing.t
index 1217c52..96cedf0 100644
--- a/scripts/nwfilter/220-no-ip-spoofing.t
+++ b/scripts/nwfilter/220-no-ip-spoofing.t
@@ -53,8 +53,17 @@ diag "Start domain";
 $dom->create;
 ok($dom->get_id() > 0, "running domain has an ID > 0");
 
-diag "Waiting 30 seconds for guest to finish booting";
-sleep(30);
+diag "Waiting for guest to finish booting";
+my $stats;
+my $tries = 0;
+do {
+    sleep(10);
+    $stats  = $dom->interface_stats("vnet0");
+    $tries++;
+} while ($stats->{"tx_packets"} < 10 && $tries < 10);
+
+# Wait a little bit more to make sure dhcp is started in the guest
+sleep(20);
 
 # ping guest first nic
 my $mac =  get_first_macaddress($dom);
diff --git a/scripts/nwfilter/230-no-mac-broadcast.t b/scripts/nwfilter/230-no-mac-broadcast.t
index cdf08fe..054e682 100644
--- a/scripts/nwfilter/230-no-mac-broadcast.t
+++ b/scripts/nwfilter/230-no-mac-broadcast.t
@@ -62,7 +62,7 @@ do {
 } while ($stats->{"tx_packets"} < 10 && $tries < 10);
 
 # Wait a little bit more to make sure dhcp is started in the guest
-sleep(10);
+sleep(20);
 
 # ping guest first nic
 my $mac =  get_first_macaddress($dom);
diff --git a/scripts/nwfilter/240-no-arp-spoofing.t b/scripts/nwfilter/240-no-arp-spoofing.t
index 5590ed5..7f48663 100644
--- a/scripts/nwfilter/240-no-arp-spoofing.t
+++ b/scripts/nwfilter/240-no-arp-spoofing.t
@@ -64,7 +64,7 @@ do {
 } while ($stats->{"tx_packets"} < 10 && $tries < 10);
 
 # Wait a little bit more to make sure dhcp is started in the guest
-sleep(10);
+sleep(20);
 
 # ping guest first nic
 my $mac =  get_first_macaddress($dom);
-- 
1.8.4.5




More information about the libvir-list mailing list