Change in vdsm[master]: tests: clear libvirtconnection cache

nsoffer at redhat.com nsoffer at redhat.com
Thu Feb 12 14:35:17 UTC 2015


Nir Soffer has posted comments on this change.

Change subject: tests: clear libvirtconnection cache
......................................................................


Patch Set 1:

(2 comments)

http://gerrit.ovirt.org/#/c/37747/1/lib/vdsm/libvirtconnection.py
File lib/vdsm/libvirtconnection.py:

Line 101:         libvirt.openAuth, uri, auth, 0)
Line 102:     return utils.retry(libvirtOpen, timeout=10, sleep=0.2)
Line 103: 
Line 104: 
Line 105: def clear():
What will happen if we use this in the application?

Lets make it private so it is clear that you are not allowed to call this, and document why this method exists:

    For clearing connections during the tests.

So nobody assumes that this is a private function that the application do not use, and can be safely removed :-)
Line 106:     """
Line 107:     for debug purposes only
Line 108:     """
Line 109:     with __connectionLock:


http://gerrit.ovirt.org/#/c/37747/1/tests/libvirtconnectionTests.py
File tests/libvirtconnectionTests.py:

Line 106: class testLibvirtconnection(TestCaseBase):
Line 107: 
Line 108:     @classmethod
Line 109:     def tearDownClass(cls):
Line 110:         libvirtconnection.clear()
Leaving dirty libvirt between the tests is fragile. Lets make this regular tearDown() method and clean up after every test.
Line 111: 
Line 112:     @MonkeyPatch(libvirtconnection, 'libvirt', LibvirtMock())
Line 113:     @MonkeyPatch(constants, 'P_VDSM_LIBVIRT_PASSWD', '/dev/null')
Line 114:     def testCallSucceeded(self):


-- 
To view, visit http://gerrit.ovirt.org/37747
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If4d64920e5f26c276accf26b7a532461d04f02df
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Ala Hino <ahino at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list