Change in vdsm[master]: add simple VM creation functional test

zhshzhou at linux.vnet.ibm.com zhshzhou at linux.vnet.ibm.com
Wed Aug 29 05:19:02 UTC 2012


Zhou Zheng Sheng has posted comments on this change.

Change subject: add simple VM creation functional test
......................................................................


Patch Set 5: (4 inline comments)

Dan, thanks for the advice. I see your patch, it's good. It will be fine that my patch can reuse the framework created in your patch.

....................................................
File tests/functional/vmTests.py
Line 28: from vdsm import vdscli
Line 29: from vdsm.config import config
Line 30: 
Line 31: 
Line 32: def assertVdsOK(vdsResult):
Fine, I can use that assertTrue function in assertVdsOK function.
Line 33:     # code == 0 means OK
Line 34:     if vdsResult['status']['code']:
Line 35:         raise Exception(vdsResult['status']['message'])
Line 36:     return vdsResult


Line 35:         raise Exception(vdsResult['status']['message'])
Line 36:     return vdsResult
Line 37: 
Line 38: 
Line 39: class vmTests(TestCaseBase):
Done
Line 40:     @testValidation.ValidateRunningAsRoot
Line 41:     def setUp(self):
Line 42:         if not config.getboolean('vars', 'xmlrpc_enable'):
Line 43:             raise SkipTest("XML-RPC Bindings are disabled")


Line 54:                 'kernel': kernelPath,
Line 55:                 # Fedora uses dracut to create initramfs. The following
Line 56:                 # arguments will be interpreted by init scripts created by
Line 57:                 # dracut.
Line 58:                 'kernelArgs': 'rd.break=cmdline rd.shell rd.skipfsck',
RHEL6 uses initrd. There are some differences between initrd and initramfs. I will try to make the test also work with initrd. If RHEL6 repo hosts the dracut package, we can generate a initramfs in RHEL6 on demand, so we can just continue to use initramfs.
Line 59:                 'kvmEnable': 'true',
Line 60:                 'memSize': '256',
Line 61:                 'vmId': vmid,
Line 62:                 'vmName': 'vdsm_testVM',


Line 72:             guestUp = False
Line 73:             while True:
Line 74:                 vmUp = self.isVMUp(vmid)
Line 75:                 if vmUp:
Line 76:                     guestUp = self.isGuestUp(vmid)
I do not put the guest agent into the guest. In fact, in vdsm/vm.py, if we read Vm.getStats definition, there is a variable definition "GUEST_WAIT_TIMEOUT = 60".

VDSM thinks if the VM is up, it is in "Powering Up" state, then after GUEST_WAIT_TIMEOUT seconds, VDSM thinks it is in "Up" state.

So I just wait for some time for VDSM to report the guest state, and since GUEST_WAIT_TIMEOUT is not exported, I use the magic number 65.

I also plan to add storage and network related tests using initramfs. We need to generate custom initramfs to do these tests. There is a tool named dracut in F17 repo can do this for us. I can write a script to generate a custom initramfs using dracut. If the dependency of the guest agent is small, we can put the guest agent into initramfs as well.
Line 77:                 if guestUp:
Line 78:                     break
Line 79:                 now = time.time()
Line 80:                 if now - start > timeout:


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Icb0d86ce20a547ef809d5407fe12d6ade474c4d2
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Deepak C Shetty <deepakcs at linux.vnet.ibm.com>
Gerrit-Reviewer: Gal Hammer <ghammer at redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Royce Lv <lvroyce at linux.vnet.ibm.com>
Gerrit-Reviewer: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
Gerrit-Reviewer: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list