Exemplo n.º 1
0
def test_dummy_in_process(uuid, box, process_wait_time):
    ret = False
    with kill_vm_and_keys_on_enter_and_exit(uuid, box):
        p = Process(target=test_dummy, args=(uuid, box))
        p.start()
        p.join(process_wait_time)
        if p.is_alive():
            log_string(uuid, "Process time out, PID: {}".format(p.pid), "Red")
            pProcess(p.pid).kill()
        else:
            if p.exitcode == True:
                log_string(uuid, "test_dummy_in_process finished successfully",
                           "Green")
                ret = True
            else:
                log_string(
                    uuid,
                    "test_dummy_in_process finished with errors, exit code False",
                    "Red")
    return ret
Exemplo n.º 2
0
def analyze_input_wrapper_in_process(uuid, box, task, actions_list,
                                     process_wait_time):
    ret = False
    chrome_ouput, screen_recorder = None, None
    with kill_vm_on_enter_and_exit(uuid, box):
        p = Process(target=analyze_input_in_vm, args=(uuid, box, actions_list))
        p.start()
        p.join(process_wait_time)
        if p.is_alive():
            log_string(uuid, "Process time out, PID: {}".format(p.pid), "Red")
            pProcess(p.pid).kill()
        else:
            if p.exitcode == True:
                log_string(uuid, "custom_task finished successfully", "Green")
                ret = True
            else:
                log_string(
                    uuid, "custom_task finished with errors, exit code False",
                    "Red")
    return ret