On Wed, Mar 05, 2025 at 12:51:16PM +0100, Thomas Huth wrote:
> On 28/02/2025 11.27, Daniel P. Berrangé wrote:
> > A number of fields are set at the class level on QemuBaseTest, even
> > though the exact same named field is then set at the object level
> > later in most cases.
> > 
> > Reviewed-by: Thomas Huth <th...@redhat.com>
> > Signed-off-by: Daniel P. Berrangé <berra...@redhat.com>
> > ---
> >   tests/functional/qemu_test/testcase.py | 6 ------
> >   1 file changed, 6 deletions(-)
> > 
> > diff --git a/tests/functional/qemu_test/testcase.py 
> > b/tests/functional/qemu_test/testcase.py
> > index 058bf270ec..5b18416bed 100644
> > --- a/tests/functional/qemu_test/testcase.py
> > +++ b/tests/functional/qemu_test/testcase.py
> > @@ -33,12 +33,6 @@
> >   class QemuBaseTest(unittest.TestCase):
> > -    arch = None
> > -
> > -    workdir = None
> > -    log = None
> > -    logdir = None
> 
> This seems to break the ACPI test:
> 
> https://gitlab.com/thuth/qemu/-/jobs/9316861224#L164

Our current code initializes  self.log in the setUp() method.

The ACPI bits code references self.log in the __init__() method.

So historically it has been referencing the class level 'log'
property which has always been None. This means if it were
to ever trigger codepaths calling self._print_log it will
crash on referncing None. So this patch has exposed a preexisting
flaw that was dormant.

I think the fix is to move ACPI bits logic out of __init__ and
into its own setUp() method.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


Reply via email to