[PATCH tck] 202-numa-set-parameters.t: use AFFECT_CONFIG when changing nodeset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The 202-numa-set-parameters.t test sets NUMA_NODESET using AFFECT_LIVE on a
running domain, destroys and starts the domain, then verifies the NUMA_NODESET
setting. As AFFECT_LIVE does not write the setting to the domain xml file,
the new nodeset setting is lost when the domain is destroyed and the test
fails.

This patch adds AFFECT_CONFIG to set_numa_parameters, so both the live
environment and the xml file are updated with the new setting. An additional
test was also added, before the domain is destroyed, to ensure the nodeset
change is seen on the live domain.

---
 scripts/domain/202-numa-set-parameters.t | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/scripts/domain/202-numa-set-parameters.t b/scripts/domain/202-numa-set-parameters.t
index 886a979..f5ed871 100644
--- a/scripts/domain/202-numa-set-parameters.t
+++ b/scripts/domain/202-numa-set-parameters.t
@@ -28,7 +28,7 @@ after the API call to set NUMA parameters for a domain.
 use strict;
 use warnings;
 
-use Test::More tests => 12;
+use Test::More tests => 13;
 
 use Sys::Virt::TCK;
 use Test::Exception;
@@ -57,8 +57,12 @@ my %params = (
     Sys::Virt::Domain::NUMA_NODESET => '0',
 );
 
-diag "Set numa parameters, affects live config";
-lives_ok(sub {$dom->set_numa_parameters(\%params, Sys::Virt::Domain::AFFECT_LIVE)}, "set_numa_parameters");
+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 numa parameters";
+my $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;
@@ -68,7 +72,7 @@ $dom->create;
 ok($dom->get_id > 0, "running domain with ID > 0");
 
 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";
-- 
1.8.4.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]