To make it easier to add more optional parameters to the
Sys::Virt::TCK::generic_domain method, change it to take
named parameters instead of positional parameters.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
docs/writing-tests.pod | 6 ++---
lib/Sys/Virt/TCK.pm | 37 +++++++++++++++-----------
lib/Sys/Virt/TCK/NetworkHelpers.pm | 2 +-
scripts/domain/050-transient-lifecycle.t | 2 +-
scripts/domain/051-transient-autostart.t | 2 +-
scripts/domain/060-persistent-lifecycle.t | 2 +-
scripts/domain/061-persistent-autostart.t | 2 +-
scripts/domain/065-persistent-redefine.t | 2 +-
scripts/domain/070-transient-to-persistent.t | 2 +-
scripts/domain/080-unique-id-define.t | 8 +++---
scripts/domain/081-unique-id-create.t | 8 +++---
scripts/domain/082-unique-id-caching.t | 4 +--
scripts/domain/090-invalid-ops-when-inactive.t | 2 +-
scripts/domain/100-transient-save-restore.t | 2 +-
scripts/domain/101-persistent-save-restore.t | 2 +-
scripts/domain/102-broken-save-restore.t | 2 +-
scripts/domain/103-blockdev-save-restore.t | 2 +-
scripts/domain/120-disks-stats.t | 2 +-
scripts/domain/121-block-info.t | 2 +-
scripts/domain/130-cpu-hotplug.t | 2 +-
scripts/domain/180-interface-parameters.t | 2 +-
scripts/domain/200-disk-hotplug.t | 2 +-
scripts/domain/202-numa-set-parameters.t | 2 +-
scripts/domain/205-disk-hotplug-ordering.t | 2 +-
scripts/domain/207-disk-media-change.t | 2 +-
scripts/domain/210-nic-hotplug.t | 2 +-
scripts/domain/215-nic-hotplug-many.t | 2 +-
scripts/domain/240-usb-host-hotplug.t | 2 +-
scripts/domain/250-pci-host-hotplug.t | 2 +-
scripts/domain/300-migration.t | 2 +-
scripts/domain/301-migration-max-speed.t | 2 +-
scripts/hooks/052-domain-hook.t | 2 +-
scripts/qemu/100-disk-encryption.t | 2 +-
scripts/qemu/200-qcow2-single-backing-file.t | 2 +-
scripts/qemu/205-qcow2-double-backing-file.t | 2 +-
scripts/qemu/210-qcow2-auto-probing.t | 2 +-
scripts/qemu/400-save-image-xml.t | 2 +-
scripts/selinux/050-dynamic-relabel-yes.t | 2 +-
scripts/selinux/055-dynamic-base-label.t | 2 +-
scripts/selinux/100-static-relabel-no.t | 2 +-
scripts/selinux/105-static-relabel-fail.t | 2 +-
scripts/selinux/110-static-relabel-yes.t | 2 +-
42 files changed, 71 insertions(+), 66 deletions(-)
diff --git a/docs/writing-tests.pod b/docs/writing-tests.pod
index 3bc70b0..171166c 100644
--- a/docs/writing-tests.pod
+++ b/docs/writing-tests.pod
@@ -159,7 +159,7 @@ the exact config, just wanting a minimal generic domain config that
is
highly likely to work without error. For such cases, a nice simple
API is provided:
- my $xml = $tck->generic_domain("test")->as_xml;
+ my $xml = $tck->generic_domain(name => "test")->as_xml;
This creates an XML document for a guest that is of the correct OS and
domain type to be able to run on the current hypervisor, with a name
@@ -167,7 +167,7 @@ of 'test', and a single disk. It is possible to set further
parameters
if required. For example, to set an explicit UUID, give 3 virtual CPUs
and turn on ACPI:
- my $xml = $tck->generic_domain("test")->vcpus(3)
+ my $xml = $tck->generic_domain(name => "test")->vcpus(3)
->uuid("11111111-1111-2222-3333-444444444444")
->with_acpi()->as_xml()
@@ -357,7 +357,7 @@ Taking this into account, the complete example script looks like
END { $tck->cleanup if $tck; }
- my $xml = $tck->generic_domain("test")->as_xml;
+ my $xml = $tck->generic_domain(name => "test")->as_xml;
my $dom;
diag "Defining inactive domain config again";
diff --git a/lib/Sys/Virt/TCK.pm b/lib/Sys/Virt/TCK.pm
index a3a2732..57eb08c 100644
--- a/lib/Sys/Virt/TCK.pm
+++ b/lib/Sys/Virt/TCK.pm
@@ -607,14 +607,14 @@ sub get_kernel {
sub generic_machine_domain {
my $self = shift;
- my $name = shift;
- my $caps = shift;
- my $ostype = shift;
- my $conn = @_ ? shift : $self->conn;
+ my %params = @_;
+ my $name = exists $params{name} ? $params{name} : "tck";
+ my $ostype = exists $params{ostype} ? $params{ostype} : "hvm";
+ my $caps = exists $params{caps} ? $params{caps} : die "caps parameter is
required";
my %config = $self->get_kernel($caps, $ostype);
- my $b = Sys::Virt::TCK::DomainBuilder->new(conn => $conn,
+ my $b = Sys::Virt::TCK::DomainBuilder->new(conn => $self->conn,
name => $name,
domain => $config{domain},
ostype => $config{ostype});
@@ -652,14 +652,14 @@ sub best_container_domain {
sub generic_container_domain {
my $self = shift;
- my $name = shift;
- my $caps = shift;
- my $domain = shift;
- my $conn = @_ ? shift : $self->conn;
+ my %params = @_;
+ my $name = exists $params{name} ? $params{name} : "tck";
+ my $caps = exists $params{caps} ? $params{caps} : die "caps parameter is
required";
+ my $domain = exists $params{domain} ? $params{domain} : die "domain parameter is
required";
my $bucket = "os-exe";
- my $b = Sys::Virt::TCK::DomainBuilder->new(conn => $conn,
+ my $b = Sys::Virt::TCK::DomainBuilder->new(conn => $self->conn,
name => $name,
domain => $domain,
ostype => "exe");
@@ -679,11 +679,12 @@ sub generic_container_domain {
sub generic_domain {
my $self = shift;
- my $name = @_ ? shift : "tck";
- my $ostype = @_ ? shift : undef;
- my $conn = shift || $self->conn;
+ my %params = @_;
+
+ my $name = exists $params{name} ? $params{name} : "tck";
+ my $ostype = exists $params{ostype} ? $params{ostype} : "hvm";
- my $caps = Sys::Virt::TCK::Capabilities->new(xml =>
$conn->get_capabilities);
+ my $caps = Sys::Virt::TCK::Capabilities->new(xml =>
$self->conn->get_capabilities);
my $container;
@@ -691,9 +692,13 @@ sub generic_domain {
unless $ostype && $ostype ne "exe";
if ($container) {
- return $self->generic_container_domain($name, $caps, $container);
+ return $self->generic_container_domain(name => $name,
+ caps => $caps,
+ domain => $container);
} else {
- return $self->generic_machine_domain($name, $caps, $ostype);
+ return $self->generic_machine_domain(name => $name,
+ caps => $caps,
+ ostype => $ostype);
}
}
diff --git a/lib/Sys/Virt/TCK/NetworkHelpers.pm b/lib/Sys/Virt/TCK/NetworkHelpers.pm
index 5e1bac1..a2a8251 100644
--- a/lib/Sys/Virt/TCK/NetworkHelpers.pm
+++ b/lib/Sys/Virt/TCK/NetworkHelpers.pm
@@ -58,7 +58,7 @@ sub build_domain{
my ($cdrom, $ksurl) = build_cdrom_ks_image($tck);
- my $guest = $tck->generic_domain($domain_name);
+ my $guest = $tck->generic_domain(name => $domain_name);
# change the type of network connection for 802.1Qbg tests
if ($mode eq "vepa") {
diff --git a/scripts/domain/050-transient-lifecycle.t
b/scripts/domain/050-transient-lifecycle.t
index 94c6bea..d9e9ecb 100644
--- a/scripts/domain/050-transient-lifecycle.t
+++ b/scripts/domain/050-transient-lifecycle.t
@@ -40,7 +40,7 @@ BAIL_OUT "failed to setup test harness: $@" if $@;
END { $tck->cleanup if $tck; }
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Creating a new transient domain";
my $dom;
diff --git a/scripts/domain/051-transient-autostart.t
b/scripts/domain/051-transient-autostart.t
index 26ca82b..0368365 100644
--- a/scripts/domain/051-transient-autostart.t
+++ b/scripts/domain/051-transient-autostart.t
@@ -38,7 +38,7 @@ BAIL_OUT "failed to setup test harness: $@" if $@;
END { $tck->cleanup if $tck; }
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Creating a new transient domain";
my $dom;
diff --git a/scripts/domain/060-persistent-lifecycle.t
b/scripts/domain/060-persistent-lifecycle.t
index ffcb7c9..01867f9 100644
--- a/scripts/domain/060-persistent-lifecycle.t
+++ b/scripts/domain/060-persistent-lifecycle.t
@@ -39,7 +39,7 @@ BAIL_OUT "failed to setup test harness: $@" if $@;
END { $tck->cleanup if $tck; }
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Defining an inactive domain config";
my $dom;
diff --git a/scripts/domain/061-persistent-autostart.t
b/scripts/domain/061-persistent-autostart.t
index 030515c..5f63270 100644
--- a/scripts/domain/061-persistent-autostart.t
+++ b/scripts/domain/061-persistent-autostart.t
@@ -39,7 +39,7 @@ BAIL_OUT "failed to setup test harness: $@" if $@;
END { $tck->cleanup if $tck; }
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Defining an inactive domain config";
my $dom;
diff --git a/scripts/domain/065-persistent-redefine.t
b/scripts/domain/065-persistent-redefine.t
index af13af2..c743c6a 100644
--- a/scripts/domain/065-persistent-redefine.t
+++ b/scripts/domain/065-persistent-redefine.t
@@ -38,7 +38,7 @@ BAIL_OUT "failed to setup test harness: $@" if $@;
END { $tck->cleanup if $tck; }
-my $cfg =
$tck->generic_domain("tck")->uuid("11111111-1111-1111-1111-111111111111");
+my $cfg = $tck->generic_domain(name =>
"tck")->uuid("11111111-1111-1111-1111-111111111111");
$cfg->on_reboot("restart");
my $xml1 = $cfg->as_xml;
$cfg->on_reboot("destroy");
diff --git a/scripts/domain/070-transient-to-persistent.t
b/scripts/domain/070-transient-to-persistent.t
index 6fea959..4ce98b9 100644
--- a/scripts/domain/070-transient-to-persistent.t
+++ b/scripts/domain/070-transient-to-persistent.t
@@ -39,7 +39,7 @@ BAIL_OUT "failed to setup test harness: $@" if $@;
END { $tck->cleanup if $tck; }
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Creating a new transient domain";
my $dom;
diff --git a/scripts/domain/080-unique-id-define.t
b/scripts/domain/080-unique-id-define.t
index 7bf23c3..7b5f2a1 100644
--- a/scripts/domain/080-unique-id-define.t
+++ b/scripts/domain/080-unique-id-define.t
@@ -54,13 +54,13 @@ my $uuid1 = "11111111-1111-1111-1111-111111111111";
my $uuid2 = "22222222-1111-1111-1111-111111111111";
# The initial config
-my $xml = $tck->generic_domain($name1)->uuid($uuid1)->as_xml;
+my $xml = $tck->generic_domain(name => $name1)->uuid($uuid1)->as_xml;
# One with a different UUID, matching name
-my $xml_diffuuid = $tck->generic_domain($name1)->uuid($uuid2)->as_xml;
+my $xml_diffuuid = $tck->generic_domain(name =>
$name1)->uuid($uuid2)->as_xml;
# One with a matching UUID, different name
-my $xml_diffname = $tck->generic_domain($name2)->uuid($uuid1)->as_xml;
+my $xml_diffname = $tck->generic_domain(name =>
$name2)->uuid($uuid1)->as_xml;
# One with a different UUID, different name
-my $xml_diffboth = $tck->generic_domain($name2)->uuid($uuid2)->as_xml;
+my $xml_diffboth = $tck->generic_domain(name =>
$name2)->uuid($uuid2)->as_xml;
diag "Defining persistent domain config";
diff --git a/scripts/domain/081-unique-id-create.t
b/scripts/domain/081-unique-id-create.t
index 68f29c7..07143a5 100644
--- a/scripts/domain/081-unique-id-create.t
+++ b/scripts/domain/081-unique-id-create.t
@@ -54,13 +54,13 @@ my $uuid1 = "11111111-1111-1111-1111-111111111111";
my $uuid2 = "22222222-1111-1111-1111-111111111111";
# The initial config
-my $xml = $tck->generic_domain($name1)->uuid($uuid1)->as_xml;
+my $xml = $tck->generic_domain(name => $name1)->uuid($uuid1)->as_xml;
# One with a different UUID, matching name
-my $xml_diffuuid = $tck->generic_domain($name1)->uuid($uuid2)->as_xml;
+my $xml_diffuuid = $tck->generic_domain(name =>
$name1)->uuid($uuid2)->as_xml;
# One with a matching UUID, different name
-my $xml_diffname = $tck->generic_domain($name2)->uuid($uuid1)->as_xml;
+my $xml_diffname = $tck->generic_domain(name =>
$name2)->uuid($uuid1)->as_xml;
# One with a different UUID, different name
-my $xml_diffboth = $tck->generic_domain($name2)->uuid($uuid2)->as_xml;
+my $xml_diffboth = $tck->generic_domain(name =>
$name2)->uuid($uuid2)->as_xml;
diag "Defining persistent domain config";
my ($dom, $dom1);
diff --git a/scripts/domain/082-unique-id-caching.t
b/scripts/domain/082-unique-id-caching.t
index 5ea13ed..7e0096d 100644
--- a/scripts/domain/082-unique-id-caching.t
+++ b/scripts/domain/082-unique-id-caching.t
@@ -64,9 +64,9 @@ my $uuid1 = "11111111-1111-1111-1111-111111111111";
my $uuid2 = "22222222-1111-1111-1111-111111111111";
# The initial config
-my $xml1 = $tck->generic_domain($name)->uuid($uuid1)->as_xml;
+my $xml1 = $tck->generic_domain(name => $name)->uuid($uuid1)->as_xml;
# One with a different UUID, matching name
-my $xml2 = $tck->generic_domain($name)->uuid($uuid2)->as_xml;
+my $xml2 = $tck->generic_domain(name => $name)->uuid($uuid2)->as_xml;
diag "Creating & destroying initial guest with $name, $uuid1";
my $dom1;
diff --git a/scripts/domain/090-invalid-ops-when-inactive.t
b/scripts/domain/090-invalid-ops-when-inactive.t
index 38dd744..2daeee5 100644
--- a/scripts/domain/090-invalid-ops-when-inactive.t
+++ b/scripts/domain/090-invalid-ops-when-inactive.t
@@ -40,7 +40,7 @@ BAIL_OUT "failed to setup test harness: $@" if $@;
END { $tck->cleanup if $tck; }
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Creating a new persistent domain";
my $dom;
diff --git a/scripts/domain/100-transient-save-restore.t
b/scripts/domain/100-transient-save-restore.t
index 9860fee..6ab6752 100644
--- a/scripts/domain/100-transient-save-restore.t
+++ b/scripts/domain/100-transient-save-restore.t
@@ -42,7 +42,7 @@ END {
}
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Creating a new transient domain";
my $dom;
diff --git a/scripts/domain/101-persistent-save-restore.t
b/scripts/domain/101-persistent-save-restore.t
index 5423edd..9384c23 100644
--- a/scripts/domain/101-persistent-save-restore.t
+++ b/scripts/domain/101-persistent-save-restore.t
@@ -42,7 +42,7 @@ END {
}
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Creating a new transient domain";
my $dom;
diff --git a/scripts/domain/102-broken-save-restore.t
b/scripts/domain/102-broken-save-restore.t
index a8c5d48..4a05705 100644
--- a/scripts/domain/102-broken-save-restore.t
+++ b/scripts/domain/102-broken-save-restore.t
@@ -43,7 +43,7 @@ END {
}
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Creating a new transient domain";
my $dom;
diff --git a/scripts/domain/103-blockdev-save-restore.t
b/scripts/domain/103-blockdev-save-restore.t
index 70d680c..db73e32 100644
--- a/scripts/domain/103-blockdev-save-restore.t
+++ b/scripts/domain/103-blockdev-save-restore.t
@@ -42,7 +42,7 @@ END {
}
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
my $dev = $tck->get_host_block_device();
diff --git a/scripts/domain/120-disks-stats.t b/scripts/domain/120-disks-stats.t
index fc18c29..b9d7be1 100644
--- a/scripts/domain/120-disks-stats.t
+++ b/scripts/domain/120-disks-stats.t
@@ -39,7 +39,7 @@ BAIL_OUT "failed to setup test harness: $@" if $@;
END { $tck->cleanup if $tck; }
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Defining an inactive domain config";
my $dom;
diff --git a/scripts/domain/121-block-info.t b/scripts/domain/121-block-info.t
index 0cf6500..6fa7780 100644
--- a/scripts/domain/121-block-info.t
+++ b/scripts/domain/121-block-info.t
@@ -85,7 +85,7 @@ my $disktype = "raw";
my $dst = "vda";
my $dst2 = "vdb";
my $dst3 = "vdc";
-my $guest = $tck->generic_domain("tck");
+my $guest = $tck->generic_domain(name => "tck");
$guest->rmdisk();
$guest->disk(format => { name => "qemu", type => $disktype }, type
=> "file", src => $path, dst => $dst);
diff --git a/scripts/domain/130-cpu-hotplug.t b/scripts/domain/130-cpu-hotplug.t
index 0ff1fc5..f735e73 100644
--- a/scripts/domain/130-cpu-hotplug.t
+++ b/scripts/domain/130-cpu-hotplug.t
@@ -41,7 +41,7 @@ BAIL_OUT "failed to setup test harness: $@" if $@;
END { $tck->cleanup if $tck; }
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Creating a new transient domain";
diff --git a/scripts/domain/180-interface-parameters.t
b/scripts/domain/180-interface-parameters.t
index cfe6cdb..d7866c0 100644
--- a/scripts/domain/180-interface-parameters.t
+++ b/scripts/domain/180-interface-parameters.t
@@ -47,7 +47,7 @@ END {
my $live = $conn->is_alive();
ok($live > 0, "Connection is alive");
-my $xml = $tck->generic_domain("tck")
+my $xml = $tck->generic_domain(name => "tck")
->interface(type => "network", source =>
"default", model => "virtio", mac =>
"52:54:00:22:22:22")
->as_xml;
diff --git a/scripts/domain/200-disk-hotplug.t b/scripts/domain/200-disk-hotplug.t
index fe12d72..4c54b6b 100644
--- a/scripts/domain/200-disk-hotplug.t
+++ b/scripts/domain/200-disk-hotplug.t
@@ -41,7 +41,7 @@ END {
}
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Creating a new transient domain";
my $dom;
diff --git a/scripts/domain/202-numa-set-parameters.t
b/scripts/domain/202-numa-set-parameters.t
index fd96866..c0baf0b 100644
--- a/scripts/domain/202-numa-set-parameters.t
+++ b/scripts/domain/202-numa-set-parameters.t
@@ -42,7 +42,7 @@ END {
}
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Creating a new persistent domain";
my $dom;
diff --git a/scripts/domain/205-disk-hotplug-ordering.t
b/scripts/domain/205-disk-hotplug-ordering.t
index be0487a..bc4990f 100644
--- a/scripts/domain/205-disk-hotplug-ordering.t
+++ b/scripts/domain/205-disk-hotplug-ordering.t
@@ -41,7 +41,7 @@ END {
}
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Creating a new transient domain";
my $dom;
diff --git a/scripts/domain/207-disk-media-change.t
b/scripts/domain/207-disk-media-change.t
index ad1756d..dfef7c9 100644
--- a/scripts/domain/207-disk-media-change.t
+++ b/scripts/domain/207-disk-media-change.t
@@ -46,7 +46,7 @@ my $path2 =
$tck->create_sparse_disk("207-disk-media-change", "extra2.img",
100)
my $xml;
eval {
- $xml = $tck->generic_domain("tck", "hvm")
+ $xml = $tck->generic_domain(name => "tck", ostype =>
"hvm")
->disk(src => $path1, dst => "hdc", type => "file",
device => "cdrom")
->as_xml;
};
diff --git a/scripts/domain/210-nic-hotplug.t b/scripts/domain/210-nic-hotplug.t
index 593a92d..ac9048e 100644
--- a/scripts/domain/210-nic-hotplug.t
+++ b/scripts/domain/210-nic-hotplug.t
@@ -41,7 +41,7 @@ END {
}
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Creating a new transient domain";
my $dom;
diff --git a/scripts/domain/215-nic-hotplug-many.t
b/scripts/domain/215-nic-hotplug-many.t
index 5b935cc..0270054 100644
--- a/scripts/domain/215-nic-hotplug-many.t
+++ b/scripts/domain/215-nic-hotplug-many.t
@@ -41,7 +41,7 @@ END {
}
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Creating a new transient domain";
my $dom;
diff --git a/scripts/domain/240-usb-host-hotplug.t
b/scripts/domain/240-usb-host-hotplug.t
index 6e74434..a840298 100644
--- a/scripts/domain/240-usb-host-hotplug.t
+++ b/scripts/domain/240-usb-host-hotplug.t
@@ -43,7 +43,7 @@ END {
}
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Creating a new transient domain";
my $dom;
diff --git a/scripts/domain/250-pci-host-hotplug.t
b/scripts/domain/250-pci-host-hotplug.t
index a9fe422..4579477 100644
--- a/scripts/domain/250-pci-host-hotplug.t
+++ b/scripts/domain/250-pci-host-hotplug.t
@@ -47,7 +47,7 @@ END {
}
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Creating a new transient domain";
my $dom;
diff --git a/scripts/domain/300-migration.t b/scripts/domain/300-migration.t
index 9cbdd8f..4e91668 100644
--- a/scripts/domain/300-migration.t
+++ b/scripts/domain/300-migration.t
@@ -100,7 +100,7 @@ my ($conn, $otherconn) = eval { $tck->setup(dualhost => 1); };
BAIL_OUT "failed to setup test harness: $@" if $@;
END { $tck->cleanup if $tck; }
-my $xml =
$tck->generic_domain("tck")->uuid("050072e8-7bce-3515-992a-8431d74f371f")->as_xml;
+my $xml = $tck->generic_domain(name =>
"tck")->uuid("050072e8-7bce-3515-992a-8431d74f371f")->as_xml;
use Sys::Virt::Domain;
use IO::File;
diff --git a/scripts/domain/301-migration-max-speed.t
b/scripts/domain/301-migration-max-speed.t
index cd029c2..6aac931 100644
--- a/scripts/domain/301-migration-max-speed.t
+++ b/scripts/domain/301-migration-max-speed.t
@@ -42,7 +42,7 @@ END {
$tck->cleanup if $tck;
}
-my $xml = $tck->generic_domain("tck")->as_xml;
+my $xml = $tck->generic_domain(name => "tck")->as_xml;
my $dom;
ok_domain(sub { $dom = $conn->create_domain($xml) }, "Create domain");
diff --git a/scripts/hooks/052-domain-hook.t b/scripts/hooks/052-domain-hook.t
index 90b8a48..294b30d 100644
--- a/scripts/hooks/052-domain-hook.t
+++ b/scripts/hooks/052-domain-hook.t
@@ -49,7 +49,7 @@ SKIP: {
skip 12, "Not using QEMU/LXC driver" unless
$uri eq "qemu:///system" or $uri eq "lxc:///";
- my $xml = $tck->generic_domain("tck")->as_xml;
+ my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Creating a new persistent domain";
my $dom;
diff --git a/scripts/qemu/100-disk-encryption.t b/scripts/qemu/100-disk-encryption.t
index 5fb6fc8..8a0fd5e 100644
--- a/scripts/qemu/100-disk-encryption.t
+++ b/scripts/qemu/100-disk-encryption.t
@@ -84,7 +84,7 @@ my $vol;
diag "Creating volume $volXML";
lives_ok(sub { $vol = $pool->create_volume($volXML) }, "volume created");
-my $xml = $tck->generic_domain("tck")
+my $xml = $tck->generic_domain(name => "tck")
->disk(format => { name => "qemu", type => "qcow2"
},
secret => $secretUUID,
type => "file",
diff --git a/scripts/qemu/200-qcow2-single-backing-file.t
b/scripts/qemu/200-qcow2-single-backing-file.t
index 1cc665f..28d27c2 100644
--- a/scripts/qemu/200-qcow2-single-backing-file.t
+++ b/scripts/qemu/200-qcow2-single-backing-file.t
@@ -107,7 +107,7 @@ SKIP: {
# We point the guest at a qcow2 image, but tell it that is
# is raw. Thus *nothing* should ever try to open the backing
# store in this qcow2 image.
- $xml = $tck->generic_domain("tck")
+ $xml = $tck->generic_domain(name => "tck")
->disk(format => { name => "qemu", type => "raw" },
type => "file",
src => $pathmain,
diff --git a/scripts/qemu/205-qcow2-double-backing-file.t
b/scripts/qemu/205-qcow2-double-backing-file.t
index ad54c7c..485b6f7 100644
--- a/scripts/qemu/205-qcow2-double-backing-file.t
+++ b/scripts/qemu/205-qcow2-double-backing-file.t
@@ -132,7 +132,7 @@ SKIP: {
# We point the guest at a qcow2 image, but tell it that is
# is raw. Thus *nothing* should ever try to open the backing
# store in this qcow2 image.
- $xml = $tck->generic_domain("tck")
+ $xml = $tck->generic_domain(name => "tck")
->disk(format => { name => "qemu", type => "qcow2" },
type => "file",
src => $pathmain,
diff --git a/scripts/qemu/210-qcow2-auto-probing.t
b/scripts/qemu/210-qcow2-auto-probing.t
index bf3de32..5ed4761 100644
--- a/scripts/qemu/210-qcow2-auto-probing.t
+++ b/scripts/qemu/210-qcow2-auto-probing.t
@@ -129,7 +129,7 @@ SKIP: {
# We point the guest at a qcow2 image, but tell it that is
# is raw. Thus *nothing* should ever try to open the backing
# store in this qcow2 image.
- $xml = $tck->generic_domain("tck")
+ $xml = $tck->generic_domain(name => "tck")
->disk(type => "file",
src => $pathmain,
dst => "vdb")
diff --git a/scripts/qemu/400-save-image-xml.t b/scripts/qemu/400-save-image-xml.t
index df87666..e7b96b7 100644
--- a/scripts/qemu/400-save-image-xml.t
+++ b/scripts/qemu/400-save-image-xml.t
@@ -47,7 +47,7 @@ SKIP:{
skip "Only relevant to QEMU driver", 10 unless $conn->get_type() eq
"QEMU";
# scenario 1 - get/define xml from transient domain save image
- my $xml = $tck->generic_domain("tck")->as_xml;
+ my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Creating a new transient domain";
my $dom;
ok_domain(sub { $dom = $conn->create_domain($xml) }, "created transient
domain object");
diff --git a/scripts/selinux/050-dynamic-relabel-yes.t
b/scripts/selinux/050-dynamic-relabel-yes.t
index 6a75f92..2fb6866 100644
--- a/scripts/selinux/050-dynamic-relabel-yes.t
+++ b/scripts/selinux/050-dynamic-relabel-yes.t
@@ -51,7 +51,7 @@ SKIP: {
my $origlabel = selinux_restore_file_context($disk);
diag "Original $origlabel";
- my $xml = $tck->generic_domain("tck")
+ my $xml = $tck->generic_domain(name => "tck")
->seclabel(model => "selinux", type => "dynamic", relabel
=> "yes")
->disk(src => $disk, dst => "vdb", type => "file")
->as_xml;
diff --git a/scripts/selinux/055-dynamic-base-label.t
b/scripts/selinux/055-dynamic-base-label.t
index 271c2e9..ba07c09 100644
--- a/scripts/selinux/055-dynamic-base-label.t
+++ b/scripts/selinux/055-dynamic-base-label.t
@@ -51,7 +51,7 @@ SKIP: {
my $origlabel = selinux_restore_file_context($disk);
- my $xml = $tck->generic_domain("tck")
+ my $xml = $tck->generic_domain(name => "tck")
->seclabel(model => "selinux", type => "dynamic", relabel
=> "yes", baselabel => $SELINUX_OTHER_CONTEXT)
->disk(src => $disk, dst => "vdb", type => "file")
->as_xml;
diff --git a/scripts/selinux/100-static-relabel-no.t
b/scripts/selinux/100-static-relabel-no.t
index 30db172..36eae47 100644
--- a/scripts/selinux/100-static-relabel-no.t
+++ b/scripts/selinux/100-static-relabel-no.t
@@ -53,7 +53,7 @@ SKIP: {
selinux_set_file_context($disk, $origimagelabel);
- my $xml = $tck->generic_domain("tck")
+ my $xml = $tck->generic_domain(name => "tck")
->seclabel(model => "selinux", type => "static", relabel
=> "no", label => $origdomainlabel)
->disk(src => $disk, dst => "vdb", type => "file")
->as_xml;
diff --git a/scripts/selinux/105-static-relabel-fail.t
b/scripts/selinux/105-static-relabel-fail.t
index 08ef429..20b576e 100644
--- a/scripts/selinux/105-static-relabel-fail.t
+++ b/scripts/selinux/105-static-relabel-fail.t
@@ -53,7 +53,7 @@ SKIP: {
my $origdomainlabel = $SELINUX_DOMAIN_CONTEXT . $origmcs;
my $origimagelabel = selinux_restore_file_context($disk);
- my $xml = $tck->generic_domain("tck")
+ my $xml = $tck->generic_domain(name => "tck")
->seclabel(model => "selinux", type => "static", relabel
=> "no", label => $origdomainlabel)
->disk(src => $disk, dst => "vdb", type => "file")
->as_xml;
diff --git a/scripts/selinux/110-static-relabel-yes.t
b/scripts/selinux/110-static-relabel-yes.t
index deba314..dc4e1ec 100644
--- a/scripts/selinux/110-static-relabel-yes.t
+++ b/scripts/selinux/110-static-relabel-yes.t
@@ -52,7 +52,7 @@ SKIP: {
my $origdomainlabel = $SELINUX_DOMAIN_CONTEXT . $origmcs;
my $origimagelabel = selinux_restore_file_context($disk);
- my $xml = $tck->generic_domain("tck")
+ my $xml = $tck->generic_domain(name => "tck")
->seclabel(model => "selinux", type => "static", relabel
=> "yes", label => $origdomainlabel)
->disk(src => $disk, dst => "vdb", type => "file")
->as_xml;
--
1.8.5.3