Royce Lv has uploaded a new change for review.
Change subject: add rollback to _runVMKernelBootTemplate
......................................................................
add rollback to _runVMKernelBootTemplate
This will enable us checking status of VM after it starts up.
Change-Id: I497d36bb051d904ae1e43bc8f565707f411a3851
Signed-off-by: Royce Lv<lvroyce(a)linux.vnet.ibm.com>
---
M tests/functional/xmlrpcTests.py
1 file changed, 10 insertions(+), 10 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/19/12819/1
diff --git a/tests/functional/xmlrpcTests.py b/tests/functional/xmlrpcTests.py
index b9ec45b..3eb65e4 100644
--- a/tests/functional/xmlrpcTests.py
+++ b/tests/functional/xmlrpcTests.py
@@ -166,9 +166,10 @@
customization = {'vmId': '77777777-ffff-3333-bbbb-222222222222',
'vmName': 'vdsm_testSmallVM'}
- self._runVMKernelBootTemplate(customization)
+ with RollbackContext() as rollback:
+ self._runVMKernelBootTemplate(rollback, customization)
- def _runVMKernelBootTemplate(self, vmDef={}, distro='fedora'):
+ def _runVMKernelBootTemplate(self, rollback, vmDef={}, distro='fedora'):
kernelArgsDistro = {
# Fedora: The initramfs is generated by dracut. The following
# arguments will be interpreted by init scripts created by dracut.
@@ -196,14 +197,13 @@
template.update(
{'kernel': kernelPath,
'initrd': initramfsPath})
- try:
- self.assertVdsOK(self.s.create(template))
- # wait 65 seconds for VM to come up until timeout
- self.retryAssert(assertVMAndGuestUp, timeout=65)
- finally:
- destroyResult = self.s.destroy(vmid)
- self.assertVdsOK(destroyResult)
+ self.assertVdsOK(self.s.create(template))
+ # wait 65 seconds for VM to come up until timeout
+ self.retryAssert(assertVMAndGuestUp, timeout=65)
+ undo = lambda vmid=vmid: \
+ self.assertVdsOK(self.s.destroy(vmid))
+ rollback.prependDefer(undo)
@permutations([['localfs'], ['iscsi'], ['glusterfs']])
def testStorage(self, backendType):
@@ -235,7 +235,7 @@
with RollbackContext() as rollback:
self._createVdsmStorageLayout(conf, rollback)
- self._runVMKernelBootTemplate(customization)
+ self._runVMKernelBootTemplate(rollback, customization)
def _createVdsmStorageLayout(self, conf, rollback):
backendServer = conf['server'](self.s, self)
--
To view, visit
http://gerrit.ovirt.org/12819
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I497d36bb051d904ae1e43bc8f565707f411a3851
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Royce Lv <lvroyce(a)linux.vnet.ibm.com>