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 <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Deepak C Shetty <[email protected]>
Gerrit-Reviewer: Gal Hammer <[email protected]>
Gerrit-Reviewer: Mark Wu <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Royce Lv <[email protected]>
Gerrit-Reviewer: ShaoHe Feng <[email protected]>
Gerrit-Reviewer: Zhou Zheng Sheng <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches