Yaniv Bronhaim has submitted this change and it was merged.
Change subject: tests: clear libvirtconnection cache ......................................................................
tests: clear libvirtconnection cache
the libvirtconnection has a cache to reuse connections, and this caching doesn't play well with the monkeypatching which we do in tests.
In libvirtconnectionTests, we create fake libvirt objects, most notably fake virConnect-s. Unfortunately, the test fails to clean up properly the libvirtconnection cache.
So, the test runs just fine in isolation, but if run in batch like in 'make check', later tests which expect the real object become broken.
The failure presents itself like the following:
AttributeError: 'virConnect' object has no attribute 'getMemoryStats'
This patch fixes this error adding a facility to clear the libvirtconnection cache, and clearing it after each test.
Change-Id: If4d64920e5f26c276accf26b7a532461d04f02df Signed-off-by: Francesco Romani fromani@redhat.com Bug-Url: https://bugzilla.redhat.com/1267851 Reviewed-on: http://gerrit.ovirt.org/37747 Reviewed-by: Nir Soffer nsoffer@redhat.com Reviewed-by: Dan Kenigsberg danken@redhat.com Reviewed-on: https://gerrit.ovirt.org/39948 Continuous-Integration: Yaniv Bronhaim ybronhei@redhat.com --- M lib/vdsm/libvirtconnection.py M tests/libvirtconnectionTests.py 2 files changed, 12 insertions(+), 0 deletions(-)
Approvals: Nir Soffer: Looks good to me, but someone else must approve Yaniv Bronhaim: Passed CI tests Dan Kenigsberg: Looks good to me, approved Francesco Romani: Verified