From: Daniel P. Berrange Date: Tue, 13 Apr 2010 10:39:16 +0000 (+0100) Subject: Fix nodeinfotest on NUMA machines X-Git-Tag: v0.8.1~158 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7ebe9f35775bc968c81f9c3c16853c00facb930;p=thirdparty%2Flibvirt.git Fix nodeinfotest on NUMA machines The nodeinfotest was reliant on the host NUMA topology, but all the test data files assumed 1 single NUMA node. This test thus failed on any NUMA machine with > 1 node * tests/nodeinfotest.c: Hardcode 1 single numa node --- diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c index 768fd4d4cd..9aeb459924 100644 --- a/tests/nodeinfotest.c +++ b/tests/nodeinfotest.c @@ -46,6 +46,11 @@ static int linuxTestCompareFiles(const char *cpuinfofile, const char *outputfile } fclose(cpuinfo); + /* 'nodes' is filled using libnuma.so from current machine + * topology, which makes it unsuitable for the test suite + * so blank it to a predictable value */ + nodeinfo.nodes = 1; + snprintf(actualData, MAX_FILE, "CPUs: %u, MHz: %u, Nodes: %u, Cores: %u\n", nodeinfo.cpus, nodeinfo.mhz, nodeinfo.nodes, nodeinfo.cores);