def preprocess_hostOS_OS_shutdown(parser): """ preprocess hostOS OS shutdown """ if not FTOS.is_shutdown(parser["HostOS_name"]): if FTOS.is_running(parser["HostOS_name"]): status = FTOS.shutdown(parser["HostOS_name"]) if status != "success": raise TA_error.Preprocess_Error("HostOS OS shutdown command fail") time.sleep(float(parser["pre_hostOS_shutdown_time"])) if not FTOS.is_shutdown(parser["HostOS_name"]): raise TA_error.Preprocess_Error("HostOS OS can not shutdown")
def preprocess_hostOS_OS_shutdown(parser): """ preprocess hostOS OS shutdown part :called func: preprocess_hostOS_OS :param parser: is a dict, get from Test config file """ if not FTOS.is_shutdown(parser["PrimaryOS_name"]): #若host不為關機狀態 if FTOS.is_running(parser["PrimaryOS_name"]): status = FTOS.shutdown(parser["PrimaryOS_name"]) if status != "success": raise TA_error.Preprocess_Error( "PrimaryOS OS shutdown command fail") time.sleep(float(parser["pre_hostOS_shutdown_time"])) if not FTOS.is_shutdown(parser["PrimaryOS_name"]): raise TA_error.Preprocess_Error("PrimaryOS OS can not shutdown")
def preprocess_backupOS_OS_boot(parser): """ preprocess backupOS OS boot """ if not FTOS.is_running(parser["BackupOS_name"]): if FTOS.is_shutdown(parser["BackupOS_name"]): status = FTOS.boot(parser["BackupOS_name"]) if status != "success": raise TA_error.Preprocess_Error("BackupOS OS boot command fail") time.sleep(float(parser["pre_backupOS_boot_time"])) if not FTOS.is_running(parser["BackupOS_name"]): raise TA_error.Preprocess_Error("BackupOS OS can not boot")
def preprocess_backupOS_OS_boot(parser): """ preprocess backupOS OS boot :called func: preprocess_hostOS_OS :param parser: is a dict, get from Test config file """ if not FTOS.is_running(parser["BackupOS_name"]): if FTOS.is_shutdown(parser["BackupOS_name"]): status = FTOS.boot(parser["BackupOS_name"]) if status != "success": raise TA_error.Preprocess_Error( "BackupOS OS boot command fail") time.sleep(float(parser["pre_backupOS_boot_time"])) if not FTOS.is_running(parser["BackupOS_name"]): raise TA_error.Preprocess_Error("BackupOS OS can not boot")