예제 #1
0
파일: Assert.py 프로젝트: vaporting/FTVM_TA
def detect_fail_os_crash(parser):
	"""
	FTsystem find fail and fail is vm crash or not

	return True/raise exception
	"""
	if mmsh.infofail(parser["vm_name"]) == "vm os crash":
		return True
	raise TA_error.Assert_Error("VM (name : %s) has not detect vm os crash" % parser["vm_name"])
예제 #2
0
파일: Assert.py 프로젝트: vaporting/FTVM_TA
def detect_no_fail(parser):
	"""
	FTsystem find no fail or not

	return True/raise exception
	"""
	if mmsh.infofail(parser["vm_name"]) == "no fail":
		return True
	raise TA_error.Assert_Error("VM (name : %s) has fail on hostOS" % parser["vm_name"])
예제 #3
0
파일: Assert.py 프로젝트: vaporting/FTVM_TA
def detect_fail_vm_crash(parser):
	"""
	FTsystem find fail and fail is vm crash or not

	return True/raise exception
	"""
	if "ast_vm_crash_time" in parser.keys():
		time.sleep(int(parser["ast_vm_crash_time"]))
	if mmsh.infofail(parser["vm_name"]) == "vm crash":
		return True
	raise TA_error.Assert_Error("VM (name : %s) has not detect vm crash on hostOS" % parser["vm_name"])
예제 #4
0
def detect_no_fail(parser):
    """
	FTsystem find no fail 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.infofail(parser["vm_name"], ssh) == "no fail":
        return True
    raise TA_error.Assert_Error("VM (name : %s) has fail in hostOS" %
                                parser["vm_name"])
예제 #5
0
def detect_fail_os_crash(parser):
    """
	FTsystem find fail and fail is os crash 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.infofail(parser["vm_name"], ssh) == "vm os crash":
        return True
    raise TA_error.Assert_Error("VM (name : %s) has not detect vm os crash" %
                                parser["vm_name"])
예제 #6
0
def detect_fail_vm_crash(parser):
    """
	FTsystem find fail and fail is vm crash or not
	:param parser: config
	:return: True/raise exception
	"""
    ssh = shell_server.get_ssh(parser["PrimaryOS_ip"], parser["PrimaryOS_usr"],
                               parser["PrimaryOS_pwd"])  #獲取ssh
    print 558
    if "ast_vm_crash_time" in parser.keys(
    ):  #若參數ast_vm_crash_time存在於parser,則進入
        time.sleep(int(parser["ast_vm_crash_time"]))
    if mmsh.infofail(parser["vm_name"], ssh) == "vm crash":
        ssh.close()
        return True
    ssh.close()
    raise TA_error.Assert_Error(
        "VM (name : %s) has not detect vm crash in hostOS" % parser["vm_name"])