[libvirt] [PATCH 1/3] tests: virnetsockettest: Print the error if getifaddrs fails.

From: "Richard W.M. Jones" <rjones@redhat.com> --- tests/virnetsockettest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index eda95bc..82c202e 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -60,8 +60,10 @@ checkProtocols(bool *hasIPv4, bool *hasIPv6, *hasIPv4 = *hasIPv6 = false; *freePort = 0; - if (getifaddrs(&ifaddr) < 0) + if (getifaddrs(&ifaddr) < 0) { + perror ("getifaddrs"); goto cleanup; + } for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { if (!ifa->ifa_addr) -- 1.8.3.1

From: "Richard W.M. Jones" <rjones@redhat.com> --- tests/sysinfotest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sysinfotest.c b/tests/sysinfotest.c index 8357701..c8675f9 100644 --- a/tests/sysinfotest.c +++ b/tests/sysinfotest.c @@ -83,7 +83,7 @@ testSysinfo(const void *data) goto cleanup; if (STRNEQ(sysfsActualData, sysfsExpectData)) { - virtTestDifference(stderr, sysfsActualData, sysfsExpectData); + virtTestDifference(stderr, sysfsExpectData, sysfsActualData); goto cleanup; } -- 1.8.3.1

On 01/01/2014 08:49 AM, Richard W.M. Jones wrote:
From: "Richard W.M. Jones" <rjones@redhat.com>
--- tests/sysinfotest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/sysinfotest.c b/tests/sysinfotest.c index 8357701..c8675f9 100644 --- a/tests/sysinfotest.c +++ b/tests/sysinfotest.c @@ -83,7 +83,7 @@ testSysinfo(const void *data) goto cleanup;
if (STRNEQ(sysfsActualData, sysfsExpectData)) { - virtTestDifference(stderr, sysfsActualData, sysfsExpectData); + virtTestDifference(stderr, sysfsExpectData, sysfsActualData);
ACK. A quick: git grep virtTestDiff'.*,.*ctual.*,' tests/ didn't turn up any other obvious swaps (but not all tests use the same naming, so that's not conclusive) -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Richard W.M. Jones" <rjones@redhat.com> On AArch64 the kernel prints one "processor" (lower case 'p') line per core. As this was missing from the test data, virSysinfo was not parsing any processors at all. Fix the test data so the test now passes. --- tests/sysinfodata/aarch64cpuinfo.data | 1 + tests/sysinfodata/aarch64sysinfo.expect | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/sysinfodata/aarch64cpuinfo.data b/tests/sysinfodata/aarch64cpuinfo.data index 0d63139..fbab543 100644 --- a/tests/sysinfodata/aarch64cpuinfo.data +++ b/tests/sysinfodata/aarch64cpuinfo.data @@ -1,4 +1,5 @@ Processor : AArch64 Processor rev 0 (aarch64) +processor : 0 BogoMIPS : 100.00 Features : fp asimd diff --git a/tests/sysinfodata/aarch64sysinfo.expect b/tests/sysinfodata/aarch64sysinfo.expect index 518434d..2cb8932 100644 --- a/tests/sysinfodata/aarch64sysinfo.expect +++ b/tests/sysinfodata/aarch64sysinfo.expect @@ -1,10 +1,6 @@ <sysinfo type='smbios'> <processor> <entry name='socket_destination'>0</entry> - <entry name='type'>AArch64 Processor rev 0 (aarch64) </entry> - </processor> - <processor> - <entry name='socket_destination'>1</entry> <entry name='type'>AArch64 Processor rev 0 (aarch64)</entry> </processor> </sysinfo> -- 1.8.3.1

On 01/01/2014 08:49 AM, Richard W.M. Jones wrote:
From: "Richard W.M. Jones" <rjones@redhat.com>
On AArch64 the kernel prints one "processor" (lower case 'p') line per core. As this was missing from the test data, virSysinfo was not parsing any processors at all.
Fix the test data so the test now passes. --- tests/sysinfodata/aarch64cpuinfo.data | 1 + tests/sysinfodata/aarch64sysinfo.expect | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-)
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 01/01/2014 08:49 AM, Richard W.M. Jones wrote:
From: "Richard W.M. Jones" <rjones@redhat.com>
--- tests/virnetsockettest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index eda95bc..82c202e 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -60,8 +60,10 @@ checkProtocols(bool *hasIPv4, bool *hasIPv6, *hasIPv4 = *hasIPv6 = false; *freePort = 0;
- if (getifaddrs(&ifaddr) < 0) + if (getifaddrs(&ifaddr) < 0) { + perror ("getifaddrs"); goto cleanup; + }
ACK. Doesn't change pass/fail status, but makes debugging failure nicer. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 01/01/2014 09:24 AM, Eric Blake wrote:
On 01/01/2014 08:49 AM, Richard W.M. Jones wrote:
From: "Richard W.M. Jones" <rjones@redhat.com>
--- tests/virnetsockettest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index eda95bc..82c202e 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -60,8 +60,10 @@ checkProtocols(bool *hasIPv4, bool *hasIPv6, *hasIPv4 = *hasIPv6 = false; *freePort = 0;
- if (getifaddrs(&ifaddr) < 0) + if (getifaddrs(&ifaddr) < 0) { + perror ("getifaddrs"); goto cleanup; + }
ACK. Doesn't change pass/fail status, but makes debugging failure nicer.
Jenkins caught you. 'make syntax-check' would have warned you about the spurious space in the function call. I'll push the obvious fix. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Richard W.M. Jones