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

Daniel P. Berrange berrange at redhat.com
Fri Sep 10 16:53:34 UTC 2010


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 :|




More information about the libvir-list mailing list