def applyKIDSPatchSequence(self, numOfPatches = 1, restart = True): totalPatch = len(self._outPatchList) numOfPatch = 1 if re.match("All", str(numOfPatches), re.IGNORECASE): numOfPatch = totalPatch else: numOfPatch = int(numOfPatches) restartCache = False taskmanUtil = VistATaskmanUtil() """ make sure taskman is running """ taskmanUtil.startTaskman(self._testClient) for index in range(0,min(totalPatch, numOfPatch)): patchInfo = self._outPatchList[index] """ double check to see if patch is already installed """ if self.__isPatchInstalled__(patchInfo): continue if not self.__isPatchReadyToInstall__(patchInfo): break """ generate Sha1 Sum for patch Info """ self.generateSha1SumForPatchInfo(patchInfo) """ install the KIDS patch """ result = self.__installKIDSPatch__(patchInfo) if not result: logger.error("Failed to install patch %s: KIDS %s" % (patchInfo.installName, patchInfo.kidsFilePath)) return else: # also need to reload the package patch hist self.__reloadPackagePatchHistory__(patchInfo) assert self.__isPatchInstalled__(patchInfo) restartCache = True taskmanUtil.waitTaskmanToCurrent(self._testClient) """ restart Cache if needed """ if restart and restartCache and self._testClient.isCache(): self.__restartCache__()
def __stopTaskman__(self, vistATestClient): connection = vistATestClient.getConnection() connection.send("S DUZ=.5 D ^XUP\n") connection.expect("OPTION") connection.send("\n") vistATestClient.waitForPrompt() taskmanUtil = VistATaskmanUtil() taskmanUtil.shutdownAllTasks(vistATestClient)
def installFileMan22_2(testClient, inputROFile): """ Script to initiate FileMan 22.2 """ if not os.path.exists(inputROFile): logger.error("File %s does not exist" % inputROFile) return rFile = inputROFile if isValidRoutineSha1Suffix(inputROFile): rFile = getFileMan22_2RoutineFile(inputROFile) from VistATaskmanUtil import VistATaskmanUtil outDir = None # gtm routine import out dir #allow logon to shutdown taskman via menu inhibitLogons(testClient, flag=False) # stop all taskman tasks taskManUtil = VistATaskmanUtil() logger.info("Stop Taskman...") taskManUtil.stopTaskman(testClient) logger.info("Inhibit logons...") inhibitLogons(testClient) # remove fileman 22.2 affected routines logger.info("Remove FileMan 22 routines") if testClient.isCache(): deleteFileManRoutinesCache(testClient) else: outDir = deleteFileManRoutinesGTM() if not outDir: logger.info("Can not identify mumps routine directory") return outDir = outDir[0] # import routines into System from VistARoutineImport import VistARoutineImport vistARtnImport = VistARoutineImport() logger.info("Import FileMan 22.2 Routines from %s" % rFile) vistARtnImport.importRoutines(testClient, rFile, outDir) # verify integrity of the routines that just imported logger.info("Verify FileMan 22.2 Routines...") verifyRoutines(testClient) # rewrite fileman routines logger.info("Rewrite FileMan 22.2 Routines...") if testClient.isCache(): rewriteFileManRoutineCache(testClient) else: rewriteFileManRoutineGTM(outDir) # initial fileman logger.info("Initial FileMan...") initFileMan(testClient, None, None) logger.info("Initial FileMan 22.2...") initFileMan22_2(testClient) logger.info("Enable logons...") inhibitLogons(testClient, flag=False) """ restart taskman """ logger.info("Restart Taskman...") taskManUtil.startTaskman(testClient)
def __applyKIDSPatchUptoIndex__(self, endIndex): assert endIndex >= 0 and endIndex <= len(self._outPatchList) """ make sure taskman is running """ taskmanUtil = VistATaskmanUtil() taskmanUtil.startTaskman(self._testClient) for index in range(0, endIndex): patchInfo = self._outPatchList[index] result = self.__applyIndividualKIDSPatch__(patchInfo) if not result: logger.error("Failed to install patch %s: KIDS %s" % (patchInfo.installName, patchInfo.kidsFilePath)) return """ wait until taskman is current """ taskmanUtil.waitTaskmanToCurrent(self._testClient)
def __stopTaskman__(self, vistATestClient): taskmanUtil = VistATaskmanUtil() taskmanUtil.shutdownAllTasks(vistATestClient)
def extraFixWork(self, vistATestClient): taskmanUtil = VistATaskmanUtil() taskmanUtil.startTaskman(vistATestClient)
def __gotoKIDSMainMenu__(self, vistATestClient): menuUtil = VistAMenuUtil(self._duz) taskmanUtil = VistATaskmanUtil() taskmanUtil.stopTaskman(vistATestClient) menuUtil.gotoKidsMainMenu(vistATestClient)