Пример #1
0
 def resume(self, on=None):
     xenrt.xrtAssert(self.getPowerState() == xenrt.PowerState.suspended,
                     "Power state before resume down must be suspended")
     self.toolstack.resumeInstance(self, on)
     self.os.waitForBoot(60)
     xenrt.xrtCheck(self.getPowerState() == xenrt.PowerState.up,
                    "Power state after resume should be up")
Пример #2
0
 def stop(self, force=False, osInitiated=False):
     xenrt.xrtAssert(self.getPowerState() == xenrt.PowerState.up, "Power state before shutting down must be up")
     if osInitiated:
         self.os.shutdown()
         self._osParent_pollPowerState(xenrt.PowerState.down)
     else:
         self.toolstack.stopInstance(self, force)
     xenrt.xrtCheck(self.getPowerState() == xenrt.PowerState.down, "Power state after shutdown should be down")
Пример #3
0
 def migrate(self, to, live=True):
     xenrt.xrtAssert(self.getPowerState() == xenrt.PowerState.up,
                     "Power state before migrate must be up")
     self.toolstack.migrateInstance(self, to, live)
     self.os.waitForBoot(60)
     xenrt.xrtCheck(self.getPowerState() == xenrt.PowerState.up,
                    "Power state after migrate should be up")
     xenrt.xrtCheck(self.residentOn == to,
                    "Resident on after migrate should be %s" % to)
Пример #4
0
 def reboot(self, force=False, timeout=600, osInitiated=False):
     xenrt.xrtAssert(self.getPowerState() == xenrt.PowerState.up, "Power state before rebooting must be up")
     if osInitiated:
         self.os.reboot()
         xenrt.sleep(120)
     else:
         self.toolstack.rebootInstance(self, force)
     self.os.waitForBoot(timeout)
     xenrt.xrtCheck(self.getPowerState() == xenrt.PowerState.up, "Power state after reboot should be up")
Пример #5
0
 def stop(self, force=False, osInitiated=False):
     xenrt.xrtAssert(self.getPowerState() == xenrt.PowerState.up,
                     "Power state before shutting down must be up")
     if osInitiated:
         self.os.shutdown()
         self._osParent_pollPowerState(xenrt.PowerState.down)
     else:
         self.toolstack.stopInstance(self, force)
     xenrt.xrtCheck(self.getPowerState() == xenrt.PowerState.down,
                    "Power state after shutdown should be down")
Пример #6
0
 def reboot(self, force=False, timeout=600, osInitiated=False):
     xenrt.xrtAssert(self.getPowerState() == xenrt.PowerState.up,
                     "Power state before rebooting must be up")
     if osInitiated:
         self.os.reboot()
         xenrt.sleep(120)
     else:
         self.toolstack.rebootInstance(self, force)
     self.os.waitForBoot(timeout)
     xenrt.xrtCheck(self.getPowerState() == xenrt.PowerState.up,
                    "Power state after reboot should be up")
Пример #7
0
 def suspend(self):
     xenrt.xrtAssert(self.getPowerState() == xenrt.PowerState.up,
                     "Power state before suspend down must be up")
     self.toolstack.suspendInstance(self)
     xenrt.xrtCheck(self.getPowerState() == xenrt.PowerState.suspended,
                    "Power state after suspend should be suspended")
Пример #8
0
 def toolstackStart(self, on=None):
     xenrt.xrtAssert(self.getPowerState() == xenrt.PowerState.down,
                     "Power state before starting must be down")
     self.toolstack.startInstance(self, on)
     xenrt.xrtCheck(self.getPowerState() == xenrt.PowerState.up,
                    "Power state after start should be up")
Пример #9
0
 def migrate(self, to, live=True):
     xenrt.xrtAssert(self.getPowerState() == xenrt.PowerState.up, "Power state before migrate must be up")
     self.toolstack.migrateInstance(self, to, live)
     self.os.waitForBoot(60)
     xenrt.xrtCheck(self.getPowerState() == xenrt.PowerState.up, "Power state after migrate should be up")
     xenrt.xrtCheck(self.residentOn == to, "Resident on after migrate should be %s" % to)
Пример #10
0
 def resume(self, on=None):
     xenrt.xrtAssert(self.getPowerState() == xenrt.PowerState.suspended, "Power state before resume down must be suspended")
     self.toolstack.resumeInstance(self, on)
     self.os.waitForBoot(60)
     xenrt.xrtCheck(self.getPowerState() == xenrt.PowerState.up, "Power state after resume should be up")
Пример #11
0
 def suspend(self):
     xenrt.xrtAssert(self.getPowerState() == xenrt.PowerState.up, "Power state before suspend down must be up")
     self.toolstack.suspendInstance(self)
     xenrt.xrtCheck(self.getPowerState() == xenrt.PowerState.suspended, "Power state after suspend should be suspended")
Пример #12
0
 def toolstackStart(self, on=None):
     xenrt.xrtAssert(self.getPowerState() == xenrt.PowerState.down, "Power state before starting must be down")
     self.toolstack.startInstance(self, on)
     xenrt.xrtCheck(self.getPowerState() == xenrt.PowerState.up, "Power state after start should be up")