On Mon, 2015-10-05 at 17:18 -0600, Mike Latimer wrote:
Libvirt commit 47171cd1 causes VIR_DOMAIN_AFFECT_LIVE and
VIR_DOMAIN_AFFECT_CONFIG to be mutually exclusive. This patch modifies
202-numa-set-parameters.t to take that change into consideration and test
the AFFECT_LIVE flag individually. After setting NUMA parameters with this
flag, the domain is restarted and the NUMA settings are compared to the
default flags (stored prior to any AFFECT_LIVE changes).
Signed-off-by: Mike Latimer <mlatimer(a)suse.com>
---
scripts/domain/202-numa-set-parameters.t | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/scripts/domain/202-numa-set-parameters.t
b/scripts/domain/202-numa-set-parameters.t
index f5ed871..1055edd 100644
--- a/scripts/domain/202-numa-set-parameters.t
+++ b/scripts/domain/202-numa-set-parameters.t
@@ -57,23 +57,27 @@ my %params = (
Sys::Virt::Domain::NUMA_NODESET => '0',
);
-diag "Set numa parameters, affects live and config";
-lives_ok(sub {$dom->set_numa_parameters(\%params, Sys::Virt::Domain::AFFECT_LIVE |
Sys::Virt::Domain::AFFECT_CONFIG)}, "set_numa_parameters");
+diag "Get default numa parameters";
+my $params = $dom->get_numa_parameters(Sys::Virt::Domain::AFFECT_LIVE);
+my $default_nodeset = ($params->{Sys::Virt::Domain::NUMA_NODESET});
+
+diag "Set numa parameters, affects live config only";
+lives_ok(sub {$dom->set_numa_parameters(\%params, Sys::Virt::Domain::AFFECT_LIVE)},
"set_numa_parameters");
diag "Get numa parameters";
-my $params = $dom->get_numa_parameters(Sys::Virt::Domain::AFFECT_LIVE);
+$params = $dom->get_numa_parameters(Sys::Virt::Domain::AFFECT_LIVE);
ok($params->{Sys::Virt::Domain::NUMA_NODESET} eq '0', 'Check
nodeset');
diag "Destroy the domain";
$dom->destroy;
-diag "Make sure the domain can be started after setting numa parameters";
+diag "Make sure the domain is started with the default nodeset after setting numa
parameters";
$dom->create;
ok($dom->get_id > 0, "running domain with ID > 0");
diag "Get numa parameters";
$params = $dom->get_numa_parameters(Sys::Virt::Domain::AFFECT_LIVE);
-ok($params->{Sys::Virt::Domain::NUMA_NODESET} eq '0', 'Check
nodeset');
+ok($params->{Sys::Virt::Domain::NUMA_NODESET} eq '$default_nodeset',
'Check nodeset');
diag "Destroy the domain";
$dom->destroy;
ACK
--
Cedric