res = session.xenapi.VM.get_power_state(vm_uuid)

if res != XendAPIConstants.XEN_API_VM_POWER_STATE[XendAPIConstants.XEN_API_VM_POWER_STATE_RUNNING]:
    FAIL("VM could not be put into 'running' state")

console = domain.getConsole()

try:
    run = console.runCmd("cat /proc/interrupts")
except ConsoleError, e:
    saveLog(console.getHistory())
    FAIL("Could not access proc-filesystem")

res = session.xenapi.VM.pause(vm_uuid)

res = session.xenapi.VM.get_power_state(vm_uuid)

if res != XendAPIConstants.XEN_API_VM_POWER_STATE[XendAPIConstants.XEN_API_VM_POWER_STATE_PAUSED]:
    FAIL("VM could not be put into 'paused' state")

res = session.xenapi.VM.unpause(vm_uuid)

res = session.xenapi.VM.get_power_state(vm_uuid)

if res != XendAPIConstants.XEN_API_VM_POWER_STATE[XendAPIConstants.XEN_API_VM_POWER_STATE_RUNNING]:
    FAIL("VM could not be 'unpaused'")

domain.stop()
domain.destroy()
print "policystate %s" % policystate

if int(policystate['xserr']) == 0:
    FAIL("(6) Should not have been able to set this policy.")

#
# End the test by installing the initial policy again
#

cur_version = hdr['version']
(maj, min) = cur_version.split(".")
cur_version = "%s.%s" % (maj, str(int(min)-1) )

orig_acmpol = ACMPolicy(xml=xml_good)
orig_acmpol.set_frompolicy_version(cur_version)
orig_acmpol.set_policy_version(hdr['version'])

policystate = session.xenapi.XSPolicy.set_xspolicy(xsconstants.XS_POLICY_ACM,
                                                   orig_acmpol.toxml(),
                                                   xsconstants.XS_INST_LOAD,
                                                   True)

if int(policystate['xserr']) != 0:
    FAIL("(END) Should have been able to set this policy.")

domain1.stop()
domain2.stop()
domain1.destroy()
domain2.destroy()
Exemplo n.º 3
0
res = session.xenapi.VBD.get_device(vbd_ref)
print "VBD device: %s" % res
if res != vbd_rec['device']:
    session.xenapi.VDI.destroy(vdi_ref)
    FAIL("VBD_get_device returned wrong result")

res = session.xenapi.VM.get_VBDs(vm_uuid)
if vbd_ref not in res:
    session.xenapi.VDI.destroy(vdi_ref)
    FAIL("VM_get_VBDS does not show created VBD")

rc = domain.start()

console = domain.getConsole()

try:
    run = console.runCmd("cat /proc/interrupts")
except ConsoleError, e:
    saveLog(console.getHistory())
    session.xenapi.VDI.destroy(vdi_ref)
    FAIL("Could not access proc-filesystem")

domain.stop()
domain.destroy()

session.xenapi.VDI.destroy(vdi_ref)

res = session.xenapi.SR.get_VDIs(sr_uuid[0])
if vdi_ref in res:
    FAIL("SR_get_VDI still shows deleted VDI")
Exemplo n.º 4
0
print "policystate %s" % policystate

if int(policystate['xserr']) == 0:
    FAIL("(6) Should not have been able to set this policy.")

#
# End the test by installing the initial policy again
#

cur_version = hdr['version']
(maj, min) = cur_version.split(".")
cur_version = "%s.%s" % (maj, str(int(min) - 1))

orig_acmpol = ACMPolicy(xml=xml_good)
orig_acmpol.set_frompolicy_version(cur_version)
orig_acmpol.set_policy_version(hdr['version'])

policystate = session.xenapi.XSPolicy.set_xspolicy(xsconstants.XS_POLICY_ACM,
                                                   orig_acmpol.toxml(),
                                                   xsconstants.XS_INST_LOAD,
                                                   True)

if int(policystate['xserr']) != 0:
    FAIL("(END) Should have been able to set this policy.")

domain1.stop()
domain2.stop()
domain1.destroy()
domain2.destroy()