Ejemplo n.º 1
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
Ejemplo n.º 2
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
Ejemplo n.º 3
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
Ejemplo 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_ibofos(**bringup_argument)

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

    common_test_lib.terminate_ibofos(ibof_root, stdout_type)
    success = (ret == 1)
    common_test_lib.print_result(test_name, success)
    return success
Ejemplo n.º 5
0
def verify_test():
    test_name = "Verify"
    common_test_lib.print_start(test_name)
    common_test_lib.bringup_ibofos(**bringup_argument)

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

    common_test_lib.terminate_ibofos(ibof_root, stdout_type)
    success = (ret == 0)
    common_test_lib.print_result(test_name, success)
    return success
Ejemplo n.º 6
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
Ejemplo n.º 7
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
def ClearEnv():
    ## in this function, do not check error.
    for proc in psutil.process_iter():
        try:
            if "fio" in proc.name():
                proc.kill()
                proc.wait()
        except psutil.NoSuchProcess:
            pass
    common_test_lib.terminate_ibofos(IBOFOS_ROOT, subprocess.DEVNULL)

    command = NVME_CLI_CMD + ' disconnect -n ' + NQN
    ret = subprocess.call(command, shell=True)
def PowerOff():
    stdout_type = subprocess.DEVNULL
    common_test_lib.terminate_ibofos(IBOFOS_ROOT, stdout_type)

    print("########## disconnect nvmf controllers ##########")
    command = NVME_CLI_CMD + ' disconnect -n ' + NQN

    ret = subprocess.call(command, shell=True)
    if (ret != 0):
        print("##### Disconnect Failed!!  ######")
        return ret

    print("########### Power off Completed #################")
    return 0
Ejemplo 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
Ejemplo 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