@@ -25,7 +25,7 @@ test() {
local port
port="$(_create_nvmet_port "${nvme_trtype}")"
- truncate -s 1G "$TMPDIR/img"
+ truncate -s "${nvme_img_size}" "$TMPDIR/img"
local loop_dev
loop_dev="$(losetup -f --show "$TMPDIR/img")"
@@ -24,7 +24,7 @@ test() {
local port
port="$(_create_nvmet_port "${nvme_trtype}")"
- truncate -s 1G "$TMPDIR/img"
+ truncate -s "${nvme_img_size}" "$TMPDIR/img"
local loop_dev
loop_dev="$(losetup -f --show "$TMPDIR/img")"
@@ -24,7 +24,7 @@ test() {
_setup_nvmet
- truncate -s 1G "$TMPDIR/img"
+ truncate -s "${nvme_img_size}" "$TMPDIR/img"
loop_dev="$(losetup -f --show "$TMPDIR/img")"
@@ -25,7 +25,7 @@ test() {
file_path="${TMPDIR}/img"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
@@ -26,7 +26,7 @@ test() {
local file_path="$TMPDIR/img"
local subsys_name="blktests-subsystem-1"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
loop_dev="$(losetup -f --show "${file_path}")"
@@ -24,7 +24,7 @@ test() {
local file_path="$TMPDIR/img"
local subsys_name="blktests-subsystem-1"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
@@ -26,7 +26,7 @@ test() {
local file_path="${TMPDIR}/img"
local subsys_name="blktests-subsystem-1"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
loop_dev="$(losetup -f --show "${file_path}")"
@@ -41,7 +41,7 @@ test() {
cat "/sys/block/${nvmedev}n1/uuid"
cat "/sys/block/${nvmedev}n1/wwid"
- _run_fio_verify_io --size=950m --filename="/dev/${nvmedev}n1"
+ _run_fio_verify_io --filename="/dev/${nvmedev}n1"
_nvme_disconnect_subsys "${subsys_name}"
@@ -26,7 +26,7 @@ test() {
local file_path="${TMPDIR}/img"
local subsys_name="blktests-subsystem-1"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
@@ -39,7 +39,7 @@ test() {
cat "/sys/block/${nvmedev}n1/uuid"
cat "/sys/block/${nvmedev}n1/wwid"
- _run_fio_verify_io --size=950m --filename="/dev/${nvmedev}n1"
+ _run_fio_verify_io --filename="/dev/${nvmedev}n1"
_nvme_disconnect_subsys "${subsys_name}"
@@ -29,7 +29,7 @@ test() {
local file_path="${TMPDIR}/img"
local subsys_name="blktests-subsystem-1"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
loop_dev="$(losetup -f --show "${file_path}")"
@@ -44,7 +44,7 @@ test() {
cat "/sys/block/${nvmedev}n1/uuid"
cat "/sys/block/${nvmedev}n1/wwid"
- _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "900m"
+ _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "${nvme_img_size}"
_nvme_disconnect_subsys "${subsys_name}"
@@ -28,7 +28,7 @@ test() {
local subsys_name="blktests-subsystem-1"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
@@ -41,7 +41,7 @@ test() {
cat "/sys/block/${nvmedev}n1/uuid"
cat "/sys/block/${nvmedev}n1/wwid"
- _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "900m"
+ _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "${nvme_img_size}"
_nvme_disconnect_subsys "${subsys_name}"
@@ -26,7 +26,7 @@ test() {
local file_path="$TMPDIR/img"
local subsys_name="blktests-subsystem-1"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
loop_dev="$(losetup -f --show "${file_path}")"
@@ -41,7 +41,13 @@ test() {
cat "/sys/block/${nvmedev}n1/uuid"
cat "/sys/block/${nvmedev}n1/wwid"
- dd if=/dev/urandom of="/dev/${nvmedev}n1" count=128000 bs=4k status=none
+ local sectors
+ local bs
+ sectors="$(blockdev --getss "/dev/${nvmedev}n1")"
+ bs="$(blockdev --getbsz "/dev/${nvmedev}n1")"
+
+ dd if=/dev/urandom of="/dev/${nvmedev}n1" \
+ count="${sectors}" bs="${bs}" status=none
nvme flush "/dev/${nvmedev}" -n 1
@@ -25,7 +25,7 @@ test() {
local file_path="$TMPDIR/img"
local subsys_name="blktests-subsystem-1"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
@@ -38,7 +38,13 @@ test() {
cat "/sys/block/${nvmedev}n1/uuid"
cat "/sys/block/${nvmedev}n1/wwid"
- dd if=/dev/urandom of="/dev/${nvmedev}n1" count=128000 bs=4k status=none
+ local sectors
+ local bs
+ sectors="$(blockdev --getss "/dev/${nvmedev}n1")"
+ bs="$(blockdev --getbsz "/dev/${nvmedev}n1")"
+
+ dd if=/dev/urandom of="/dev/${nvmedev}n1" \
+ count="${sectors}" bs="${bs}" status=none
nvme flush "/dev/${nvmedev}n1" -n 1
@@ -25,7 +25,7 @@ test() {
file_path="${TMPDIR}/img"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
@@ -26,7 +26,7 @@ test() {
local file_path="$TMPDIR/img"
local subsys_name="blktests-subsystem-1"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
@@ -28,7 +28,7 @@ test() {
local nblk_range="10,10,10,10,10,10,10,10,10,10"
local sblk_range="100,200,300,400,500,600,700,800,900,1000"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
loop_dev="$(losetup -f --show "${file_path}")"
@@ -26,7 +26,7 @@ test() {
local nblk_range="10,10,10,10,10,10,10,10,10,10"
local sblk_range="100,200,300,400,500,600,700,800,900,1000"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
@@ -25,7 +25,7 @@ test() {
local file_path="$TMPDIR/img"
local subsys_name="blktests-subsystem-1"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
@@ -25,7 +25,7 @@ test() {
local file_path="$TMPDIR/img"
local subsys_name="blktests-subsystem-1"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
@@ -26,7 +26,7 @@ test() {
local file_path="$TMPDIR/img"
local subsys_name="blktests-subsystem-1"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
loop_dev="$(losetup -f --show "${file_path}")"
@@ -25,7 +25,7 @@ test() {
local file_path="$TMPDIR/img"
local subsys_name="blktests-subsystem-1"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
@@ -25,7 +25,7 @@ test() {
local file_path="$TMPDIR/img"
local subsys_name="blktests-subsystem-1"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
@@ -25,7 +25,7 @@ test() {
local file_path="$TMPDIR/img"
local subsys_name="blktests-subsystem-1"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
@@ -25,7 +25,7 @@ test() {
local file_path="$TMPDIR/img"
local subsys_name="blktests-subsystem-1"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
@@ -25,7 +25,7 @@ test() {
local file_path="$TMPDIR/img"
local subsys_name="blktests-subsystem-1"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
@@ -14,6 +14,7 @@ requires() {
_nvme_requires
_have_loop
_require_nvme_trtype_is_fabrics
+ _require_test_dev_size 1M
}
test_user_io()
@@ -59,7 +60,7 @@ test() {
local file_path="$TMPDIR/img"
local subsys_name="blktests-subsystem-1"
- truncate -s 1G "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
loop_dev="$(losetup -f --show "${file_path}")"
@@ -33,7 +33,7 @@ test() {
_setup_nvmet
- truncate -s 1G "$TMPDIR/img"
+ truncate -s "${nvme_img_size}" "$TMPDIR/img"
loop_dev="$(losetup -f --show "$TMPDIR/img")"
@@ -38,8 +38,8 @@ test_device() {
sysfs="/sys/bus/pci/devices/${pdev}"
# start fio job
- _run_fio_rand_io --filename="$TEST_DEV" --size=1g \
- --group_reporting &> /dev/null &
+ _run_fio_rand_io --filename="$TEST_DEV" --size=256M \
+ --group_reporting --time_based --runtime=1m > /dev/null &
sleep 5
@@ -26,7 +26,7 @@ test_device() {
port=$(_nvmet_passthru_target_setup "${subsys}")
nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}")
- _run_fio_verify_io --size=950m --filename="${nsdev}"
+ _run_fio_verify_io --size="${nvme_img_size}" --filename="${nsdev}"
_nvme_disconnect_subsys "${subsys}"
_nvmet_passthru_target_cleanup "${port}" "${subsys}"
@@ -17,7 +17,7 @@ requires() {
}
device_requires() {
- _require_test_dev_size 1024m
+ _require_test_dev_size "${nvme_img_size}"
}
test_device() {
@@ -32,7 +32,7 @@ test_device() {
port=$(_nvmet_passthru_target_setup "${subsys}")
nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}")
- _xfs_run_fio_verify_io "${nsdev}" "900m"
+ _xfs_run_fio_verify_io "${nsdev}" "${nvme_img_size}"
_nvme_disconnect_subsys "${subsys}"
_nvmet_passthru_target_cleanup "${port}" "${subsys}"
@@ -25,7 +25,7 @@ test() {
echo "Running ${TEST_NAME}"
_setup_nvmet
- truncate -s 1G "$TMPDIR/img"
+ truncate -s ${nvme_img_size} "$TMPDIR/img"
loop_dev="$(losetup -f --show "$TMPDIR/img")"
port="$(_create_nvmet_port "${nvme_trtype}")"
@@ -37,7 +37,7 @@ test() {
# start fio job
echo "starting background fio"
- _run_fio_rand_io --filename="/dev/${nvmedev}n1" --size=1g \
+ _run_fio_rand_io --filename="/dev/${nvmedev}n1" --size="${nvme_img_size}" \
--group_reporting --ramp_time=5 &> /dev/null &
sleep 5
@@ -44,7 +44,7 @@ test() {
_setup_nvmet
- truncate -s 512M "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
"b92842df-a394-44b1-84a4-92ae7d112861"
@@ -41,7 +41,7 @@ test() {
_setup_nvmet
- truncate -s 512M "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}"
port="$(_create_nvmet_port "${nvme_trtype}")"
@@ -42,7 +42,7 @@ test() {
_setup_nvmet
- truncate -s 512M "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}"
port="$(_create_nvmet_port "${nvme_trtype}")"
@@ -53,7 +53,7 @@ test() {
_setup_nvmet
- truncate -s 512M "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}"
port="$(_create_nvmet_port "${nvme_trtype}")"
@@ -55,7 +55,7 @@ test() {
_setup_nvmet
- truncate -s 512M "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}"
port="$(_create_nvmet_port "${nvme_trtype}")"
@@ -28,7 +28,7 @@ test() {
local file_path="$TMPDIR/img"
local subsys_name="blktests-subsystem-1"
- truncate -s 512M "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
loop_dev="$(losetup -f --show "${file_path}")"
@@ -84,7 +84,7 @@ test() {
fi
hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}"
- truncate -s 512M "${file_path}"
+ truncate -s "${nvme_img_size}" "${file_path}"
_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
"b92842df-a394-44b1-84a4-92ae7d112861"
@@ -17,6 +17,7 @@ def_local_wwpn="0x20001100aa000002"
def_hostnqn="$(cat /etc/nvme/hostnqn 2> /dev/null)"
def_hostid="$(cat /etc/nvme/hostid 2> /dev/null)"
nvme_trtype=${nvme_trtype:-"loop"}
+nvme_img_size=${nvme_img_size:-"64M"}
_nvme_requires() {
_have_program nvme
The reduce the overall runtime of the testsuite by making the default size of the test image small. For verification jobs, the default can be overwriten via the newly introduced nvme_img_size environment variable. Signed-off-by: Daniel Wagner <dwagner@suse.de> --- tests/nvme/004 | 2 +- tests/nvme/005 | 2 +- tests/nvme/006 | 2 +- tests/nvme/007 | 2 +- tests/nvme/008 | 2 +- tests/nvme/009 | 2 +- tests/nvme/010 | 4 ++-- tests/nvme/011 | 4 ++-- tests/nvme/012 | 4 ++-- tests/nvme/013 | 4 ++-- tests/nvme/014 | 10 ++++++++-- tests/nvme/015 | 10 ++++++++-- tests/nvme/017 | 2 +- tests/nvme/018 | 2 +- tests/nvme/019 | 2 +- tests/nvme/020 | 2 +- tests/nvme/021 | 2 +- tests/nvme/022 | 2 +- tests/nvme/023 | 2 +- tests/nvme/024 | 2 +- tests/nvme/025 | 2 +- tests/nvme/026 | 2 +- tests/nvme/027 | 2 +- tests/nvme/028 | 2 +- tests/nvme/029 | 3 ++- tests/nvme/031 | 2 +- tests/nvme/032 | 4 ++-- tests/nvme/034 | 2 +- tests/nvme/035 | 4 ++-- tests/nvme/040 | 4 ++-- tests/nvme/041 | 2 +- tests/nvme/042 | 2 +- tests/nvme/043 | 2 +- tests/nvme/044 | 2 +- tests/nvme/045 | 2 +- tests/nvme/047 | 2 +- tests/nvme/048 | 2 +- tests/nvme/rc | 1 + 38 files changed, 60 insertions(+), 46 deletions(-)