[libvirt] [PATCH 08/18] tests: Known failing tests should never succeed

Andrea Bolognani abologna at redhat.com
Thu Aug 6 14:20:56 UTC 2015


On Thu, 2015-08-06 at 11:23 +0200, Jiri Denemark wrote:
> 
> > @@ -302,6 +297,19 @@ cpuTestGuestData(const void *arg)
> >      virCPUDefFree(host);
> >      virCPUDefFree(cpu);
> >      virCPUDefFree(guest);
> > +
> > +    if (data->result < 0) {
> > +        virResetLastError();
> > +        if (ret < 0) {
> > +            ret = 0;
> > +        } else {
> > +            VIR_TEST_VERBOSE("\n%-70s... ",
> > +                             "cpuGuestData/cpuDecode was expected 
> > "
> > +                             "to fail but it succeeded");
> > +            ret = -1;
> > +        }
> > +    }
> > +
> 
> This would apply to any failure, but when, e.g., loading the XML 
> files
> or memory allocation fails, we want to fail the test even if it was
> expected to fail. This conditional statement should only be applied 
> when
> cpuDecode or cpuGuestData fails.

Right. I have changed the code so that it can tell these two kinds
of failure apart and act accordingly.

Cheers.

-- 
Andrea Bolognani
Software Engineer - Virtualization Team




More information about the libvir-list mailing list