Zhou Zheng Sheng has uploaded a new change for review.
Change subject: xmlrpcTests: change skipNoKVM into a decorator ......................................................................
xmlrpcTests: change skipNoKVM into a decorator
After using skipNoKVM as decorator, the code looks cleaner.
class XMLRPCTest(TestCaseBase): @skipNoKVM def testMethod(self): ...
Change-Id: I3b8507f3c5f1e1d2712a37fba0162c9aaf56c3a3 Signed-off-by: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com --- M tests/functional/xmlrpcTests.py 1 file changed, 14 insertions(+), 12 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/83/9783/1
diff --git a/tests/functional/xmlrpcTests.py b/tests/functional/xmlrpcTests.py index 79e8109..c259533 100644 --- a/tests/functional/xmlrpcTests.py +++ b/tests/functional/xmlrpcTests.py @@ -86,6 +86,17 @@ return path
+def skipNoKVM(method): + def wrapped(self): + r = self.s.getVdsCapabilities() + self.assertVdsOK(r) + if r['info']['kvmEnabled'] != 'true': + raise SkipTest('KVM is not enabled') + return method(self) + wrapped.func_name = method.func_name + return wrapped + + class XMLRPCTest(TestCaseBase): UPSTATES = frozenset(('Up', 'Powering up', 'Running'))
@@ -127,15 +138,8 @@ 'error code: %s, message: %s' % (vdsResult['status']['code'], vdsResult['status']['message']))
- def skipNoKVM(self): - r = self.s.getVdsCapabilities() - self.assertVdsOK(r) - if r['info']['kvmEnabled'] != 'true': - raise SkipTest('KVM is not enabled') - + @skipNoKVM def testStartEmptyVM(self): - self.skipNoKVM() - VMID = '66666666-ffff-4444-bbbb-333333333333'
r = self.s.create({'memSize': '100', 'display': 'vnc', 'vmId': VMID, @@ -148,9 +152,8 @@ r = self.s.destroy(VMID) self.assertVdsOK(r)
+ @skipNoKVM def testStartSmallVM(self): - self.skipNoKVM() - customization = {'vmId': '77777777-ffff-3333-bbbb-222222222222', 'vmName': 'vdsm_testSmallVM'}
@@ -198,9 +201,8 @@ with RollbackContext() as rollback: self._createVdsmStorageLayout(conf, rollback)
+ @skipNoKVM def testSimpleVMoLocalfs(self): - self.skipNoKVM() - localfs = storageLayouts['localfs'] drives = [] for poolid, domains in localfs['layout'].iteritems():
-- To view, visit http://gerrit.ovirt.org/9783 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: I3b8507f3c5f1e1d2712a37fba0162c9aaf56c3a3 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com
oVirt Jenkins CI Server has posted comments on this change.
Change subject: xmlrpcTests: change skipNoKVM into a decorator ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/275/ (1/2)
-- To view, visit http://gerrit.ovirt.org/9783 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I3b8507f3c5f1e1d2712a37fba0162c9aaf56c3a3 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: xmlrpcTests: change skipNoKVM into a decorator ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/241/ (2/2)
-- To view, visit http://gerrit.ovirt.org/9783 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I3b8507f3c5f1e1d2712a37fba0162c9aaf56c3a3 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Zhou Zheng Sheng has posted comments on this change.
Change subject: xmlrpcTests: change skipNoKVM into a decorator ......................................................................
Patch Set 1: Verified
Test the patch myself.
-- To view, visit http://gerrit.ovirt.org/9783 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I3b8507f3c5f1e1d2712a37fba0162c9aaf56c3a3 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: xmlrpcTests: change skipNoKVM into a decorator ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/241/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/275/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/9783 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I3b8507f3c5f1e1d2712a37fba0162c9aaf56c3a3 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Royce Lv has posted comments on this change.
Change subject: xmlrpcTests: change skipNoKVM into a decorator ......................................................................
Patch Set 1: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/9783 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I3b8507f3c5f1e1d2712a37fba0162c9aaf56c3a3 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has submitted this change and it was merged.
Change subject: xmlrpcTests: change skipNoKVM into a decorator ......................................................................
xmlrpcTests: change skipNoKVM into a decorator
After using skipNoKVM as decorator, the code looks cleaner.
class XMLRPCTest(TestCaseBase): @skipNoKVM def testMethod(self): ...
Change-Id: I3b8507f3c5f1e1d2712a37fba0162c9aaf56c3a3 Signed-off-by: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com --- M tests/functional/xmlrpcTests.py 1 file changed, 14 insertions(+), 12 deletions(-)
Approvals: Royce Lv: Looks good to me, but someone else must approve Dan Kenigsberg: Looks good to me, approved Zhou Zheng Sheng: Verified
-- To view, visit http://gerrit.ovirt.org/9783 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged Gerrit-Change-Id: I3b8507f3c5f1e1d2712a37fba0162c9aaf56c3a3 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: xmlrpcTests: change skipNoKVM into a decorator ......................................................................
Patch Set 1: Looks good to me, approved
seems harmless.
-- To view, visit http://gerrit.ovirt.org/9783 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I3b8507f3c5f1e1d2712a37fba0162c9aaf56c3a3 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
vdsm-patches@lists.fedorahosted.org