Esempio n. 1
0
def preprocess_slave_OS(parser):
    """
    preprocess  , Host os part , check slave node is booted
    :param parser : is a dict , get from test config file
    """
    if FTOS.OS_is_running(parser["SlaveOS_ip"], parser) == False:
        if parser["IPMI_supported"] == "yes":
            ssh = shell_server.get_ssh(parser["PrimaryOS_ip"],
                                       parser["PrimaryOS_usr"],
                                       parser["PrimaryOS_pwd"])  #獲得ssh
            FTOS.IPMI_boot(parser["SlaveOS_ipmb"], ssh)
            ssh.close()
        elif parser["IPMI_supported"] == "no":
            FTOS.L1_boot(parser["SlaveOS_NetworkAdaptor"])
    if FTOS.OS_is_running(parser["SlaveOS_ip"], parser) == False:
        raise TA_error.Preprocess_Error("SlaveOS node cannot boot")
    if FTOS.ssh_is_ready(parser["SlaveOS_ip"], parser["SlaveOS_usr"],
                         parser["SlaveOS_pwd"], parser) == False:
        raise TA_error.Preprocess_Error("Slave node ssh can not access")
Esempio n. 2
0
def postprocess_slaveOS_running(parser):
    """
	postrocess slave OS become running

	:called func: postprocess_hostOS
	:param parser: is a dict, get from Test config file
	"""
    if parser["pos_check_slaveOS_status"] == "yes":
        if parser["IPMI_supported"] == "yes":
            ssh = shell_server.get_ssh(parser["PrimaryOS_ip"],
                                       parser["PrimaryOS_usr"],
                                       parser["PrimaryOS_pwd"])  #獲得ssh
            FTOS.IPMI_boot(parser["SlaveOS_ipmb"], ssh)
            ssh.close()
        elif parser["IPMI_supported"] == "no":
            FTOS.L1_boot(parser["SlaveOS_NetworkAdaptor"])
    if FTOS.OS_is_running(parser["SlaveOS_ip"], parser):
        return True
    raise TA_error.Postprocess_Error("slave OS can not boot")