Exemplo n.º 1
0
def stop_during_io(read_or_write):
    global bringup_argument
    for sleep_time in range(5, 10):
        test_name = "STOP During IO" + str(sleep_time)
        common_test_lib.print_start(test_name)
        common_test_lib.bringup_multiple_volume(**bringup_argument)

        process = execute_fio_pipe(readwrite=read_or_write, offset=0, verify="0")
        time.sleep(sleep_time)

        
        pos_util.pci_detach(nvme_device_0)
        print("Device Detached!!!!!")
        time.sleep(sleep_time * 0.1)

        pos_util.pci_detach(nvme_device_1)
        print("Other Device Detached!!!!!")

        ret = process.wait()

        clear_env()

        #fio can failed by floating point 0 issue. it is natural. 
        #if there is no hang issue, just pass.
        common_test_lib.print_result(test_name, True)
Exemplo n.º 2
0
def subsystem_namespace_mapping_test(trtype, traddr, subsystem_cnt,
                                     volume_cnt):
    nvmf = nvmf_common.Nvmf("[ Subsystem-Namespace Mapping ", True,
                            spdk_rpc_path)

    bringup_argument = {
        'log_path': args.log_path,
        'ibof_root': ibof_root,
        'transport': trtype,
        'target_ip': traddr,
        'subsystem_cnt': subsystem_cnt,
        'volume_cnt': volume_cnt,
        'stdout_type': stdout_type
    }

    common_test_lib.bringup_multiple_volume(**bringup_argument)

    map = nvmf.get_subsystem_ns_map()
    ret = nvmf.check_subsystem_ns_mapping(map, "subsystem1", "bdev3")
    success = (ret == True)
    ret = nvmf.check_subsystem_ns_mapping(map, "subsystem3", "bdev3")
    success &= (ret == False)

    common_test_lib.terminate_ibofos(ibof_root, stdout_type)
    common_test_lib.print_result("[ Subsystem-Namespace Mapping Test ]",
                                 success)
    return success
Exemplo n.º 3
0
def run_test():
    test_name = "Watchdog run test"
    common_test_lib.print_start(test_name)
    common_test_lib.clear_env()
    execute_watchdog(deamon=0)
    executed = wait_ibofos_execution()
    common_test_lib.terminate_ibofos(ibof_root, subprocess.DEVNULL)
    common_test_lib.clear_env()
    common_test_lib.print_result(test_name, executed)
    return executed
Exemplo n.º 4
0
def read_out_range_fail_test():
    test_name = "Read out of range"
    common_test_lib.print_start(test_name)
    common_test_lib.bringup_pos(**bringup_argument)

    ret = execute_fio(readwrite="read", offset=volume_size, verify=False)

    common_test_lib.terminate_pos(pos_root, stdout_type)
    success = (ret == 1)
    common_test_lib.print_result(test_name, success)
    return success
Exemplo n.º 5
0
def verify_test():
    test_name = "Verify"
    common_test_lib.print_start(test_name)
    common_test_lib.bringup_pos(**bringup_argument)

    ret = execute_fio(readwrite="write", offset=0, verify=True)

    common_test_lib.terminate_pos(pos_root, stdout_type)
    success = (ret == 0)
    common_test_lib.print_result(test_name, success)
    return success
Exemplo n.º 6
0
def create_transport_test(EXPECT, trtype, b, n):
    nvmf = nvmf_common.Nvmf("[ Create Transport ", EXPECT, spdk_rpc_path)
    common_test_lib.start_ibofos(args.log_path, ibof_root)

    ret = nvmf.create_transport(trtype, b, n)

    common_test_lib.expect_true(ret, "Transport Creation")
    common_test_lib.terminate_ibofos(ibof_root, stdout_type)
    success = (EXPECT == ret)
    common_test_lib.print_result("[ Create Transport Test ]", success)
    return success
Exemplo n.º 7
0
def read_test():
    test_name = "Read"
    common_test_lib.print_start(test_name)
    common_test_lib.bringup_ibofos(**bringup_argument)

    ret = execute_fio(readwrite="read", offset=0, verify=False)

    common_test_lib.terminate_ibofos(ibof_root, stdout_type)
    success = (ret == 0)
    common_test_lib.print_result(test_name, success)
    return success
Exemplo n.º 8
0
def create_subsystem_test(EXPECT, nqn, serial_num, model_num, max_ns,
                          allow_any_host):
    nvmf = nvmf_common.Nvmf("[ Create Subsystem ", EXPECT, spdk_rpc_path)
    common_test_lib.start_ibofos(args.log_path, ibof_root)

    ret = nvmf.create_subsystem(nqn, serial_num, model_num, max_ns,
                                allow_any_host)

    common_test_lib.expect_true(ret, "Subsystem Creation")
    common_test_lib.terminate_ibofos(ibof_root, stdout_type)
    success = (EXPECT == ret)
    common_test_lib.print_result("[ Create Subsystem Test ]", success)
    return success
Exemplo n.º 9
0
def log_path_test():
    test_name = "Log path test"
    common_test_lib.print_start(test_name)
    common_test_lib.clear_env()
    log_file_name = "watchdog_test.log"
    execute_watchdog(deamon=1, log_path=log_file_name)
    wait_deamonize()
    found = find_log_file(log_file_name)
    common_test_lib.terminate_ibofos(ibof_root, subprocess.DEVNULL)
    common_test_lib.clear_env()
    success = (found == True)
    common_test_lib.print_result(test_name, success)
    return success
Exemplo n.º 10
0
def delete_subsystem_test(EXPECT, nqn, allow_any_host):
    nvmf = nvmf_common.Nvmf("[ Delete Subsystem ", EXPECT, spdk_rpc_path)
    common_test_lib.start_ibofos(args.log_path, ibof_root)

    ret = nvmf.create_subsystem("nqn.2019-04.ibof:subsystem1",\
            "IBOF00000000000001","IBOF_VOLUME_EXTENTION", "256", allow_any_host)
    common_test_lib.expect_true(ret, "Subsystem Creation")

    ret = nvmf.delete_subsystem(nqn)

    common_test_lib.expect_true(ret, "Subsystem Deletion")
    common_test_lib.terminate_ibofos(ibof_root, stdout_type)
    success = (EXPECT == ret)
    common_test_lib.print_result("[ Delete Subsystem Test ]", success)
    return success
Exemplo n.º 11
0
def add_subsystem_listener_test(EXPECT, nqn, trtype, traddr, trsvid,
                                allow_any_host):
    nvmf = nvmf_common.Nvmf("[ Add Subsystem Listener ", EXPECT, spdk_rpc_path)
    common_test_lib.start_ibofos(args.log_path, ibof_root)

    ret = nvmf.create_transport(trtype, "64", "2048")
    common_test_lib.expect_true(ret, "Transport Creation")

    ret = nvmf.create_subsystem("nqn.2019-04.ibof:subsystem1",\
            "IBOF00000000000001","IBOF_VOLUME_EXTENTION", "256", allow_any_host)
    common_test_lib.expect_true(ret, "Subsystem Creation")

    ret = nvmf.add_subsystem_listener(nqn, trtype, traddr, trsvid)

    common_test_lib.expect_true(ret, "Subsystem Listener Added")
    common_test_lib.terminate_ibofos(ibof_root, stdout_type)
    success = (EXPECT == ret)
    common_test_lib.print_result("[ Add Subsystem Listener Test ]", success)
    return success
Exemplo n.º 12
0
def unmount_volume_during_io(read_or_write):

    for sleep_time in range(5,10):
        test_name = "Unmount During IO" + str(sleep_time)
        common_test_lib.print_start(test_name)
        common_test_lib.bringup_multiple_volume(**bringup_argument)
        verify_flag = "1"
        if("read" in read_or_write):
            verify_flag = "0"
        process = execute_fio_pipe(readwrite=read_or_write, offset=0, verify=verify_flag)

        time.sleep(7 + sleep_time)

        print("Volume Unmounted!!!!!")
        subprocess.call(ibof_cli + " volume unmount --name vol1 --array POSArray", shell="True")

        ret = process.wait()

        clear_env()
        common_test_lib.print_result(test_name, True)
Exemplo n.º 13
0
def detaching_device_during_io(read_or_write):

    for sleep_time in range(5,10):
        test_name = "Detaching During IO" + str(sleep_time)
        common_test_lib.print_start(test_name)
        common_test_lib.bringup_multiple_volume(**bringup_argument)
        verify_flag = "1"
        if("read" in read_or_write):
            verify_flag = "0"
        process = execute_fio_pipe(readwrite=read_or_write, offset=0, verify=verify_flag)

        time.sleep(7 + sleep_time)

        pos_util.pci_detach(nvme_device_0)

        print("Device Detached!!!!!")

        ret = process.wait()

        clear_env()
        common_test_lib.print_result(test_name, ret == 0)