Commit b6abc16b authored by Karol Latecki's avatar Karol Latecki Committed by Jim Harris
Browse files

test: remove duplicate fio.py script file



scripts/fio.py and test/nvmf/fio/nvmf_fio.py are almost exact
same script. This commit unifies two files into one.

Change-Id: If753baaeb9f92dad2cda27bb4bed78ade4827d0b
Signed-off-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448656


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarSeth Howell <seth.howell5141@gmail.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarVitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 02b02302
Loading
Loading
Loading
Loading
+21 −12
Original line number Diff line number Diff line
@@ -44,25 +44,27 @@ def interrupt_handler(signum, frame):
def main():

    global fio
    if (len(sys.argv) < 5):
    if (len(sys.argv) < 6):
        print("usage:")
        print("  " + sys.argv[0] + " <io_size> <queue_depth> <test_type> <runtime>")
        print("  " + sys.argv[0] + " <nvmf/iscsi> <io_size> <queue_depth> <test_type> <runtime>")
        print("advanced usage:")
        print("If you want to run fio with verify, please add verify string after runtime.")
        print("Currently fio.py only support write rw randwrite randrw with verify enabled.")
        sys.exit(1)

    io_size = int(sys.argv[1])
    queue_depth = int(sys.argv[2])
    test_type = sys.argv[3]
    runtime = sys.argv[4]
    if len(sys.argv) > 5:
        verify = True
    else:
    app = str(sys.argv[1])
    io_size = int(sys.argv[2])
    queue_depth = int(sys.argv[3])
    test_type = sys.argv[4]
    runtime = sys.argv[5]
    verify = False
    if len(sys.argv) > 6:
        verify = True

    devices = get_target_devices()
    print(("Found devices: ", devices))
    if app == "nvmf":
        devices = get_nvmf_target_devices()
    elif app == "iscsi":
        devices = get_iscsi_target_devices()

    configure_devices(devices)
    try:
@@ -73,6 +75,8 @@ def main():
            sys.exit(1)

    device_paths = ['/dev/' + dev for dev in devices]
    print("Device paths:")
    print(device_paths)
    sys.stdout.flush()
    signal.signal(signal.SIGTERM, interrupt_handler)
    signal.signal(signal.SIGINT, interrupt_handler)
@@ -85,11 +89,16 @@ def main():
    sys.exit(rc)


def get_target_devices():
def get_iscsi_target_devices():
    output = check_output('iscsiadm -m session -P 3', shell=True)
    return re.findall("Attached scsi disk (sd[a-z]+)", output.decode("ascii"))


def get_nvmf_target_devices():
    output = str(check_output('lsblk -l -o NAME', shell=True).decode())
    return re.findall("(nvme[0-9]+n[0-9]+)\n", output)


def create_fio_config(size, q_depth, devices, test, run_time, verify):
    norandommap = 0
    if not verify:
+2 −2
Original line number Diff line number Diff line
@@ -11,8 +11,8 @@ function node_login_fio_logout() {
	done
	iscsiadm -m node --login -p $TARGET_IP:$ISCSI_PORT
	sleep 1
	$fio_py 512 1 write 2
	$fio_py 512 1 read 2
	$fio_py iscsi 512 1 write 2
	$fio_py iscsi 512 1 read 2
	iscsiadm -m node --logout -p $TARGET_IP:$ISCSI_PORT
	sleep 1
}
+6 −6
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ function running_config() {
	timing_exit start_iscsi_tgt2

	sleep 1
	$fio_py 4096 1 randrw 5
	$fio_py iscsi 4096 1 randrw 5
}

if [ -z "$TARGET_IP" ]; then
@@ -92,12 +92,12 @@ iscsiadm -m node --login -p $TARGET_IP:$ISCSI_PORT
trap "iscsicleanup; killprocess $pid; delete_tmp_files; exit 1" SIGINT SIGTERM EXIT

sleep 1
$fio_py 4096 1 randrw 1 verify
$fio_py 131072 32 randrw 1 verify
$fio_py 524288 128 randrw 1 verify
$fio_py iscsi 4096 1 randrw 1 verify
$fio_py iscsi 131072 32 randrw 1 verify
$fio_py iscsi 524288 128 randrw 1 verify

if [ $RUN_NIGHTLY -eq 1 ]; then
	$fio_py 4096 1 write 300 verify
	$fio_py iscsi 4096 1 write 300 verify

	# Run the running_config test which will generate a config file from the
	#  running iSCSI target, then kill and restart the iSCSI target using the
@@ -107,7 +107,7 @@ if [ $RUN_NIGHTLY -eq 1 ]; then
fi

# Start hotplug test case.
$fio_py 1048576 128 rw 10 &
$fio_py iscsi 1048576 128 rw 10 &
fio_pid=$!

sleep 3
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ iscsiadm -m node --login -p $MIGRATION_ADDRESS:$ISCSI_PORT

# fio tests for multi-process
sleep 1
$fio_py 4096 32 randrw 10 &
$fio_py iscsi 4096 32 randrw 10 &
fiopid=$!
sleep 5

+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ iscsiadm -m node --login -p $TARGET_IP:$ISCSI_PORT
timing_exit discovery

timing_enter fio
$fio_py 131072 8 randwrite 10 verify
$fio_py iscsi 131072 8 randwrite 10 verify
timing_exit fio

rm -f ./local-job0-0-verify.state
Loading