Beispiel #1
0
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")
Beispiel #2
0
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")