def detect_fail_os_crash(parser): """ FTsystem find fail and fail is vm crash or not return True/raise exception """ if mmsh.infofail(parser["vm_name"]) == "vm os crash": return True raise TA_error.Assert_Error("VM (name : %s) has not detect vm os crash" % parser["vm_name"])
def detect_no_fail(parser): """ FTsystem find no fail or not return True/raise exception """ if mmsh.infofail(parser["vm_name"]) == "no fail": return True raise TA_error.Assert_Error("VM (name : %s) has fail on hostOS" % parser["vm_name"])
def detect_fail_vm_crash(parser): """ FTsystem find fail and fail is vm crash or not return True/raise exception """ if "ast_vm_crash_time" in parser.keys(): time.sleep(int(parser["ast_vm_crash_time"])) if mmsh.infofail(parser["vm_name"]) == "vm crash": return True raise TA_error.Assert_Error("VM (name : %s) has not detect vm crash on hostOS" % parser["vm_name"])
def detect_no_fail(parser): """ FTsystem find no fail or not :param parser: config :return: True/raise exception """ ssh = shell_server.get_ssh(parser["PrimaryOS_ip"], parser["PrimaryOS_usr"], parser["PrimaryOS_pwd"]) #獲取ssh if mmsh.infofail(parser["vm_name"], ssh) == "no fail": return True raise TA_error.Assert_Error("VM (name : %s) has fail in hostOS" % parser["vm_name"])
def detect_fail_os_crash(parser): """ FTsystem find fail and fail is os crash or not :param parser: config :return: True/raise exception """ ssh = shell_server.get_ssh(parser["PrimaryOS_ip"], parser["PrimaryOS_usr"], parser["PrimaryOS_pwd"]) #獲取ssh if mmsh.infofail(parser["vm_name"], ssh) == "vm os crash": return True raise TA_error.Assert_Error("VM (name : %s) has not detect vm os crash" % parser["vm_name"])
def detect_fail_vm_crash(parser): """ FTsystem find fail and fail is vm crash or not :param parser: config :return: True/raise exception """ ssh = shell_server.get_ssh(parser["PrimaryOS_ip"], parser["PrimaryOS_usr"], parser["PrimaryOS_pwd"]) #獲取ssh print 558 if "ast_vm_crash_time" in parser.keys( ): #若參數ast_vm_crash_time存在於parser,則進入 time.sleep(int(parser["ast_vm_crash_time"])) if mmsh.infofail(parser["vm_name"], ssh) == "vm crash": ssh.close() return True ssh.close() raise TA_error.Assert_Error( "VM (name : %s) has not detect vm crash in hostOS" % parser["vm_name"])