[libvirt] [PATCH 0/2] tests: silence qemuargv2xmltest

Oh well, this missed the 0.8.4 deadline. This cleanup has already been mentioned for some time on the list, and I finally got it done. Eric Blake (2): tests: clean up qemuargv2xmltest tests: silence qemuargv2xmltest noise tests/qemuargv2xmltest.c | 200 +++++++++++++++++++++++++++------------------- 1 files changed, 117 insertions(+), 83 deletions(-) -- 1.7.2.2

Since commit 107a7bd06bc, the extraFlags argument was unused. * tests/qemuargv2xmltest.c (DO_TEST): Drop extraFlags argument. Adjust all callers. --- But keep the flag in the structure, for the next patch. tests/qemuargv2xmltest.c | 149 +++++++++++++++++++++------------------------- 1 files changed, 68 insertions(+), 81 deletions(-) diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c index 3c0f1e0..b75d2c5 100644 --- a/tests/qemuargv2xmltest.c +++ b/tests/qemuargv2xmltest.c @@ -122,8 +122,8 @@ mymain(int argc, char **argv) ret = -1; \ } while (0) -# define DO_TEST(name, extraFlags) \ - DO_TEST_FULL(name, extraFlags, NULL) +# define DO_TEST(name) \ + DO_TEST_FULL(name, 0, NULL) setenv("PATH", "/bin", 1); setenv("USER", "test", 1); @@ -135,100 +135,87 @@ mymain(int argc, char **argv) /* Can't roundtrip vcpu cpuset attribute */ /*DO_TEST("minimal", QEMUD_CMD_FLAG_NAME);*/ - DO_TEST("boot-cdrom", 0); - DO_TEST("boot-network", 0); - DO_TEST("boot-floppy", 0); + DO_TEST("boot-cdrom"); + DO_TEST("boot-network"); + DO_TEST("boot-floppy"); /* Can't roundtrip xenner arch */ - /*DO_TEST("bootloader", 0);*/ - DO_TEST("clock-utc", 0); - DO_TEST("clock-localtime", 0); - DO_TEST("disk-cdrom", 0); - DO_TEST("disk-cdrom-empty", QEMUD_CMD_FLAG_DRIVE); - DO_TEST("disk-floppy", 0); - DO_TEST("disk-many", 0); - DO_TEST("disk-virtio", QEMUD_CMD_FLAG_DRIVE | - QEMUD_CMD_FLAG_DRIVE_BOOT); - DO_TEST("disk-xenvbd", QEMUD_CMD_FLAG_DRIVE | - QEMUD_CMD_FLAG_DRIVE_BOOT); - DO_TEST("disk-drive-boot-disk", QEMUD_CMD_FLAG_DRIVE | - QEMUD_CMD_FLAG_DRIVE_BOOT); - DO_TEST("disk-drive-boot-cdrom", QEMUD_CMD_FLAG_DRIVE | - QEMUD_CMD_FLAG_DRIVE_BOOT); - DO_TEST("disk-drive-fmt-qcow", QEMUD_CMD_FLAG_DRIVE | - QEMUD_CMD_FLAG_DRIVE_BOOT); + /*DO_TEST("bootloader");*/ + DO_TEST("clock-utc"); + DO_TEST("clock-localtime"); + DO_TEST("disk-cdrom"); + DO_TEST("disk-cdrom-empty"); + DO_TEST("disk-floppy"); + DO_TEST("disk-many"); + DO_TEST("disk-virtio"); + DO_TEST("disk-xenvbd"); + DO_TEST("disk-drive-boot-disk"); + DO_TEST("disk-drive-boot-cdrom"); + DO_TEST("disk-drive-fmt-qcow"); /* Can't roundtrip shareable+cache mode option */ - /*DO_TEST("disk-drive-shared", QEMUD_CMD_FLAG_DRIVE);*/ + /*DO_TEST("disk-drive-shared");*/ /* Can't roundtrip v1 writethrough option */ - /*DO_TEST("disk-drive-cache-v1-wt", QEMUD_CMD_FLAG_DRIVE);*/ - DO_TEST("disk-drive-cache-v1-wb", QEMUD_CMD_FLAG_DRIVE); - DO_TEST("disk-drive-cache-v1-none", QEMUD_CMD_FLAG_DRIVE); - DO_TEST("disk-drive-error-policy-stop", QEMUD_CMD_FLAG_DRIVE | - QEMUD_CMD_FLAG_MONITOR_JSON | - QEMUD_CMD_FLAG_DRIVE_FORMAT); - DO_TEST("disk-drive-error-policy-enospace", QEMUD_CMD_FLAG_DRIVE | - QEMUD_CMD_FLAG_MONITOR_JSON | - QEMUD_CMD_FLAG_DRIVE_FORMAT); - DO_TEST("disk-drive-cache-v2-wt", QEMUD_CMD_FLAG_DRIVE | - QEMUD_CMD_FLAG_DRIVE_CACHE_V2); - DO_TEST("disk-drive-cache-v2-wb", QEMUD_CMD_FLAG_DRIVE | - QEMUD_CMD_FLAG_DRIVE_CACHE_V2); - DO_TEST("disk-drive-cache-v2-none", QEMUD_CMD_FLAG_DRIVE | - QEMUD_CMD_FLAG_DRIVE_CACHE_V2); - DO_TEST("disk-usb", 0); - DO_TEST("graphics-vnc", 0); + /*DO_TEST("disk-drive-cache-v1-wt");*/ + DO_TEST("disk-drive-cache-v1-wb"); + DO_TEST("disk-drive-cache-v1-none"); + DO_TEST("disk-drive-error-policy-stop"); + DO_TEST("disk-drive-error-policy-enospace"); + DO_TEST("disk-drive-cache-v2-wt"); + DO_TEST("disk-drive-cache-v2-wb"); + DO_TEST("disk-drive-cache-v2-none"); + DO_TEST("disk-usb"); + DO_TEST("graphics-vnc"); driver.vncSASL = 1; driver.vncSASLdir = strdup("/root/.sasl2"); - DO_TEST("graphics-vnc-sasl", 0); + DO_TEST("graphics-vnc-sasl"); driver.vncTLS = 1; driver.vncTLSx509verify = 1; driver.vncTLSx509certdir = strdup("/etc/pki/tls/qemu"); - DO_TEST("graphics-vnc-tls", 0); + DO_TEST("graphics-vnc-tls"); driver.vncSASL = driver.vncTLSx509verify = driver.vncTLS = 0; free(driver.vncSASLdir); free(driver.vncTLSx509certdir); driver.vncSASLdir = driver.vncTLSx509certdir = NULL; - DO_TEST("graphics-sdl", 0); - DO_TEST("graphics-sdl-fullscreen", 0); - DO_TEST("nographics-vga", QEMUD_CMD_FLAG_VGA); - DO_TEST("input-usbmouse", 0); - DO_TEST("input-usbtablet", 0); + DO_TEST("graphics-sdl"); + DO_TEST("graphics-sdl-fullscreen"); + DO_TEST("nographics-vga"); + DO_TEST("input-usbmouse"); + DO_TEST("input-usbtablet"); /* Can't rountrip xenner arch */ - /*DO_TEST("input-xen", 0);*/ - DO_TEST("misc-acpi", 0); - DO_TEST("misc-no-reboot", 0); - DO_TEST("misc-uuid", QEMUD_CMD_FLAG_NAME | - QEMUD_CMD_FLAG_UUID | QEMUD_CMD_FLAG_DOMID); - DO_TEST("net-user", 0); - DO_TEST("net-virtio", 0); - DO_TEST("net-eth", 0); - DO_TEST("net-eth-ifname", 0); - - DO_TEST("serial-vc", 0); - DO_TEST("serial-pty", 0); - DO_TEST("serial-dev", 0); - DO_TEST("serial-file", 0); - DO_TEST("serial-unix", 0); - DO_TEST("serial-tcp", 0); - DO_TEST("serial-udp", 0); - DO_TEST("serial-tcp-telnet", 0); - DO_TEST("serial-many", 0); - DO_TEST("parallel-tcp", 0); - DO_TEST("console-compat", 0); - DO_TEST("sound", 0); - DO_TEST("watchdog", 0); - - DO_TEST("hostdev-usb-address", 0); - - DO_TEST("hostdev-pci-address", QEMUD_CMD_FLAG_PCIDEVICE); - - DO_TEST_FULL("restore-v1", QEMUD_CMD_FLAG_MIGRATE_KVM_STDIO, "stdio"); - DO_TEST_FULL("restore-v2", QEMUD_CMD_FLAG_MIGRATE_QEMU_EXEC, "stdio"); - DO_TEST_FULL("restore-v2", QEMUD_CMD_FLAG_MIGRATE_QEMU_EXEC, "exec:cat"); - DO_TEST_FULL("migrate", QEMUD_CMD_FLAG_MIGRATE_QEMU_TCP, "tcp:10.0.0.1:5000"); - - DO_TEST("qemu-ns-no-env", 0); + /*DO_TEST("input-xen");*/ + DO_TEST("misc-acpi"); + DO_TEST("misc-no-reboot"); + DO_TEST("misc-uuid"); + DO_TEST("net-user"); + DO_TEST("net-virtio"); + DO_TEST("net-eth"); + DO_TEST("net-eth-ifname"); + + DO_TEST("serial-vc"); + DO_TEST("serial-pty"); + DO_TEST("serial-dev"); + DO_TEST("serial-file"); + DO_TEST("serial-unix"); + DO_TEST("serial-tcp"); + DO_TEST("serial-udp"); + DO_TEST("serial-tcp-telnet"); + DO_TEST("serial-many"); + DO_TEST("parallel-tcp"); + DO_TEST("console-compat"); + DO_TEST("sound"); + DO_TEST("watchdog"); + + DO_TEST("hostdev-usb-address"); + + DO_TEST("hostdev-pci-address"); + + DO_TEST_FULL("restore-v1", 0, "stdio"); + DO_TEST_FULL("restore-v2", 0, "stdio"); + DO_TEST_FULL("restore-v2", 0, "exec:cat"); + DO_TEST_FULL("migrate", 0, "tcp:10.0.0.1:5000"); + + DO_TEST("qemu-ns-no-env"); free(driver.stateDir); virCapabilitiesFree(driver.caps); -- 1.7.2.2

* tests/qemuargv2xmltest.c (testCompareXMLToArgvHelper, mymain): Use flag to mark which tests expect noisy stderr. (testCompareXMLToArgvFiles): Add parameter to test whether stderr was appropriately silent. --- This doesn't actually validate the contents of the warning put to stderr, but it's better than nothing as it tightens the test and reduces the noise. tests/qemuargv2xmltest.c | 53 +++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 50 insertions(+), 3 deletions(-) diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c index b75d2c5..8acf89f 100644 --- a/tests/qemuargv2xmltest.c +++ b/tests/qemuargv2xmltest.c @@ -4,6 +4,7 @@ #include <stdlib.h> #include <unistd.h> #include <string.h> +#include <stdbool.h> #include <sys/types.h> #include <fcntl.h> @@ -35,7 +36,8 @@ static int blankProblemElements(char *data) } static int testCompareXMLToArgvFiles(const char *xml, - const char *cmdfile) { + const char *cmdfile, + bool expect_stderr) { char xmlData[MAX_FILE]; char cmdData[MAX_FILE]; char *expectxml = &(xmlData[0]); @@ -43,15 +45,52 @@ static int testCompareXMLToArgvFiles(const char *xml, char *cmd = &(cmdData[0]); int ret = -1; virDomainDefPtr vmdef = NULL; + int err_fd = -1; + int orig_stderr = -1; + const char *file = NULL; + off_t offset; if (virtTestLoadFile(cmdfile, &cmd, MAX_FILE) < 0) goto fail; if (virtTestLoadFile(xml, &expectxml, MAX_FILE) < 0) goto fail; + /* Redirect stderr for the duration of qemuParseCommandLineString, + * to check if there were any warnings. */ + file = "qemuargv2xmltest.err"; + if (fflush(stderr) || + (err_fd = open(file, O_CREAT | O_RDWR, 0600)) < 0 || + (orig_stderr = dup(STDERR_FILENO)) < 0 || + dup2(err_fd, STDERR_FILENO) != STDERR_FILENO) + goto fail; + if (!(vmdef = qemuParseCommandLineString(driver.caps, cmd))) goto fail; + if (dup2(orig_stderr, STDERR_FILENO) != STDERR_FILENO) + goto fail; + if (close(orig_stderr)) { + orig_stderr = -1; + goto fail; + } + orig_stderr = -1; + + if ((offset = lseek(err_fd, 0, SEEK_CUR)) < 0 || + expect_stderr != !!offset) + goto fail; + + if (close(err_fd)) { + err_fd = -1; + goto fail; + } + err_fd = -1; + if (unlink(file)) { + file = NULL; + goto fail; + } + file = NULL; + + /* Proceed with remainder of test. */ if (!(actualxml = virDomainDefFormat(vmdef, 0))) goto fail; @@ -67,6 +106,14 @@ static int testCompareXMLToArgvFiles(const char *xml, ret = 0; fail: + if (err_fd >= 0) + close(err_fd); + if (file) + unlink(file); + if (orig_stderr >= 0) { + dup2(orig_stderr, STDERR_FILENO); + close(orig_stderr); + } free(actualxml); virDomainDefFree(vmdef); return ret; @@ -87,7 +134,7 @@ static int testCompareXMLToArgvHelper(const void *data) { abs_srcdir, info->name); snprintf(args, PATH_MAX, "%s/qemuxml2argvdata/qemuxml2argv-%s.args", abs_srcdir, info->name); - return testCompareXMLToArgvFiles(xml, args); + return testCompareXMLToArgvFiles(xml, args, !!info->extraFlags); } @@ -215,7 +262,7 @@ mymain(int argc, char **argv) DO_TEST_FULL("restore-v2", 0, "exec:cat"); DO_TEST_FULL("migrate", 0, "tcp:10.0.0.1:5000"); - DO_TEST("qemu-ns-no-env"); + DO_TEST_FULL("qemu-ns-no-env", 1, NULL); free(driver.stateDir); virCapabilitiesFree(driver.caps); -- 1.7.2.2

On Fri, Sep 10, 2010 at 10:29:37AM -0600, Eric Blake wrote:
* tests/qemuargv2xmltest.c (testCompareXMLToArgvHelper, mymain): Use flag to mark which tests expect noisy stderr. (testCompareXMLToArgvFiles): Add parameter to test whether stderr was appropriately silent. ---
This doesn't actually validate the contents of the warning put to stderr, but it's better than nothing as it tightens the test and reduces the noise.
What warnings are you seeing on stderr ?? The test suite really shouldn't print anything on stderr unless there's a real failure occurring, so I'm not sure that we need to/should hide stderr Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On 09/10/2010 10:42 AM, Daniel P. Berrange wrote:
On Fri, Sep 10, 2010 at 10:29:37AM -0600, Eric Blake wrote:
* tests/qemuargv2xmltest.c (testCompareXMLToArgvHelper, mymain): Use flag to mark which tests expect noisy stderr. (testCompareXMLToArgvFiles): Add parameter to test whether stderr was appropriately silent. ---
This doesn't actually validate the contents of the warning put to stderr, but it's better than nothing as it tightens the test and reduces the noise.
What warnings are you seeing on stderr ?? The test suite really shouldn't print anything on stderr unless there's a real failure occurring, so I'm not sure that we need to/should hide stderr
These are the warnings related to using the qemu monitoring commands added in 0.8.3: TEST: qemuargv2xmltest ........................................ 40 ................20:41:28.046: warning : qemuParseCommandLine:6565 : unknown QEMU argument '-unknown', adding to the qemu namespace 20:41:28.046: warning : qemuParseCommandLine:6565 : unknown QEMU argument 'parameter', adding to the qemu namespace . 57 OK PASS: qemuargv2xmltest It's not a real failure (which is why the test was completing successfully), so much as an intentional warning to the user that use of the qemu namespace has the potential for undefined effects. After this patch series, the test now explicitly checks for the presence or absence of the warning, such that the test output becomes: TEST: qemuargv2xmltest ........................................ 40 ................. 57 OK PASS: qemuargv2xmltest I guess I should have put this in the commit message to 2/2. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On Fri, Sep 10, 2010 at 10:47:25AM -0600, Eric Blake wrote:
On 09/10/2010 10:42 AM, Daniel P. Berrange wrote:
On Fri, Sep 10, 2010 at 10:29:37AM -0600, Eric Blake wrote:
* tests/qemuargv2xmltest.c (testCompareXMLToArgvHelper, mymain): Use flag to mark which tests expect noisy stderr. (testCompareXMLToArgvFiles): Add parameter to test whether stderr was appropriately silent. ---
This doesn't actually validate the contents of the warning put to stderr, but it's better than nothing as it tightens the test and reduces the noise.
What warnings are you seeing on stderr ?? The test suite really shouldn't print anything on stderr unless there's a real failure occurring, so I'm not sure that we need to/should hide stderr
These are the warnings related to using the qemu monitoring commands added in 0.8.3:
TEST: qemuargv2xmltest ........................................ 40 ................20:41:28.046: warning : qemuParseCommandLine:6565 : unknown QEMU argument '-unknown', adding to the qemu namespace 20:41:28.046: warning : qemuParseCommandLine:6565 : unknown QEMU argument 'parameter', adding to the qemu namespace . 57 OK PASS: qemuargv2xmltest
It's not a real failure (which is why the test was completing successfully), so much as an intentional warning to the user that use of the qemu namespace has the potential for undefined effects. After this patch series, the test now explicitly checks for the presence or absence of the warning, such that the test output becomes:
Ok, so this is from the internal logging APIs. Rather than playing dirty tricks with stderr, how about editing testutils.c, so that it simply registers a custom logging output prior to starting the test. It could be useful to always capture a full log of the test runs somewhere. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Before this patch, the testsuite was noisy: TEST: qemuargv2xmltest ........................................ 40 ................20:41:28.046: warning : qemuParseCommandLine:6565 : unknown QEMU argument '-unknown', adding to the qemu namespace 20:41:28.046: warning : qemuParseCommandLine:6565 : unknown QEMU argument 'parameter', adding to the qemu namespace . 57 OK PASS: qemuargv2xmltest It's not a real failure (which is why the test was completing successfully), so much as an intentional warning to the user that use of the qemu namespace has the potential for undefined effects that leaked through the default logging behavior. After this patch series, all tests can access any logged data, and this particular test can explicitly check for the presence or absence of the warning, such that the test output becomes: TEST: qemuargv2xmltest ........................................ 40 ................. 57 OK PASS: qemuargv2xmltest * tests/testutils.h (virtTestLogContentAndReset): New prototype. * tests/testutils.c (struct virtTestLogData): New struct. (virtTestLogOutput, virtTestLogClose, virtTestLogContentAndReset): New functions. (virtTestMain): Always capture log data emitted during tests. * tests/qemuargv2xmltest.c (testCompareXMLToArgvHelper, mymain): Use flag to mark which tests expect noisy stderr. (testCompareXMLToArgvFiles): Add parameter to test whether stderr was appropriately silent. --- Patch 1/2 has no changes. v2 of 2/2 is changed to add log capturing into all tests, then exploit that log capturing instead of mucking with stderr. Lots nicer; thanks for the idea, Daniel! tests/qemuargv2xmltest.c | 17 ++++++++++++++--- tests/testutils.c | 44 +++++++++++++++++++++++++++++++++++++++++++- tests/testutils.h | 4 +++- 3 files changed, 60 insertions(+), 5 deletions(-) diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c index b75d2c5..4f9ec84 100644 --- a/tests/qemuargv2xmltest.c +++ b/tests/qemuargv2xmltest.c @@ -4,6 +4,7 @@ #include <stdlib.h> #include <unistd.h> #include <string.h> +#include <stdbool.h> #include <sys/types.h> #include <fcntl.h> @@ -35,7 +36,8 @@ static int blankProblemElements(char *data) } static int testCompareXMLToArgvFiles(const char *xml, - const char *cmdfile) { + const char *cmdfile, + bool expect_warning) { char xmlData[MAX_FILE]; char cmdData[MAX_FILE]; char *expectxml = &(xmlData[0]); @@ -43,6 +45,7 @@ static int testCompareXMLToArgvFiles(const char *xml, char *cmd = &(cmdData[0]); int ret = -1; virDomainDefPtr vmdef = NULL; + char *log; if (virtTestLoadFile(cmdfile, &cmd, MAX_FILE) < 0) goto fail; @@ -52,6 +55,14 @@ static int testCompareXMLToArgvFiles(const char *xml, if (!(vmdef = qemuParseCommandLineString(driver.caps, cmd))) goto fail; + if ((log = virtTestLogContentAndReset()) == NULL) + goto fail; + if ((*log != '\0') != expect_warning) { + free(log); + goto fail; + } + free(log); + if (!(actualxml = virDomainDefFormat(vmdef, 0))) goto fail; @@ -87,7 +98,7 @@ static int testCompareXMLToArgvHelper(const void *data) { abs_srcdir, info->name); snprintf(args, PATH_MAX, "%s/qemuxml2argvdata/qemuxml2argv-%s.args", abs_srcdir, info->name); - return testCompareXMLToArgvFiles(xml, args); + return testCompareXMLToArgvFiles(xml, args, !!info->extraFlags); } @@ -215,7 +226,7 @@ mymain(int argc, char **argv) DO_TEST_FULL("restore-v2", 0, "exec:cat"); DO_TEST_FULL("migrate", 0, "tcp:10.0.0.1:5000"); - DO_TEST("qemu-ns-no-env"); + DO_TEST_FULL("qemu-ns-no-env", 1, NULL); free(driver.stateDir); virCapabilitiesFree(driver.caps); diff --git a/tests/testutils.c b/tests/testutils.c index 2f61aad..9737780 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -1,7 +1,7 @@ /* * testutils.c: basic test utils * - * Copyright (C) 2005-2009 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * * See COPYING.LIB for the License of this software * @@ -31,6 +31,8 @@ #include "util.h" #include "threads.h" #include "virterror_internal.h" +#include "buf.h" +#include "logging.h" #if TEST_OOM_TRACE # include <execinfo.h> @@ -351,6 +353,43 @@ virtTestErrorFuncQuiet(void *data ATTRIBUTE_UNUSED, { } #endif +struct virtTestLogData { + virBuffer buf; +}; + +static struct virtTestLogData testLog = { VIR_BUFFER_INITIALIZER }; + +static int +virtTestLogOutput(const char *category ATTRIBUTE_UNUSED, + int priority ATTRIBUTE_UNUSED, + const char *funcname ATTRIBUTE_UNUSED, + long long lineno ATTRIBUTE_UNUSED, + const char *str, int len, void *data) +{ + struct virtTestLogData *log = data; + virBufferAdd(&log->buf, str, len); + return len; +} + +static void +virtTestLogClose(void *data) +{ + struct virtTestLogData *log = data; + + virBufferFreeAndReset(&log->buf); +} + +/* Return a malloc'd string (possibly with strlen of 0) of all data + * logged since the last call to this function, or NULL on failure. */ +char * +virtTestLogContentAndReset(void) +{ + char *ret; + + if (virBufferError(&testLog.buf)) + return NULL; + ret = virBufferContentAndReset(&testLog.buf); + return ret ? ret : strdup(""); +} + #if TEST_OOM_TRACE static void virtTestErrorHook(int n, void *data ATTRIBUTE_UNUSED) @@ -425,6 +464,9 @@ int virtTestMain(int argc, virRandomInitialize(time(NULL) ^ getpid())) return 1; + if (virLogDefineOutput(virtTestLogOutput, virtTestLogClose, &testLog, + 0, 0, NULL, 0) < 0) + return 1; #if TEST_OOM if ((oomStr = getenv("VIR_TEST_OOM")) != NULL) { diff --git a/tests/testutils.h b/tests/testutils.h index 95f1680..88603a1 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -1,7 +1,7 @@ /* * utils.c: test utils * - * Copyright (C) 2005, 2008-2009 Red Hat, Inc. + * Copyright (C) 2005, 2008-2010 Red Hat, Inc. * * See COPYING.LIB for the License of this software * @@ -40,6 +40,8 @@ int virtTestDifference(FILE *stream, unsigned int virTestGetDebug(void); unsigned int virTestGetVerbose(void); +char *virtTestLogContentAndReset(void); + int virtTestMain(int argc, char **argv, int (*func)(int, char **)); -- 1.7.2.2

On 09/11/2010 05:18 AM, Eric Blake wrote: <snip>
Patch 1/2 has no changes.
v2 of 2/2 is changed to add log capturing into all tests, then exploit that log capturing instead of mucking with stderr.
Lots nicer; thanks for the idea, Daniel!
ACK, when pulled directly from your repository (due to mangling of email version by email programs).

On 09/16/2010 03:18 PM, Justin Clift wrote:
On 09/11/2010 05:18 AM, Eric Blake wrote: <snip>
Patch 1/2 has no changes.
v2 of 2/2 is changed to add log capturing into all tests, then exploit that log capturing instead of mucking with stderr.
Lots nicer; thanks for the idea, Daniel!
ACK, when pulled directly from your repository (due to mangling of email version by email programs).
Thanks for the review; I've pushed both patches now. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 09/11/2010 02:47 AM, Eric Blake wrote: <snip>
What warnings are you seeing on stderr ?? The test suite really shouldn't print anything on stderr unless there's a real failure occurring, so I'm not sure that we need to/should hide stderr
These are the warnings related to using the qemu monitoring commands added in 0.8.3:
Good follow up. :) Was just thinking about this misleading warning message when running the checks today, and voila, you've got the patch happening to fix the problem. Cool.
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Justin Clift