Exemple #1
0
def recovery_vm_reboot(parser):
	"""
	FTsystem recover vm reboot or not

	return True/raise exception
	"""
	if mmsh.inforecover(parser["vm_name"]) == "vm reboot":
		return True
	raise TA_error.Assert_Error("VM (name : %s) has no recovery : vm reboot" % parser["vm_name"])
Exemple #2
0
def no_recovery(parser):
	"""
	FTsystem no recover or not

	return True/raise exception
	"""
	if mmsh.inforecover(parser["vm_name"]) == "no recover":
		return True
	raise TA_error.Assert_Error("VM (name : %s) has recovery" % parser["vm_name"])
Exemple #3
0
def recovery_vm_p_restart(parser):
	"""
	FTsystem recover vm process restart or not

	return True/raise exception
	"""
	if "ast_vm_p_restart_time" in parser.keys():
		time.sleep(int(parser["ast_vm_p_restart_time"]))
	if mmsh.inforecover(parser["vm_name"]) == "vm process restart":
		return True
	raise TA_error.Assert_Error("VM (name : %s) has no recovery : vm process restart" % parser["vm_name"])
Exemple #4
0
def recovery_vm_reboot(parser):
    """
	FTsystem recover vm reboot 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.inforecover(parser["vm_name"], ssh) == "vm reboot":
        return True
    raise TA_error.Assert_Error("VM (name : %s) has no recovery : vm reboot" %
                                parser["vm_name"])
Exemple #5
0
def recovery_vm_p_restart(parser):
    """
	FTsystem recover vm process restart 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 "ast_vm_p_restart_time" in parser.keys(
    ):  #若參數ast_vm_p_restart_time存在於parser,則進入
        time.sleep(int(parser["ast_vm_p_restart_time"]))
    if mmsh.inforecover(parser["vm_name"], ssh) == "vm process restart":
        return True
    raise TA_error.Assert_Error(
        "VM (name : %s) has no recovery : vm process restart" %
        parser["vm_name"])
Exemple #6
0
def recovery_vm_reboot(parser):
	"""
	FTsystem recover vm reboot or not

	return True/raise exception
	"""
	if mmsh.inforecover(parser["vm_name"]) == "vm reboot":
		return True
	raise TA_error.Assert_Error("VM (name : %s) has no recovery : vm reboot" % parser["vm_name"])

def libvirt_running_in_hostOS(parser):
	"""
	libvirt process is running in hostOS or not

	return True/raise exception

	"""
	pass

def master_monitor_running():
	"""
	master monitor running or not

	return True/raise exception
	"""
	pass

if __name__ == '__main__':
	print mmsh.inforecover("VM1")