[libvirt] [tck PATCH v2 09/13] scripts: fix the various hotplug tests

Daniel P. Berrangé berrange at redhat.com
Mon May 21 16:46:27 UTC 2018


PCI device hotunplug requires a running guest OS that cooperates with
the ACPI unplug request. We must thus boot a real guest and wait for it
to be ready before running the tests.

Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
---
 scripts/domain/200-disk-hotplug.t          | 4 +++-
 scripts/domain/205-disk-hotplug-ordering.t | 5 ++++-
 scripts/domain/210-nic-hotplug.t           | 5 ++++-
 scripts/domain/215-nic-hotplug-many.t      | 5 ++++-
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/scripts/domain/200-disk-hotplug.t b/scripts/domain/200-disk-hotplug.t
index 4c54b6b..87c0e53 100644
--- a/scripts/domain/200-disk-hotplug.t
+++ b/scripts/domain/200-disk-hotplug.t
@@ -41,12 +41,14 @@ END {
 }
 
 
-my $xml = $tck->generic_domain(name => "tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck", fullos => 1)->as_xml;
 
 diag "Creating a new transient domain";
 my $dom;
 ok_domain(sub { $dom = $conn->create_domain($xml) }, "created transient domain object");
 
+diag "Waiting 30 seconds for guest to finish booting";
+sleep(30);
 
 my $path = $tck->create_sparse_disk("200-disk-hotplug", "extra.img", 100);
 
diff --git a/scripts/domain/205-disk-hotplug-ordering.t b/scripts/domain/205-disk-hotplug-ordering.t
index bc4990f..b76cd54 100644
--- a/scripts/domain/205-disk-hotplug-ordering.t
+++ b/scripts/domain/205-disk-hotplug-ordering.t
@@ -41,12 +41,15 @@ END {
 }
 
 
-my $xml = $tck->generic_domain(name => "tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck", fullos => 1)->as_xml;
 
 diag "Creating a new transient domain";
 my $dom;
 ok_domain(sub { $dom = $conn->create_domain($xml) }, "created transient domain object");
 
+diag "Waiting 30 seconds for guest to finish booting";
+sleep(30);
+
 my $supported = 1;
 foreach my $dev (qw/vdb sdb/) {
     my $path = $tck->create_sparse_disk("200-disk-hotplug", "extra-$dev.img", 100);
diff --git a/scripts/domain/210-nic-hotplug.t b/scripts/domain/210-nic-hotplug.t
index ac9048e..7106fd0 100644
--- a/scripts/domain/210-nic-hotplug.t
+++ b/scripts/domain/210-nic-hotplug.t
@@ -41,12 +41,15 @@ END {
 }
 
 
-my $xml = $tck->generic_domain(name => "tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck", fullos => 1)->as_xml;
 
 diag "Creating a new transient domain";
 my $dom;
 ok_domain(sub { $dom = $conn->create_domain($xml) }, "created transient domain object");
 
+diag "Waiting 30 seconds for guest to finish booting";
+sleep(30);
+
 my $mac = "00:11:22:33:44:55";
 my $model = "virtio";
 
diff --git a/scripts/domain/215-nic-hotplug-many.t b/scripts/domain/215-nic-hotplug-many.t
index eaa282a..558e6e7 100644
--- a/scripts/domain/215-nic-hotplug-many.t
+++ b/scripts/domain/215-nic-hotplug-many.t
@@ -41,12 +41,15 @@ END {
 }
 
 
-my $xml = $tck->generic_domain(name => "tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck", fullos => 1)->as_xml;
 
 diag "Creating a new transient domain";
 my $dom;
 ok_domain(sub { $dom = $conn->create_domain($xml) }, "created transient domain object");
 
+diag "Waiting 30 seconds for guest to finish booting";
+sleep(30);
+
 my $mac1 = "02:11:22:33:44:55";
 my $mac2 = "02:12:22:33:44:55";
 my $mac3 = "02:13:22:33:44:55";
-- 
2.17.0




More information about the libvir-list mailing list