diff options
author | Eric Blake <eblake@redhat.com> | 2010-12-15 13:49:00 -0700 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2010-12-20 10:31:40 -0700 |
commit | bb11c553120c7b52d651efa05ffaf646c5b622da (patch) | |
tree | 5257d27c1e1d23f22edc7f76ca12869d9e3cd1c1 /tests/nodeinfotest.c | |
parent | tests: avoid data race (diff) | |
download | libvirt-bb11c553120c7b52d651efa05ffaf646c5b622da.tar.gz libvirt-bb11c553120c7b52d651efa05ffaf646c5b622da.tar.bz2 libvirt-bb11c553120c7b52d651efa05ffaf646c5b622da.zip |
tests: avoid spurious failure of nodeinfotest
When running 'make check' under a multi-cpu Dom0 xen machine,
nodeinfotest had a spurious failure it was reading from
/sys/devices/system/cpu, but xen has no notion of topology. The test
was intended to be isolated from reading any real system files; the
regression was introduced in Mar 2010 with commit aa2f6f96dd.
Fix things by allowing an early exit for the testsuite.
* src/nodeinfo.c (linuxNodeInfoCPUPopulate): Add parameter.
(nodeGetInfo): Adjust caller.
* tests/nodeinfotest.c (linuxTestCompareFiles): Likewise.
Diffstat (limited to 'tests/nodeinfotest.c')
-rw-r--r-- | tests/nodeinfotest.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c index f56247b85..c69040350 100644 --- a/tests/nodeinfotest.c +++ b/tests/nodeinfotest.c @@ -26,7 +26,8 @@ static char *abs_srcdir; # define MAX_FILE 4096 -extern int linuxNodeInfoCPUPopulate(FILE *cpuinfo, virNodeInfoPtr nodeinfo); +extern int linuxNodeInfoCPUPopulate(FILE *cpuinfo, virNodeInfoPtr nodeinfo, + bool need_hyperthreads); static int linuxTestCompareFiles(const char *cpuinfofile, const char *outputfile) { char actualData[MAX_FILE]; @@ -43,7 +44,7 @@ static int linuxTestCompareFiles(const char *cpuinfofile, const char *outputfile return -1; memset(&nodeinfo, 0, sizeof(nodeinfo)); - if (linuxNodeInfoCPUPopulate(cpuinfo, &nodeinfo) < 0) { + if (linuxNodeInfoCPUPopulate(cpuinfo, &nodeinfo, false) < 0) { if (virTestGetDebug()) { virErrorPtr error = virSaveLastError(); if (error && error->code != VIR_ERR_OK) |