def postprocess_nodes(parser): if parser["pos_check_primaryOS_status"] == "yes": if not FTOS.OS_is_running(parser["PrimaryOS_ip"], parser): postprocess_primaryOS_running(parser) if parser["pos_check_backupOS_status"] == "yes": if not FTOS.OS_is_running(parser["BackupOS_ip"], parser): postprocess_backupOS_running(parser) if parser["pos_check_slaveOS_status"] == "yes": if not FTOS.OS_is_running(parser["SlaveOS_ip"], parser): postprocess_slaveOS_running(parser)
def preprocess_NFS_OS(parser): if FTOS.OS_is_running(parser["NFS_ip"], parser) == False: #FTOS.L1_boot(parser["NFS_NetworkAdaptor"]) if FTOS.OS_is_running(parser["NFS_ip"], parser) == False: raise TA_error.Preprocess_Error("NFS node can not start") if FTOS.ssh_is_ready(parser["NFS_ip"], parser["NFS_usr"], parser["NFS_pwd"], parser) == False: raise TA_error.Preprocess_Error("NFS node ssh can not access") ssh = shell_server.get_ssh(parser["NFS_ip"], parser["NFS_usr"], parser["NFS_pwd"]) #獲得ssh
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")
def postprocess_NFS_OS_reboot(parser): """ when test case done , Host OS reboot :param parser: is a dict, get from Test config file """ ssh = shell_server.get_ssh(parser["NFS_ip"], parser["NFS_usr"], parser["NFS_pwd"]) #獲得ssh if FTOS.OS_is_running(parser["NFS_ip"], parser): FTOS.reboot(ssh)
def postprocess_Host_OS_reboot(parser): """ post process host os part :param parser: is a dict, get from Test config file """ ssh = shell_server.get_ssh(parser["PrimaryOS_ip"], parser["PrimaryOS_usr"], parser["PrimaryOS_pwd"]) #獲得ssh if not FTVM.is_shutoff(parser["vm_name"], parser["PrimaryOS_ip"], ssh): raise TA_error.Postprocess_Error( "vm %s in PrimaryOS cannot shutdown " % parser["vm_name"]) if parser["pos_hostOS_restart"] == "yes": if FTOS.OS_is_running(parser["PrimaryOS_ip"], parser): FTOS.reboot(ssh)
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")