def run_ft_libvirt_crash(parser):
    """
	test ft libivrt crash
	"""
    preprocess.preprocess(parser)
    process.kill_libvirt_process(parser)
    Assert.libvirt_running_in_hostOS(parser)
def run_L1_k_libv_vm_7_crash(parser):
    """
	test after ftlibvirt recover, ftlibvirt will detect vm crash or not
	"""
    preprocess.preprocess(parser)

    for i in range(3):
        process.kill_libvirt_process(parser)
        print 110
        Assert.libvirt_running_in_hostOS(parser)
        print 111
        print "Start killing  process"
        start_time = time.time()
        last_end = start_time
        time.sleep(50)
        for i in range(1 + 3 * i):
            print 112
            process.kill_vm_process(parser)
            print 113
            Assert.vm_running_in_hostOS(parser)
            print 114
            Assert.vm_is_login_in_hostOS(parser)
            print 115
            Assert.detect_fail_vm_crash(parser)
            print 116
            Assert.recovery_vm_p_restart(parser)
            print 117
            end_time = time.time()
            print "[%f] %dth time kill VM process, ellapsed time %f" % (
                end_time - start_time, i, end_time - last_end)
            last_end = end_time
def run_L1_k_libv_vm_crash(parser):
    """
	test after ftlibvirt recover, ftlibvirt will detect vm crash or not
	"""
    preprocess.preprocess(parser)

    process.kill_libvirt_process(parser)
    Assert.libvirt_running_in_hostOS(parser)

    time.sleep(50)
    process.kill_vm_process(parser)
    Assert.vm_running_in_hostOS(parser)
    Assert.vm_is_login_in_hostOS(parser)
    Assert.detect_fail_vm_crash(parser)
    Assert.recovery_vm_p_restart(parser)
def run_HA3_primary_libvirtk_ftvm_crash(parser):

    preprocess.run_preprocess(parser)
    print 110
    process.kill_libvirt_process(parser)
    print 111
    Assert.libvirt_running_in_hostOS(parser)
    print 112
    process.kill_vm_process(parser)
    print 113
    Assert.vm_recover_in_primaryOS(parser)
    print 114
    #Assert.detect_fail_os_crash(parser)
    print 115
    #Assert.recovery_vm_reboot(parser)
    print 116
    Assert.detect_primary_vm_crash_info(parser)