def startRecovery(self): vmInst = VM(self.harness) vmGeneral = GeneralActions(self.harness) self.harness.VerifySafely(vmInst.VerifyPowerOffVM(), True, "Power Off VM") self.harness.VerifySafely(vmInst.VerifyDeleteVM(), True, "Delete VM") self.harness.VerifySafely(vmInst.VerifyCloseWorkstation(), True, "Close workstation") vmGeneral.DeleteTestVMDir()
class General(object): def __init__(self, harness): self.harness = harness self.vmInst = VM(self.harness) self.settingsInst = Settings(self.harness) self.snapshot = Snapshot(self.harness) self.generalInst = GeneralActions(self.harness) def endTest(self): self.harness.UpdateTestcaseResult() def startRecovery(self): self.generalInst.DeleteTestVMDir()
class GeneralCase(object): def __init__(self, harness): self.harness = harness self.vmInst = VM(self.harness) self.settingInstance = Settings(self.harness) self.generalInst = GeneralActions(self.harness) def prepareAutoProtectVM(self, testdata): testdata = getTestDataList(testdata) self.vmInst.CreateNewVM(vmName=testdata['vmname']) selectmenuitem(mainWindow, mnuToSnapshotManager) click(snapshotManager, btnAutoProtect) check(vmSettingsWindow, chkEnableAutoProtect) click(vmSettingsWindow, btnOK) click(snapshotManager, btnClose) self.vmInst.CloseWorkstation() self.vmInst.SetVMXValue(self.vmInst.testvmDir, testdata['vmname'], '%s.vmx' % testdata['vmname'], 'rollingTier0.interval', '"60"') self.vmInst.LaunchWorkstation() self.vmInst.PowerOnVM() # loop check if snapshot files exist vmName = testdata['vmname'] status = False counter = 0 timeToCreateFile = 60 while not status and counter <= timeToCreateFile: wait(10) status = os.path.exists("%s/%s/%s-Snapshot1.vmsn" % (self.vmInst.testvmDir, vmName, vmName)) counter += 10 self.harness.VerifySafely(status, True, "Auto-protect files created successfully") self.vmInst.PowerOffVM() def endTest(self): self.harness.UpdateTestcaseResult() def startRecovery(self, testdata): self.generalInst.DeleteTestVMDir()
class GeneralSetup(): def __init__(self, harness): self.harness = harness self.vmInstance = VM(self.harness) self.generalInstance = GeneralActions(self.harness) self.settingsInstance = Settings(self.harness) def startRecovery(self): vmInst = VM(self.harness) vmGeneral = GeneralActions(self.harness) self.harness.VerifySafely(vmInst.VerifyPowerOffVM(), True, "Power Off VM") self.harness.VerifySafely(vmInst.VerifyDeleteVM(), True, "Delete VM") self.harness.VerifySafely(vmInst.VerifyCloseWorkstation(), True, "Close workstation") vmGeneral.DeleteTestVMDir() def endTest(self): self.harness.AddTestComment("Delete VM") self.vmInstance.DeleteVM() self.harness.AddTestComment("Close VMware Workstation") self.vmInstance.CloseWorkstation() self.generalInstance.DeleteTestVMDir() self.harness.UpdateTestcaseResult()
def __init__(self, harness): self.harness = harness self.vmInst = VM(self.harness) self.settingInstance = Settings(self.harness) self.generalInst = GeneralActions(self.harness)
def __init__(self, harness): self.harness = harness self.vmInst = VM(self.harness) self.settingsInst = Settings(self.harness) self.snapshot = Snapshot(self.harness) self.generalInst = GeneralActions(self.harness)