Change in vdsm[master]: xmlrpcTests: refactoring

michal.skrivanek at redhat.com michal.skrivanek at redhat.com
Wed Aug 21 09:20:28 UTC 2013


Michal Skrivanek has posted comments on this change.

Change subject: xmlrpcTests: refactoring
......................................................................


Patch Set 12:

(3 comments)

....................................................
File tests/functional/virtTests.py
Line 53:         os.unlink(_initramfsPath)
Line 54: 
Line 55: 
Line 56: def readableBy(filePath, user):
Line 57:     rc, out, err = execCmd([EXT_SUDO, '-u', user, 'head', '-c', '0', filePath])
not sure if this heavyweight test is worth it...You kind of depend on sudo....why not just check current user and just in case qemu process can't access it let it fail.

In any case I'd prefer to test with /bin/test
Line 58:     return rc == 0
Line 59: 
Line 60: 
Line 61: def skipNoKVM(method):


Line 57:     rc, out, err = execCmd([EXT_SUDO, '-u', user, 'head', '-c', '0', filePath])
Line 58:     return rc == 0
Line 59: 
Line 60: 
Line 61: def skipNoKVM(method):
In general I agree though I'd leave it in this case.
Line 62:     @wraps(method)
Line 63:     def wrapped(self, *args, **kwargs):
Line 64:         status, msg, result = self.vdsm.getVdsCapabilities()
Line 65:         self.assertEqual(status, SUCCESS, msg)


Line 166: 
Line 167:     def assertVmUp(self, vmid):
Line 168:         status, msg, result = self.vdsm.getVmStats(vmid)
Line 169:         self.assertEqual(status, SUCCESS, msg)
Line 170:         self.assertTrue(result['status'] in self.UPSTATES)
Because the VM is "Up" when it's in one of the up states...May look confusing at first, but that's how we treat the states everywhere...
Line 171: 
Line 172:     def assertGuestUp(self, vmid, shortcut=0):
Line 173:         status, msg, result = self.vdsm.getVmStats(vmid)
Line 174:         self.assertEqual(status, SUCCESS, msg)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I683c9e056137e7a189815bf6be2eb79ee80994cf
Gerrit-PatchSet: 12
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpoledni at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare at redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: Martin Polednik <mpoledni at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Peter V. Saveliev <peet at redhat.com>
Gerrit-Reviewer: Petr Ĺ ebek <psebek at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list