[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] tests: Introduce qemuhotplugtest



On Tue, Jun 25, 2013 at 03:45:47PM +0200, Michal Privoznik wrote:
> On 25.06.2013 12:00, Daniel P. Berrange wrote:
> >> +#define DO_TEST(file, dev, fial, ...) \
> >> > +    do { \
> >> > +        const char *my_mon[] = { __VA_ARGS__, NULL}; \
> >> > +        struct qemuHotplugTestData data =                                    \
> >> > +            {.domain_filename = file, .device_filename = dev, .fail = fial,  \
> >> > +             .mon = my_mon}; \
> >> > +        if (virtTestRun(#file, 1, testQemuHotplug, &data) < 0)               \
> >> > +            ret = -1;                                                        \
> >> > +    } while (0)
> > What's with the 'fail' parameter you're passing across test cases.
> > AFAICT, no test needs to be aware of the fail status of any earlier
> > test. You're re-creating the fake monitor for each test case so
> > no state is shared between tests. Just setting the 'ret = -1' here
> > is sufficient
> > 
> 
> The parameter is there to tell the testQemuHotplug if error is expected
> or not. For instance, changing a listen address is expected to fail.
> Hence, qemuDomainChangeGraphics() called from the test function must
> return -1. However, the test function knows the error is expected, so it
> must return 0. This is controlled by 'fial'. I think we have similar
> approach elsewhere in the test suite.

Oh I see. So its really an "expectFail" flag.

ACK to the original patch.


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]