示例#1
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
示例#2
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
def PowerOn(clean):
    print("########## Power On Ibofos.. ##########")
    stdout_type = subprocess.DEVNULL

    bringup_argument = {
        'log_path': LOG_PATH,
        'ibof_root': IBOFOS_ROOT,
        'transport': TR_TYPE,
        'target_ip': args.fabric_ip,
        'volume_size': SIZE,
        'stdout_type': stdout_type,
        'clean': clean
    }

    common_test_lib.bringup_ibofos(**bringup_argument)

    Wait(3)
    command = NVME_CLI_CMD + " connect " + " -t " + TR_TYPE + " -a " +\
             args.fabric_ip + " -s " + TR_PORT + " -n " + NQN
    print(command)
    ret = subprocess.call(command, shell=True)
    if (ret != 0):
        print("##### Connection Failed!!  ######")
        #this error is critical, exit this process.
        exit(1)

    command = "nvme list | grep IBOF | awk '{print $1; exit}'"
    global dev_name
    retry_count = 0
    dev_name = ""
    while dev_name == "":
        byte_string_dev_name = subprocess.check_output(command, shell=True)
        dev_name = "".join(map(chr, byte_string_dev_name))
        dev_name = dev_name[:-1]
        retry_count = retry_count + 1
        if retry_count > retry_limit:
            print("##### Connection Failed!!  ######")
            exit(1)

    tempfile = "temp.output"
    command = NVME_CLI_CMD + " id-ctrl " + dev_name + " | grep 'subnqn' > " + tempfile
    print(command)
    ret = subprocess.call(command, shell=True)
    if (ret != 0):
        print("##### Connection Failed!!  ######")
        #this error is critical, exit this process.
        exit(1)
    find_success = False
    f = open(tempfile)
    for line in f:
        if (NQN in line):
            find_success = True
    if (find_success == False):
        print("##### Connection Failed!!  ######")
        #this error is critical, exit this process.
        exit(1)

    global BASIC_FIO_SCRIPT
    BASIC_FIO_SCRIPT=FIO_BENCH_SCRIPT + ' --iodepth=' + IO_DEPTH +\
            ' --file_num=1 --filename=' + dev_name + ' --ioengine=' + IO_ENGINE

    return 0