From patchwork Thu Apr 11 11:12:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13625759 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D01B3147C7C for ; Thu, 11 Apr 2024 11:13:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.153.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712834023; cv=none; b=cb0lNr9AeZx1d1wjmP6p0EJETd6UmINtRmXQ/FUhTDWaP955SGSUmUfMO7NF0DQh6cfqSCt+AUZaH1j5wZSnswcL5Vxlppvh+we4ovg59U4DT49uqtsoIDlHyYdeW3CDpzjDYeoGSDc0zB2i+hapJ2b8VejeZd/KqiDuCOx6ny8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712834023; c=relaxed/simple; bh=9MjajHbnj6QVYHeGzTlH+Mn0XUl56AuvvOOv7c7MCeU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mWakFo0CNPI0WpNCnwsDN+OEHSB/AAgL9S8E2YhWK+McJp34LzAxRfH6Pk8NMCe8fy5g3iGFeRsRE87i5RoMG7uYL+FA0C/2x8qEptJWRpUd1Fie/z+sh7vTzv361cxs68zd82re3vBdJtOVK/g0QHKAXY7fpyC5Q7q3tMrEG0A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=JxxAuZuI; arc=none smtp.client-ip=216.71.153.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="JxxAuZuI" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1712834022; x=1744370022; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9MjajHbnj6QVYHeGzTlH+Mn0XUl56AuvvOOv7c7MCeU=; b=JxxAuZuIYrjmuxRHhSFHIUIk4HUGcAmF+QUoCMcH0DeC46IY8RUhkXUU hBHJbqnOk5d42fNDRocEFOcICMHDxKr/9QYxqIVgG+ZMRMp1O2hK90MBg R9Gfy194eXRfXchCttj0hULPYitGPmjQhls3juployHYQ1JwlEVizJQmi dtCEUmXNowIDyjIwrAnNlVUBJgyqqb67tw/ZQWJcFOFLiF9Lb8kEx3bzV twkLzaEHEsOQEKOOAwo9SF8jHAPA6NsEveiKAnC937hW5g/gPRBiYYJGf loMN34gNLT749Ko7b3VEQZ5Fps/78QBm5G4B8K0+YNB5iAEnuFBKfY8M7 g==; X-CSE-ConnectionGUID: /htKG/aCSnKBnR4DCUugYQ== X-CSE-MsgGUID: eYQ740lLSsOOlO/MawA4kw== X-IronPort-AV: E=Sophos;i="6.07,193,1708358400"; d="scan'208";a="13579862" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 11 Apr 2024 19:12:31 +0800 IronPort-SDR: q/Jl1S9nLJtGSCnfEksW8WuoT2xCOt6X5Asn1G8kv8nzx/SBP6fycgPwmz8STlW0BMXYjvAScz Q8VlgPdNVVxA== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Apr 2024 03:15:16 -0700 IronPort-SDR: yAVqHJyiA8jRA1vbeHTk0EnaTBt/34S6e1Cjqkh9GpNtniVztoayhpuOaXrmvIspyDoUKISgUk rUhe9+G6GFnQ== WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 11 Apr 2024 04:12:30 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests 01/11] check: factor out _run_test() Date: Thu, 11 Apr 2024 20:12:18 +0900 Message-ID: <20240411111228.2290407-2-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> References: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The function _run_test() is rather complex and has deep nests. Before modifying it for repeated test case runs, simplify it. Factor out some part of the function to the new functions _check_and_call_test() and _check_and_call_test_device(). Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Nitesh Shetty --- check | 90 +++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 53 insertions(+), 37 deletions(-) diff --git a/check b/check index 55871b0..b1f5212 100755 --- a/check +++ b/check @@ -463,6 +463,56 @@ _unload_modules() { unset MODULES_TO_UNLOAD } +_check_and_call_test() { + if declare -fF requires >/dev/null; then + requires + fi + + RESULTS_DIR="$OUTPUT/nodev" + _call_test test + ret=$? + if (( RUN_ZONED_TESTS && CAN_BE_ZONED )); then + RESULTS_DIR="$OUTPUT/nodev_zoned" + RUN_FOR_ZONED=1 + _call_test test + ret=$(( ret || $? )) + fi + + return $ret +} + +_check_and_call_test_device() { + local unset_skip_reason + + if declare -fF requires >/dev/null; then + requires + fi + + for TEST_DEV in "${TEST_DEVS[@]}"; do + TEST_DEV_SYSFS="${TEST_DEV_SYSFS_DIRS["$TEST_DEV"]}" + TEST_DEV_PART_SYSFS="${TEST_DEV_PART_SYSFS_DIRS["$TEST_DEV"]}" + + unset_skip_reason=0 + if [[ ! -v SKIP_REASONS ]]; then + unset_skip_reason=1 + if (( !CAN_BE_ZONED )) && _test_dev_is_zoned; then + SKIP_REASONS+=("${TEST_DEV} is a zoned block device") + elif declare -fF device_requires >/dev/null; then + device_requires + fi + fi + RESULTS_DIR="$OUTPUT/$(basename "$TEST_DEV")" + if ! _call_test test_device; then + ret=1 + fi + if (( unset_skip_reason )); then + unset SKIP_REASONS + fi + done + + return $ret +} + _run_test() { TEST_NAME="$1" CAN_BE_ZONED=0 @@ -482,19 +532,8 @@ _run_test() { . "tests/${TEST_NAME}" if declare -fF test >/dev/null; then - if declare -fF requires >/dev/null; then - requires - fi - - RESULTS_DIR="$OUTPUT/nodev" - _call_test test + _check_and_call_test ret=$? - if (( RUN_ZONED_TESTS && CAN_BE_ZONED )); then - RESULTS_DIR="$OUTPUT/nodev_zoned" - RUN_FOR_ZONED=1 - _call_test test - ret=$(( ret || $? )) - fi else if [[ ${#TEST_DEVS[@]} -eq 0 ]] && \ declare -fF fallback_device >/dev/null; then @@ -516,31 +555,8 @@ _run_test() { return 0 fi - if declare -fF requires >/dev/null; then - requires - fi - - for TEST_DEV in "${TEST_DEVS[@]}"; do - TEST_DEV_SYSFS="${TEST_DEV_SYSFS_DIRS["$TEST_DEV"]}" - TEST_DEV_PART_SYSFS="${TEST_DEV_PART_SYSFS_DIRS["$TEST_DEV"]}" - - local unset_skip_reason=0 - if [[ ! -v SKIP_REASONS ]]; then - unset_skip_reason=1 - if (( !CAN_BE_ZONED )) && _test_dev_is_zoned; then - SKIP_REASONS+=("${TEST_DEV} is a zoned block device") - elif declare -fF device_requires >/dev/null; then - device_requires - fi - fi - RESULTS_DIR="$OUTPUT/$(basename "$TEST_DEV")" - if ! _call_test test_device; then - ret=1 - fi - if (( unset_skip_reason )); then - unset SKIP_REASONS - fi - done + _check_and_call_test_device + ret=$? if (( FALLBACK_DEVICE )); then cleanup_fallback_device From patchwork Thu Apr 11 11:12:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13625760 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8171147C77 for ; Thu, 11 Apr 2024 11:13:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.153.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712834024; cv=none; b=WuzGDrS0rUcIKiRRA+WZpO8YZLwcXc25/zUafjIdhpzcj1DypnvMbmj2Re786yvAFBJPWEhjNfEKKkDC3iaUJ/UX7mQ5QGi3w/zP/0KVxZsZUQnAh7bMS9rKOLABOH5ou/s5+TRL965w9Hiy7LsdCQsEXUh+qokI7Pevfbb0ofw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712834024; c=relaxed/simple; bh=8XWsBfcuPK6MSnKkO91ZMiolR0lPRUUOuelXGyh30/0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S5Rc8OdxnnWH8AQ02s/fn8c0r2q8KJA0+WmWYXaPUQnHIBDtwOcAbHDwcHAwDnjBzTJlV+L7RwyTfXQTvVYU21lWA2x77JIq3fz8LAS6/upNbFdMSe1A9L28Eo6ZzEPgRLTIVAXEUzHqTo9swrm7m77qVENnyZGHGPnVij/ziUs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=hVOG2glJ; arc=none smtp.client-ip=216.71.153.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="hVOG2glJ" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1712834023; x=1744370023; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8XWsBfcuPK6MSnKkO91ZMiolR0lPRUUOuelXGyh30/0=; b=hVOG2glJ4iEV45O/C5gXmjINUrSxJHR/knqicSff9mgfCyzF13878A9L ChCf+xsj+bvgGsIc98SleVp0ztLZv9a6aoATD2AlQ4iaZy2JIFmWfs+rJ sTMMH2Zi0gcWAl8n09ahJAjGu7RmCDd6WXG3Yr7yPG0aNiTD/m6z+w1P5 BXQfCXHUTN/BvAQ2mvnlq/JbNWOUhdOTFK+ScZEGVSOnl9nJEk/U4OPWu 0BI5+JajLSCRoectAWFkqdMDT+H755TsafZs/bzpBUlRx5H+Q7xYv7AWM Nho0fig06URm+y2YzkgUpiBo6x0aNzD34m4W3CjOSLoADZNJLHGa+ci95 g==; X-CSE-ConnectionGUID: 87BFDyEuR4e8MY2a6Oayrg== X-CSE-MsgGUID: QERP5Bt5QNauK1bN6fn71A== X-IronPort-AV: E=Sophos;i="6.07,193,1708358400"; d="scan'208";a="13579863" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 11 Apr 2024 19:12:32 +0800 IronPort-SDR: Akz52Nvig4+oHbrKRgerG0c6TZbccBK6caOP2EvxsxK34XRO8dnc/wo6/xGAgkFV+qNjSJjy3t t0LpWG5dSBEw== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Apr 2024 03:15:17 -0700 IronPort-SDR: Z6l09byqTQ9gTR8UbY5kfo7ty+Ju7J8gV6twwn66mD0CUjbYXF84bJ7M67Rr+PFIKZDTB1Ohwm iIo+PFfBub9A== WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 11 Apr 2024 04:12:31 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests 02/11] check: support test case repeat by different conditions Date: Thu, 11 Apr 2024 20:12:19 +0900 Message-ID: <20240411111228.2290407-3-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> References: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 It is often required to run the same test with slightly different test conditions. If we create each test case for each test condition, those test cases are almost same and have code duplication. Such duplication is seen in many of the nvme test cases that set up nvme transport. To avoid the code duplication, introduce a new feature to support test case repetition with different conditions. When a test case implements the function set_conditions(), blktests repeat the test case. When set_conditions() is called without an argument, it returns how many times the test case is to be repeated. Before each test case run, blktests calls set_conditions() with an argument number from 0 to the number of repetitions minus 1. set_conditions() sets up the condition for each test run referring to the argument as the index of the condition to set up. set_conditions() also sets up a short string in the COND_DESC variable. This string is printed to stdout to identify the condition of each run. It is also used as the directory path name to hold result files. Document the usage of set_conditions() in the new script. Separate out shellcheck command line for the new script to avoid a false-positive warning unique to the file. Signed-off-by: Shin'ichiro Kawasaki --- Makefile | 3 ++- check | 58 ++++++++++++++++++++++++++++++++++------------- common/shellcheck | 2 +- new | 21 +++++++++++++++++ 4 files changed, 66 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 43f2ab0..1c685fe 100644 --- a/Makefile +++ b/Makefile @@ -18,8 +18,9 @@ install: SHELLCHECK_EXCLUDE := SC2119 check: - shellcheck -x -e $(SHELLCHECK_EXCLUDE) -f gcc check new common/* \ + shellcheck -x -e $(SHELLCHECK_EXCLUDE) -f gcc check common/* \ tests/*/rc tests/*/[0-9]*[0-9] src/*.sh + shellcheck --exclude=$(SHELLCHECK_EXCLUDE),SC2154 --format=gcc new ! grep TODO tests/*/rc tests/*/[0-9]*[0-9] ! find -name '*.out' -perm /u=x+g=x+o=x -printf '%p is executable\n' | grep . diff --git a/check b/check index b1f5212..cef84ec 100755 --- a/check +++ b/check @@ -17,7 +17,9 @@ _found_test() { local test_name="$1" local explicit="$2" - unset CAN_BE_ZONED DESCRIPTION QUICK TIMED requires device_requires test test_device fallback_device cleanup_fallback_device + unset CAN_BE_ZONED DESCRIPTION QUICK TIMED requires device_requires \ + test test_device fallback_device cleanup_fallback_device \ + set_conditions # shellcheck disable=SC1090 if ! . "tests/${test_name}"; then @@ -190,15 +192,12 @@ _write_test_run() { _output_status() { local test="$1" local status="$2" - local zoned=" " + local str="${test} " - if (( RUN_FOR_ZONED )); then zoned=" (zoned) "; fi - - if [[ "${DESCRIPTION:-}" ]]; then - printf '%-60s' "${test}${zoned}($DESCRIPTION)" - else - printf '%-60s' "${test}${zoned}" - fi + (( RUN_FOR_ZONED )) && str="$str(zoned) " + [[ ${COND_DESC:-} ]] && str="$str(${COND_DESC}) " + [[ ${DESCRIPTION:-} ]] && str="$str(${DESCRIPTION})" + printf '%-60s' "${str}" if [[ -z $status ]]; then echo return @@ -464,15 +463,18 @@ _unload_modules() { } _check_and_call_test() { + local postfix + if declare -fF requires >/dev/null; then requires fi - RESULTS_DIR="$OUTPUT/nodev" + [[ -n $COND_DESC ]] && postfix=_${COND_DESC//[ =]/_} + RESULTS_DIR="$OUTPUT/nodev${postfix}" _call_test test ret=$? if (( RUN_ZONED_TESTS && CAN_BE_ZONED )); then - RESULTS_DIR="$OUTPUT/nodev_zoned" + RESULTS_DIR="$OUTPUT/nodev_zoned${postfix}" RUN_FOR_ZONED=1 _call_test test ret=$(( ret || $? )) @@ -482,12 +484,14 @@ _check_and_call_test() { } _check_and_call_test_device() { + local postfix local unset_skip_reason if declare -fF requires >/dev/null; then requires fi + [[ -n $COND_DESC ]] && postfix=_${COND_DESC//[ =]/_} for TEST_DEV in "${TEST_DEVS[@]}"; do TEST_DEV_SYSFS="${TEST_DEV_SYSFS_DIRS["$TEST_DEV"]}" TEST_DEV_PART_SYSFS="${TEST_DEV_PART_SYSFS_DIRS["$TEST_DEV"]}" @@ -501,7 +505,7 @@ _check_and_call_test_device() { device_requires fi fi - RESULTS_DIR="$OUTPUT/$(basename "$TEST_DEV")" + RESULTS_DIR="$OUTPUT/$(basename "$TEST_DEV")""$postfix" if ! _call_test test_device; then ret=1 fi @@ -519,9 +523,11 @@ _run_test() { CHECK_DMESG=1 DMESG_FILTER="cat" RUN_FOR_ZONED=0 + COND_DESC="" FALLBACK_DEVICE=0 MODULES_TO_UNLOAD=() + local nr_conds cond_i local ret=0 # Ensure job control monitor mode is off in the sub-shell for test case @@ -532,8 +538,18 @@ _run_test() { . "tests/${TEST_NAME}" if declare -fF test >/dev/null; then - _check_and_call_test - ret=$? + if declare -fF set_conditions >/dev/null; then + nr_conds=$(set_conditions) + for ((cond_i = 0; cond_i < nr_conds; cond_i++)); do + set_conditions $cond_i + _check_and_call_test + ret=$(( ret || $? )) + unset SKIP_REASONS + done + else + _check_and_call_test + ret=$? + fi else if [[ ${#TEST_DEVS[@]} -eq 0 ]] && \ declare -fF fallback_device >/dev/null; then @@ -555,8 +571,18 @@ _run_test() { return 0 fi - _check_and_call_test_device - ret=$? + if declare -fF set_conditions >/dev/null; then + nr_conds=$(set_conditions) + for ((cond_i = 0; cond_i < nr_conds; cond_i++)); do + set_conditions $cond_i + _check_and_call_test_device + ret=$(( ret || $? )) + unset SKIP_REASONS + done + else + _check_and_call_test_device + ret=$? + fi if (( FALLBACK_DEVICE )); then cleanup_fallback_device diff --git a/common/shellcheck b/common/shellcheck index 8c324bd..ac0a51e 100644 --- a/common/shellcheck +++ b/common/shellcheck @@ -6,5 +6,5 @@ # Suppress unused global variable warnings. _silence_sc2034() { - echo "$CAN_BE_ZONED $CGROUP2_DIR $CHECK_DMESG $DESCRIPTION $DMESG_FILTER $FIO_PERF_FIELDS $FIO_PERF_PREFIX $QUICK $SKIP_REASONS ${TEST_RUN[*]} $TIMED" > /dev/null + echo "$CAN_BE_ZONED $CGROUP2_DIR $CHECK_DMESG $COND_DESC $DESCRIPTION $DMESG_FILTER $FIO_PERF_FIELDS $FIO_PERF_PREFIX $QUICK $SKIP_REASONS ${TEST_RUN[*]} $TIMED" > /dev/null } diff --git a/new b/new index 574d8b4..cb5fab2 100755 --- a/new +++ b/new @@ -180,6 +180,27 @@ DESCRIPTION="" # _require_test_dev_is_foo && _require_test_dev_supports_bar # } +# TODO: if the test case can run the same test for different conditions, define +# the helper function "set_condition". When no argument is specified, return the +# number of condition variations. Blktests repeats the test case as many times +# as the returned number. When its argument is specified, refer to it as the +# condition variation index and set up the conditions for it. Also set the +# global variable COND_DESC which is printed at the test case run and used for +# the result directory name. Blktests calls set_condition() before each run of +# the test case incrementing the argument index from 0. +# set_conditions() { +# local index=\$1 +# +# if [[ -z \$index ]]; then +# echo 2 # return number of condition variations +# return +# fi +# +# # Set test conditions based on the $index +# ... +# COND_DESC="Describe the conditions shortly" +# } + # TODO: define the test. The output of this function (stdout and stderr) will # be compared to tests/\${TEST_NAME}.out. If it does not match, the test is # considered a failure. If the test runs a command which has unnecessary From patchwork Thu Apr 11 11:12:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13625761 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E45A147C92 for ; Thu, 11 Apr 2024 11:13:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.153.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712834025; cv=none; b=E41G7+rgsrZxi9Fb34QnMzfPViDRQVwMAMIr48p3Wv50mpl4Tv/df/1sXtXS8y17VAR1pnPmusB7/7QXsj7fwfeicf9OQ76k1xh7wAO+mabD+FTG12hwhZrl2WjzOM+fTeLtGjR2BnBNpkiTABpUW9g4bmf5RwDx5YH7KO3QytM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712834025; c=relaxed/simple; bh=Gvq2kP8QGe4kZ9iHWlwYHHp657BYUaSrEtjR03kuTkM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XD7RCGMpHkDyVLcqgItc7KLFwmVQIzFlHxP3hIhVY2M/gqth01KlJZt3bgcIFmt5FZkmtOyrUK7RtcmuoOW3JOLFai1d1hKIzGY6WLllx5wNaR3pKl2aVOgbyN5c9Ys9xFAwGYla/uKBssj0X8I4dP/m3dxaNHgEMMOZO/wmp6w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=AYiYhnOq; arc=none smtp.client-ip=216.71.153.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="AYiYhnOq" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1712834023; x=1744370023; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Gvq2kP8QGe4kZ9iHWlwYHHp657BYUaSrEtjR03kuTkM=; b=AYiYhnOq7/z6RfGD0r+c447ncyhZojEr3wps0U8NOCmO8OxgXxZSajOx qyuK/N6L5h/gAHdfMdp/+h05XOnmp461Q1I0abeUGVduG6f5dM60vE08Z yVRt2fLw6ZOtZQoX6BuKjI8o9mwN6thVnps6ppNO4KT1s/LTp2e9B215f q06XlWEB+po2in5tPc5tawVUuQuprOmxjxKH3A14ivDunTdGUoYQVvw29 /TO0ldxO7oHOV41/ef1SKkMA/FfxsJ1pewwoEM9s/gaCw54sZs9bFrJbP T8+3TpaDaCI3ATfdxghJ0+z/vKslMpvp4TXrsCQ/L9GHMQCOpwZjbWyGi Q==; X-CSE-ConnectionGUID: waK2hqAnQeKlyUgC1M1FFg== X-CSE-MsgGUID: bIpKIMHwTQiVy65tKNLXTw== X-IronPort-AV: E=Sophos;i="6.07,193,1708358400"; d="scan'208";a="13579864" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 11 Apr 2024 19:12:33 +0800 IronPort-SDR: IhsMJgZLeNQYXF2tkN4Tm/XqU/G5C2w+4hXRMVOZ7dGRsw7Xmqpnx6THVIDMKKGP6vsyMpLS1l Fl6wiogpm//Q== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Apr 2024 03:15:18 -0700 IronPort-SDR: TrqEZxDh+H+nP45uKrePgG9poAGhw3h7JflL9lqG/xkZ6hPd0I1obmHHW21IqUF6mDACDIAIDf Zw60n9vCHwOQ== WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 11 Apr 2024 04:12:32 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests 03/11] check: use set_conditions() for the CAN_BE_ZONED test cases Date: Thu, 11 Apr 2024 20:12:20 +0900 Message-ID: <20240411111228.2290407-4-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> References: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When the test case with test() function is marked as CAN_BE_ZONED, blktests runs the test case twice: once for non-zoned device, and the second for zoned device. This is now implemented as a special logic in the check script. To simplify the implementation, use the feature to repeat test cases with different conditions. Use set_conditions() and move out the special logic from the check script to the common/zoned script file. Signed-off-by: Shin'ichiro Kawasaki --- check | 18 ++++++++---------- common/zoned | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 common/zoned diff --git a/check b/check index cef84ec..aeca894 100755 --- a/check +++ b/check @@ -56,6 +56,11 @@ _found_test() { return 1 fi + if [[ -n $CAN_BE_ZONED ]] && declare -fF test >/dev/null && declare -fF set_conditions >/dev/null; then + _warning "${test_name} defines both CAN_BE_ZONED and set_conditions()" + return 1 + fi + if (( QUICK && TIMED )); then _warning "${test_name} cannot be both QUICK and TIMED" return 1 @@ -194,7 +199,6 @@ _output_status() { local status="$2" local str="${test} " - (( RUN_FOR_ZONED )) && str="$str(zoned) " [[ ${COND_DESC:-} ]] && str="$str(${COND_DESC}) " [[ ${DESCRIPTION:-} ]] && str="$str(${DESCRIPTION})" printf '%-60s' "${str}" @@ -472,15 +476,6 @@ _check_and_call_test() { [[ -n $COND_DESC ]] && postfix=_${COND_DESC//[ =]/_} RESULTS_DIR="$OUTPUT/nodev${postfix}" _call_test test - ret=$? - if (( RUN_ZONED_TESTS && CAN_BE_ZONED )); then - RESULTS_DIR="$OUTPUT/nodev_zoned${postfix}" - RUN_FOR_ZONED=1 - _call_test test - ret=$(( ret || $? )) - fi - - return $ret } _check_and_call_test_device() { @@ -538,6 +533,9 @@ _run_test() { . "tests/${TEST_NAME}" if declare -fF test >/dev/null; then + if ((RUN_ZONED_TESTS && CAN_BE_ZONED)); then + . "common/zoned" + fi if declare -fF set_conditions >/dev/null; then nr_conds=$(set_conditions) for ((cond_i = 0; cond_i < nr_conds; cond_i++)); do diff --git a/common/zoned b/common/zoned new file mode 100644 index 0000000..6a8f1e5 --- /dev/null +++ b/common/zoned @@ -0,0 +1,22 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2024 Western Digital Corporation or its affiliates. + +# The helper function for test cases with CAN_BE_ZONED flag and test() +# function. Run the test case twice for non-zoned and zoned conditions. +set_conditions() { + local index=$1 + + if [[ -z $index ]]; then + echo 2 + return + fi + + if ((index == 0)); then + export RUN_FOR_ZONED=0 + export COND_DESC= + elif ((index == 1)); then + export RUN_FOR_ZONED=1 + export COND_DESC="zoned" + fi +} From patchwork Thu Apr 11 11:12:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13625762 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7ABE0147C7C for ; Thu, 11 Apr 2024 11:13:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.153.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712834026; cv=none; b=d+2mvPrp2YfsGcHfvmY6rJr1aSoP50qtafE30vHCgSdI8MrGphoNGWNeGLXKecI3QKgb6fiBprIy6xTo8zmHLdzA9Tt5KokY6f0q+rXnrhFlUfNJYaBDNa63EdypK07gtNgV+lrTbqvcvq2xLKgc4ktaViP9CjKIFe6mpKG0Yz8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712834026; c=relaxed/simple; bh=SBK3Pk2xC4hSF2vaKeplEtIivVa/MUAt4a7KOe5+oVQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lNe/5PNlHDKYd9Huc+pzWyREDvQxYakuvD3DHGUu4ItWs+We5c/qCylJx6zb1e29uHiAPvk6Mem4GhQGgPOoNH1jUW4vTHzNSOsL0WvoqUvH5A7A3cVPMVabxpAvxfIEOIQXwyLTJVzl9SRiEhwz6BwD8B9Su4T7r7p8vJ2OhF8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=Da1TGGrm; arc=none smtp.client-ip=216.71.153.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="Da1TGGrm" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1712834024; x=1744370024; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SBK3Pk2xC4hSF2vaKeplEtIivVa/MUAt4a7KOe5+oVQ=; b=Da1TGGrmGryp/PWDz4zvMxlUnH0t+VVwt74YlkjlzlYgCNucYeDfaubw SOxjarMuPyq7xuaIgLzsQd1czXYJvac/AeSOp1IfqH62vHjor1udv/2IC 7vNoGGkJpuItsdJAgoaTtQnf318mJGnOnjiwZ8Ca8++Tqb/iCzarwuIqh uNgOamLyu2Ze4IDa+lZjYrW+pX1rdVBlQS+e7k+/RGqUS0OLG51MbwcJC XxT9XfBst7Ytrdl446vXlau3UtY4DPqaU39KfAsIVRxtLfepg2BAOqyYB iiL/TwiDZNRw0gKvlOtfNeDCL8xtN/ZU8qUAuAzLwh633wFhZ+DH7Y/gF g==; X-CSE-ConnectionGUID: n59+ax8EQeeFlyTk51s6Ug== X-CSE-MsgGUID: 67mIgJnJSYCTWBV8uSVRHg== X-IronPort-AV: E=Sophos;i="6.07,193,1708358400"; d="scan'208";a="13579865" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 11 Apr 2024 19:12:33 +0800 IronPort-SDR: AX7UjpdTkNmQoN8wOdgBE8FN90ZnFL/VT89caP0xA+2F4DhpwCjwFEiXEBh3bCgJhRr4TNdCH3 xDbY8clROe0A== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Apr 2024 03:15:19 -0700 IronPort-SDR: 1zk0oZJf3QWQAPE0yL/TvZMIPs5Y9ahKHOaEJP6SM6VRM7P5RJTo8NRwuMTGAahkL5jUDcRXhX SE94E2prLikg== WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 11 Apr 2024 04:12:33 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests 04/11] meta/{016,017}: add test cases to check repeated test case runs Date: Thu, 11 Apr 2024 20:12:21 +0900 Message-ID: <20240411111228.2290407-5-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> References: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add test cases to confirm the feature to repeat test case runs with different conditions is working. Signed-off-by: Shin'ichiro Kawasaki --- tests/meta/016 | 29 +++++++++++++++++++++++++++++ tests/meta/016.out | 2 ++ tests/meta/017 | 29 +++++++++++++++++++++++++++++ tests/meta/017.out | 2 ++ 4 files changed, 62 insertions(+) create mode 100755 tests/meta/016 create mode 100644 tests/meta/016.out create mode 100755 tests/meta/017 create mode 100644 tests/meta/017.out diff --git a/tests/meta/016 b/tests/meta/016 new file mode 100755 index 0000000..caf876d --- /dev/null +++ b/tests/meta/016 @@ -0,0 +1,29 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2024 Western Digital Corporation or its affiliates. +# +# Test repeated test() run with set_conditions() + +. tests/meta/rc + +DESCRIPTION="repeat test()" + +declare cond_set_index + +set_conditions() { + local index=$1 + + if [[ -z $index ]]; then + echo 2 + return + fi + + cond_set_index=$index + COND_DESC="condition set $index" +} + +test() { + echo "Running ${TEST_NAME}" + echo "condition set $cond_set_index" >> "$FULL" + echo "Test complete" +} diff --git a/tests/meta/016.out b/tests/meta/016.out new file mode 100644 index 0000000..cccfec4 --- /dev/null +++ b/tests/meta/016.out @@ -0,0 +1,2 @@ +Running meta/016 +Test complete diff --git a/tests/meta/017 b/tests/meta/017 new file mode 100755 index 0000000..03f92d6 --- /dev/null +++ b/tests/meta/017 @@ -0,0 +1,29 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2024 Western Digital Corporation or its affiliates. +# +# Test repeated test_device() run with set_conditions() + +. tests/meta/rc + +DESCRIPTION="repeat test_device()" + +declare cond_set_index + +set_conditions() { + local index=$1 + + if [[ -z $index ]]; then + echo 2 + return + fi + + cond_set_index=$index + COND_DESC="condition set $index" +} + +test_device() { + echo "Running ${TEST_NAME}" + echo "condition set $cond_set_index" >> "$FULL" + echo "Test complete" +} diff --git a/tests/meta/017.out b/tests/meta/017.out new file mode 100644 index 0000000..7fc55ff --- /dev/null +++ b/tests/meta/017.out @@ -0,0 +1,2 @@ +Running meta/017 +Test complete From patchwork Thu Apr 11 11:12:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13625763 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3EED1482FC for ; Thu, 11 Apr 2024 11:13:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.153.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712834026; cv=none; b=ZhAicZ6pRdcVqE0JiLfenS0WU8Eo15XLBdwlEI68LC1jf2Pf6rrIax+sichRb/Kgz6pxcu6ewo4HkAbMbQv+5TSfkynGUDUhBhSN25qzYMzLcM2DhotlmllaBdIWCTsLoYvwCuMjA/vHeRGqrC/rjZaM+EuNK5daDoXdtHuEMD8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712834026; c=relaxed/simple; bh=oT1EVAZJnb4NrCk2dPNj7oAwzDeLFZ2N2iueMe6JpfU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F/AHtQjEg5UhulZTyYVgOZv35vl8zKyglruQa/XbfRZoGRX9WLfXNzyiffXrH+KuETj0hzbddl6tR5SrVlCvgMDBIg5opR7BZ2qWL6oBcLD2sZP4ghOlNDPXrktBt+bC329SB31Y2h0S+HTEzvnNCXoGiHj0DhH20YZYhxpLPso= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=no2tfkh+; arc=none smtp.client-ip=216.71.153.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="no2tfkh+" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1712834025; x=1744370025; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oT1EVAZJnb4NrCk2dPNj7oAwzDeLFZ2N2iueMe6JpfU=; b=no2tfkh+nsRqL+FHpJ8uT685MOUiAsauAK31aK1QyDit01TqpuJzAMSf s+TSJJHSvmsHADXw0YWylnJxm7cfzzF3BbAyrOW1DksYtVtPQFFtVGopJ 0DSDsTiV8kzR8LAuZjBekoHnkjPKaVpCaG02UjFo6stiWVREFxjls51jI 2YUjLRPiBNsE1CF0aQjpwiI5vJfbunS2NTQFWy5Cvbix3bGJJ8IRBXSwi 7YkmaoMnLiApb/+jKDH1VBymk0EZuNK16iD02xQwmIz/zSe3hgm4p/E1U Hd9mjj7E7RQXtmGlVbdOdRVbAonoCAHOO1NqukoYdFHIo3YJNoE+0wV4J g==; X-CSE-ConnectionGUID: dNZFlUAzTmSENsKzmBHcIg== X-CSE-MsgGUID: iqQwt1LCSzS3o7CQFZF5Yw== X-IronPort-AV: E=Sophos;i="6.07,193,1708358400"; d="scan'208";a="13579870" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 11 Apr 2024 19:12:34 +0800 IronPort-SDR: 9K4JZO6pbny1897oS3wCYakhect97Zvr2hXYWmlShVfYTv7EpI8+E9Ja2M199J0I91vL8FvdjX fnwwNEE7htcA== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Apr 2024 03:15:20 -0700 IronPort-SDR: bGUrxeWPs8AWgdiANTGQ3QrQgvAC6b12cva/q/4Cv2N4RHhLlS26xLEn1TIk2m1QF3fVQInAjQ JsK/kzVItxKg== WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 11 Apr 2024 04:12:34 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests 05/11] nvme/rc: introduce NVMET_TR_TYPES Date: Thu, 11 Apr 2024 20:12:22 +0900 Message-ID: <20240411111228.2290407-6-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> References: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Some of the test cases in nvme test group can be run under various nvme target transport types. The configuration parameter nvme_trtype specifies the transport to use. But this configuration method has two drawbacks. Firstly, the blktests check script needs to be invoked multiple times to cover multiple transport types. Secondly, the test cases irrelevant to the transport types are executed exactly same conditions in the multiple blktests runs. To avoid the drawbacks, introduce new configuration parameter NVMET_TR_TYPES. This is an array, and multiple transport types can be set like: NVMET_TR_TYPES=(loop tcp) Also introduce _nvmet_set_nvme_trtype() which can be called from the set_conditions() hook of the transport type dependent test cases. Blktests will repeat the test case as many as the number of elements in NVMET_TR_TYPES, and set nvme_trtype for each test case run. Signed-off-by: Shin'ichiro Kawasaki --- Documentation/running-tests.md | 6 +++++- tests/nvme/rc | 30 +++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/Documentation/running-tests.md b/Documentation/running-tests.md index ae80860..ede3a81 100644 --- a/Documentation/running-tests.md +++ b/Documentation/running-tests.md @@ -102,8 +102,12 @@ RUN_ZONED_TESTS=1 The NVMe tests can be additionally parameterized via environment variables. +- NVMET_TR_TYPES (array) + Set up NVME target backends with the specified transport. + Valid elements are 'loop', 'tcp', 'rdma' and 'fc'. Default value is '(loop)'. - nvme_trtype: 'loop' (default), 'tcp', 'rdma' and 'fc' - Run the tests with the given transport. + Run the tests with the given transport. This parameter is still usable but + replaced with NVMET_TR_TYPES. Use NVMET_TR_TYPES instead. - nvme_img_size: '1G' (default) Run the tests with given image size in bytes. 'm', 'M', 'g' and 'G' postfix are supported. diff --git a/tests/nvme/rc b/tests/nvme/rc index 1f5ff44..df6bf77 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -18,10 +18,38 @@ def_hostid="0f01fb42-9f7f-4856-b0b3-51e60b8de349" def_hostnqn="nqn.2014-08.org.nvmexpress:uuid:${def_hostid}" export def_subsysnqn="blktests-subsystem-1" export def_subsys_uuid="91fdba0d-f87b-4c25-b80f-db7be1418b9e" -nvme_trtype=${nvme_trtype:-"loop"} nvme_img_size=${nvme_img_size:-"1G"} nvme_num_iter=${nvme_num_iter:-"1000"} +# Check consistency of NVMET_TR_TYPES and nvme_trtype configurations. +# If neither is configured, set the default value. +first_call=${first_call:-1} +if ((first_call)); then + if [[ -n $nvme_trtype ]]; then + if [[ -n $NVMET_TR_TYPES ]]; then + echo "Both nvme_trtype and NVMET_TR_TYPES are specified" + exit 1 + fi + NVMET_TR_TYPES=("$nvme_trtype") + elif [[ -z ${NVMET_TR_TYPES[*]} ]]; then + nvme_trtype="loop" + NVMET_TR_TYPES=("$nvme_trtype") + fi + first_call=0 +fi + +_set_nvme_trtype() { + local index=$1 + + if [[ -z $index ]]; then + echo ${#NVMET_TR_TYPES[@]} + return + fi + + nvme_trtype=${NVMET_TR_TYPES[index]} + COND_DESC="nvmet tr=${nvme_trtype}" +} + # TMPDIR can not be referred out of test() or test_device() context. Instead of # global variable def_flie_path, use this getter function. _nvme_def_file_path() { From patchwork Thu Apr 11 11:12:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13625753 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61E6A1474C9 for ; Thu, 11 Apr 2024 11:12:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.153.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712833960; cv=none; b=KnjtA0k+I4IUhrR7O2MAhh9i80kSuGtBgjZZQuGZijEn8e7ATXZKP3khQ85mXrihhZemSCwt/8GLimVRWCvR6vJFQceHPNH5uVHsDGR4SM/uDcWjKDZpoJuD+APo1fTnkwjvv3r5BGp6f3ZHMbwshpkF1hOQY7ODSGuopXyHA4o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712833960; c=relaxed/simple; bh=Xe2ouHZKM2kASaDrrzIx5jJXgGT4TAs7T6mgQ8wPqts=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ihBW+yomfseKTwz29laHCHaQjK0D1v5p4nZhAw0gAi0Tc/u7wCX++nTXZPO6qfx6IWy2lsnJQNuSPbysqF5PanNTBwmF8oGiZXowQyTzVBgZQKUX65QdAIvtwHDzkMa9urJ9DKbwNcSXACOiAzV2h0rSHp0mDrovKSRY/1EECVc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=XhaaU6jU; arc=none smtp.client-ip=216.71.153.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="XhaaU6jU" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1712833958; x=1744369958; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Xe2ouHZKM2kASaDrrzIx5jJXgGT4TAs7T6mgQ8wPqts=; b=XhaaU6jUlFn8uZiZNci60/qGW4AKv+f2mtcOs8YcH7VUPIlgkPjS0yTp 1sfAye/BQAIoPFgTamNfD/ztK2+gAS940gUnTXBfHPWkEuG8lMlaSziFP hbc0eJZwcPV/v6hIDDFFouKgTD7QwKfQ8Gae2uSAXfhz4MZ/PPe3tyYoz g0FdX6pZouipmOS67HZj7x7HGT6ughX/lk2+QLJlGRopdv4cbRezR6R8R BNwBELLWXWddw6vkSAeJVRWcVjTLOrhRSVLMjk9CJP7UAIA0mpNixkibr Zn2L8y5+9yFCmkoBIa1YD0HSKrGkRocQKWXeBpTIODsDhxEJNstVcxqx7 w==; X-CSE-ConnectionGUID: GSQ2n6O0ScWjk+WG8qMp0g== X-CSE-MsgGUID: AAgCQcwKQ62sUYftRhG+Yg== X-IronPort-AV: E=Sophos;i="6.07,193,1708358400"; d="scan'208";a="13579874" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 11 Apr 2024 19:12:35 +0800 IronPort-SDR: OHBbbIKS0gSdTKWPChs1+dCZQhMXZNRI6/1RSY5a9DL+6Vhg1xpFhXyLwm9Ll4Bk3aUhjzNOUH dzGfCLNCLdLA== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Apr 2024 03:15:20 -0700 IronPort-SDR: PBEXeBJ9bOh0/zbzWcuZrYr6YwAdEeYo6WjbISbmc8Nt+Xs+tri6hdGbMBcr0UHvayKa4+WH+v F5qdL3VQ4gkg== WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 11 Apr 2024 04:12:35 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests 06/11] nvme/rc: add blkdev type environment variable Date: Thu, 11 Apr 2024 20:12:23 +0900 Message-ID: <20240411111228.2290407-7-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> References: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Daniel Wagner Introduce nvmet_blkdev_type environment variable which allows to control the target setup. This allows us to drop duplicate tests which just differ how the target is setup. Signed-off-by: Daniel Wagner [Shin'ichiro: dropped description in Documentation/running-tests.md] Signed-off-by: Shin'ichiro Kawasaki --- tests/nvme/rc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/nvme/rc b/tests/nvme/rc index df6bf77..d51f623 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -20,6 +20,7 @@ export def_subsysnqn="blktests-subsystem-1" export def_subsys_uuid="91fdba0d-f87b-4c25-b80f-db7be1418b9e" nvme_img_size=${nvme_img_size:-"1G"} nvme_num_iter=${nvme_num_iter:-"1000"} +nvmet_blkdev_type=${nvmet_blkdev_type:-"device"} # Check consistency of NVMET_TR_TYPES and nvme_trtype configurations. # If neither is configured, set the default value. @@ -854,7 +855,7 @@ _find_nvme_passthru_loop_dev() { } _nvmet_target_setup() { - local blkdev_type="device" + local blkdev_type="${nvmet_blkdev_type}" local blkdev local ctrlkey="" local hostkey="" From patchwork Thu Apr 11 11:12:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13625754 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9EC01482E4 for ; Thu, 11 Apr 2024 11:12:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.153.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712833961; cv=none; b=jhswD+hGI5ikUbk4pwTCVL2CeRkXle+zeNlsUxwdopBMBDG8arPnJiYax29vvhHPYh+gn9k97PDTC3oPDXBXg34jd61sA8YMQ+i4VQUnIML0ZcVZxfROUiRQjytC7XPYREAbwR9MqppkF/sUBAUIuK96kX/bz5TR5AU3Q2LwDxY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712833961; c=relaxed/simple; bh=0dEVP8079QDShYaAiKf9wK3Q+gWxerIusvSgNLm1mn0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Duq90NHfMPqchXqDkdiOcQvL5yjYQxMuvQO+xUC2saWZtbPID9lBFAQIiVR7AmqgCBXj+VzWev+Hy6ajjZLz37aabP+i4EYsT6tUcyDf3cMm5dUmqzxS+l29P0RXD+LSjTehIVq1B8cttPiWdmySB7R7wdefVg2R7oB3kCdUyz8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=bggW3aIH; arc=none smtp.client-ip=216.71.153.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="bggW3aIH" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1712833960; x=1744369960; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0dEVP8079QDShYaAiKf9wK3Q+gWxerIusvSgNLm1mn0=; b=bggW3aIHmaGRifR066AmU33O4P5m9+eivDewww5K95ZP45J9VzhTh/5m b/Zi1FcHhfErDXn/GT2KXd3W/+Vg4dVr/iE/oolwgkRLjEKQ+3dkiPGMM eUnt6EIou8Mw2KoDCQJprtHZ8b6L8rcoJm6GAuSgx2tgvzw4HOv7owHzt B1FMspv976DtS/x0y8CKoWym19TMrSEu3sdx4nMhGFds8smwaQINsdOxI BhskaSH4PmA+RRkaDx2WRj2EQx1oyIrR/44cixwn3K/aj/JXyw2T3hJ4J nCObJe5X7+1t0Kub5cdMFK9eU/d91/p6OqH0zGvDC9rcnaPrP9H4ovHSg w==; X-CSE-ConnectionGUID: Q86+GWt5TCeUqr2Exow+ZQ== X-CSE-MsgGUID: AyLQZ7xtRd+G/kweWKxRtA== X-IronPort-AV: E=Sophos;i="6.07,193,1708358400"; d="scan'208";a="13579877" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 11 Apr 2024 19:12:36 +0800 IronPort-SDR: bApv/fxB5BzlyOBcNllrvDJ5Io9Lxg2JjKhtgKn/KPMR5VDLuhZnYPDyvYJjqcqcchqkyl6YQL XHjqlP1H8jdA== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Apr 2024 03:15:21 -0700 IronPort-SDR: RoaQMkeK6dYXYX5Q91RFE2NFWnktHdoz9Uwq9S9w8aNWtgVnSBuReyoFEjn9iXC6uQ3YCqq/5p DHVU8bNfZqQQ== WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 11 Apr 2024 04:12:36 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests 07/11] nvme/rc: introduce NVMET_BLKDEV_TYPES Date: Thu, 11 Apr 2024 20:12:24 +0900 Message-ID: <20240411111228.2290407-8-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> References: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Some of the test cases in nvme test group do exact same test for two blkdev types: deice type and file type. Except for this difference, the test cases are pure duplication. It is desired to avoid the duplication. When the duplication is avoided, still it is required to control which condition to run the test. To avoid the duplication and also to allow the blkdev type control, introduce a new configuration parameter NVMET_BLKDEV_TYPES. This is an array to hold default values (device file). Also add the helper function _set_nvme_trtype_and_nvmet_blkdev_type(). It sets up nvmet_blkdev_type variable for each test case run from NVMET_BLKDEV_TYPES. It also sets nvme_trtype from NVMET_TR_TYPES. When NVMET_BLKDEV_TYPES and NVMET_TR_TYPES are set as follows, the test case with _set_nvme_trtype_and_nvmet_blkdev_type in set_condition() hook is called 2 x 3 = 6 times. NVMET_BLKDEV_TYPES=(device file) NVMET_TR_TYPES=(loop rdma tcp) Signed-off-by: Shin'ichiro Kawasaki --- Documentation/running-tests.md | 3 +++ tests/nvme/rc | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/Documentation/running-tests.md b/Documentation/running-tests.md index ede3a81..ca11f58 100644 --- a/Documentation/running-tests.md +++ b/Documentation/running-tests.md @@ -108,6 +108,9 @@ The NVMe tests can be additionally parameterized via environment variables. - nvme_trtype: 'loop' (default), 'tcp', 'rdma' and 'fc' Run the tests with the given transport. This parameter is still usable but replaced with NVMET_TR_TYPES. Use NVMET_TR_TYPES instead. +- NVMET_BLOCK_DEV_TYPES (array) + Set up NVME target backends with the specified block device type. + Valid elements are 'device' and 'file'. Default value is '(device file)'. - nvme_img_size: '1G' (default) Run the tests with given image size in bytes. 'm', 'M', 'g' and 'G' postfix are supported. diff --git a/tests/nvme/rc b/tests/nvme/rc index d51f623..c1a14a1 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -21,6 +21,7 @@ export def_subsys_uuid="91fdba0d-f87b-4c25-b80f-db7be1418b9e" nvme_img_size=${nvme_img_size:-"1G"} nvme_num_iter=${nvme_num_iter:-"1000"} nvmet_blkdev_type=${nvmet_blkdev_type:-"device"} +[[ -z $NVMET_BLKDEV_TYPES ]] && NVMET_BLKDEV_TYPES=(device file) # Check consistency of NVMET_TR_TYPES and nvme_trtype configurations. # If neither is configured, set the default value. @@ -51,6 +52,21 @@ _set_nvme_trtype() { COND_DESC="nvmet tr=${nvme_trtype}" } +_set_nvme_trtype_and_nvmet_blkdev_type() { + local index=$1 + local bd_index=$((index / ${#NVMET_TR_TYPES[@]})) + local tr_index=$((index % ${#NVMET_TR_TYPES[@]})) + + if [[ -z $index ]]; then + echo $(( ${#NVMET_BLKDEV_TYPES[@]} * ${#NVMET_TR_TYPES[@]} )) + return + fi + + nvmet_blkdev_type=${NVMET_BLKDEV_TYPES[bd_index]} + nvme_trtype=${NVMET_TR_TYPES[tr_index]} + COND_DESC="nvmet bd=${nvmet_blkdev_type} tr=${nvme_trtype}" +} + # TMPDIR can not be referred out of test() or test_device() context. Instead of # global variable def_flie_path, use this getter function. _nvme_def_file_path() { From patchwork Thu Apr 11 11:12:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13625755 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73149148319 for ; Thu, 11 Apr 2024 11:12:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.153.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712833962; cv=none; b=pPXG/zs4KYyivzdewDMPjbMcKdUhe2uocqEsQwTYk+dPOopPAU0XCuf0bQNlu33rUcKfeFwl37v7HjySZFyyr7/kILMArM6JnejFjIuVbY2BSXwVW0CXdyJWM10A56efvxHh7GMIcJ62jrUKKiiuOIHyk0brds1gqSXjpN+bSGw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712833962; c=relaxed/simple; bh=xgvR0GKIV7o3R7lb/vi7v0gK/JTihRSWYckV0hgZ1YE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oiEme3y6zW4mxr2HpMzRRDRpCTurxXTR1ce21jAobxxyQCeLGzb1HlsJ+I8APIgELUpMGLMr2t+bS9UCscOKdV8/I0LV7dsE/WBVitlSK2FI3rc7vG7h2JTyu+z4TXtkyVedWw/E57MnZ/x9rSNLogorOWVUg/9ZIQh1ShikymA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=Jkw7MMBJ; arc=none smtp.client-ip=216.71.153.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="Jkw7MMBJ" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1712833960; x=1744369960; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xgvR0GKIV7o3R7lb/vi7v0gK/JTihRSWYckV0hgZ1YE=; b=Jkw7MMBJhymd/eft3epANi5y5NAHIl0t/eZDqcUVBf/G7mCimN3lLhl0 XXUowpa2aIhNmA4eUEJz8ifdpaahVELbFKS3tBcH6nNY/H0XEDnXqb2LY rCqv97bGeNltoJ8GJvQu6PiuG3xiTMCM8+LK68HGHG1CndL6zLp91weNR ZjVgQ9VKyzGzsUFAMXbYMb2NCLti3Ic34xXSHJdYMES6cj2mb1Ps0KNuy hDO10RbfanZsTkXQQvo8aN6UQjgAZ7PEqgY+WD8ANmX7LSY2W/HbNQl/5 /bNArt9eIjzNiBAAd4oG41I8fg5ksdlMVsrrnq+RPef/KEgogHZEDSBD0 A==; X-CSE-ConnectionGUID: 44mX/QCDQ0eN8m284tHC0g== X-CSE-MsgGUID: h55x2PYeTuCf2UzQSJGjpA== X-IronPort-AV: E=Sophos;i="6.07,193,1708358400"; d="scan'208";a="13579879" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 11 Apr 2024 19:12:37 +0800 IronPort-SDR: zwsXkk/ZTrUbbVwc+rZD8URRlZ/gAPYjIIzIH9Z5b26CmZimwcbVkSUYmnguH/oGfSmFZNblho rX+zjZ03EF6A== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Apr 2024 03:15:22 -0700 IronPort-SDR: +yeKmO0zfSjAsJ9NUSgeLzRdLWyLawKV4QW3/pywGNCPB7S8udwsMci9LlC/Pv74niN7btAZAq B6V69VaICwAg== WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 11 Apr 2024 04:12:37 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests 08/11] nvme/{002-031,033-038,040-045,047,048}: support NMVET_TR_TYPES Date: Thu, 11 Apr 2024 20:12:25 +0900 Message-ID: <20240411111228.2290407-9-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> References: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add set_conditions() hook and call _set_nvme_trtype() so that the test cases are repeated for NMVET_TR_TYPES. Signed-off-by: Shin'ichiro Kawasaki --- tests/nvme/002 | 4 ++++ tests/nvme/003 | 4 ++++ tests/nvme/004 | 4 ++++ tests/nvme/005 | 4 ++++ tests/nvme/006 | 4 ++++ tests/nvme/007 | 4 ++++ tests/nvme/008 | 4 ++++ tests/nvme/009 | 4 ++++ tests/nvme/010 | 4 ++++ tests/nvme/011 | 4 ++++ tests/nvme/012 | 4 ++++ tests/nvme/013 | 4 ++++ tests/nvme/014 | 4 ++++ tests/nvme/015 | 4 ++++ tests/nvme/016 | 4 ++++ tests/nvme/017 | 4 ++++ tests/nvme/018 | 4 ++++ tests/nvme/019 | 4 ++++ tests/nvme/020 | 4 ++++ tests/nvme/021 | 4 ++++ tests/nvme/022 | 4 ++++ tests/nvme/023 | 4 ++++ tests/nvme/024 | 4 ++++ tests/nvme/025 | 4 ++++ tests/nvme/026 | 4 ++++ tests/nvme/027 | 4 ++++ tests/nvme/028 | 4 ++++ tests/nvme/029 | 4 ++++ tests/nvme/030 | 4 ++++ tests/nvme/031 | 4 ++++ tests/nvme/033 | 4 ++++ tests/nvme/034 | 4 ++++ tests/nvme/035 | 4 ++++ tests/nvme/036 | 4 ++++ tests/nvme/037 | 4 ++++ tests/nvme/038 | 4 ++++ tests/nvme/040 | 4 ++++ tests/nvme/041 | 3 +++ tests/nvme/042 | 3 +++ tests/nvme/043 | 3 +++ tests/nvme/044 | 3 +++ tests/nvme/045 | 3 +++ tests/nvme/047 | 4 ++++ tests/nvme/048 | 4 ++++ 44 files changed, 171 insertions(+) diff --git a/tests/nvme/002 b/tests/nvme/002 index 6b84848..f613c78 100755 --- a/tests/nvme/002 +++ b/tests/nvme/002 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_loop } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/003 b/tests/nvme/003 index be6b4e1..b70f46a 100755 --- a/tests/nvme/003 +++ b/tests/nvme/003 @@ -17,6 +17,10 @@ requires() { _have_writeable_kmsg } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/004 b/tests/nvme/004 index b751746..a6b4949 100755 --- a/tests/nvme/004 +++ b/tests/nvme/004 @@ -17,6 +17,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/005 b/tests/nvme/005 index f17174d..66c12fd 100755 --- a/tests/nvme/005 +++ b/tests/nvme/005 @@ -16,6 +16,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/006 b/tests/nvme/006 index d85f64b..a0c4096 100755 --- a/tests/nvme/006 +++ b/tests/nvme/006 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/007 b/tests/nvme/007 index b142435..3b16d5f 100755 --- a/tests/nvme/007 +++ b/tests/nvme/007 @@ -14,6 +14,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/008 b/tests/nvme/008 index a5d0681..1877d8a 100755 --- a/tests/nvme/008 +++ b/tests/nvme/008 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/009 b/tests/nvme/009 index a1655d4..d7b1307 100755 --- a/tests/nvme/009 +++ b/tests/nvme/009 @@ -14,6 +14,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/010 b/tests/nvme/010 index 6feb391..34914a7 100755 --- a/tests/nvme/010 +++ b/tests/nvme/010 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/011 b/tests/nvme/011 index 4810459..bd29129 100755 --- a/tests/nvme/011 +++ b/tests/nvme/011 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/012 b/tests/nvme/012 index 64cb6ec..e06bf8d 100755 --- a/tests/nvme/012 +++ b/tests/nvme/012 @@ -19,6 +19,10 @@ requires() { _require_nvme_test_img_size 350m } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/013 b/tests/nvme/013 index 24fc910..91da498 100755 --- a/tests/nvme/013 +++ b/tests/nvme/013 @@ -18,6 +18,10 @@ requires() { _require_nvme_test_img_size 350m } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/014 b/tests/nvme/014 index 839b91f..ff0ebfb 100755 --- a/tests/nvme/014 +++ b/tests/nvme/014 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/015 b/tests/nvme/015 index f0621da..b5ec10c 100755 --- a/tests/nvme/015 +++ b/tests/nvme/015 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/016 b/tests/nvme/016 index 908abbd..a65cffd 100755 --- a/tests/nvme/016 +++ b/tests/nvme/016 @@ -13,6 +13,10 @@ requires() { _require_nvme_trtype_is_loop } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/017 b/tests/nvme/017 index c8d9b32..9410cdc 100755 --- a/tests/nvme/017 +++ b/tests/nvme/017 @@ -13,6 +13,10 @@ requires() { _require_nvme_trtype_is_loop } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/018 b/tests/nvme/018 index b8c1635..5b0f57b 100755 --- a/tests/nvme/018 +++ b/tests/nvme/018 @@ -16,6 +16,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/019 b/tests/nvme/019 index 1cd5378..31020d9 100755 --- a/tests/nvme/019 +++ b/tests/nvme/019 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/020 b/tests/nvme/020 index 0364c4e..4993e36 100755 --- a/tests/nvme/020 +++ b/tests/nvme/020 @@ -14,6 +14,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/021 b/tests/nvme/021 index 7ee1f07..270d90e 100755 --- a/tests/nvme/021 +++ b/tests/nvme/021 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/022 b/tests/nvme/022 index 7ce33dd..adaa765 100755 --- a/tests/nvme/022 +++ b/tests/nvme/022 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/023 b/tests/nvme/023 index d8f17ae..da99406 100755 --- a/tests/nvme/023 +++ b/tests/nvme/023 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/024 b/tests/nvme/024 index a512194..cab1818 100755 --- a/tests/nvme/024 +++ b/tests/nvme/024 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/025 b/tests/nvme/025 index 3f9a615..224492b 100755 --- a/tests/nvme/025 +++ b/tests/nvme/025 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/026 b/tests/nvme/026 index 28fd151..6ee6a51 100755 --- a/tests/nvme/026 +++ b/tests/nvme/026 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/027 b/tests/nvme/027 index 053fd58..a63e42b 100755 --- a/tests/nvme/027 +++ b/tests/nvme/027 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/028 b/tests/nvme/028 index 9f4a905..65c52a9 100755 --- a/tests/nvme/028 +++ b/tests/nvme/028 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/029 b/tests/nvme/029 index 559c0b4..10acc58 100755 --- a/tests/nvme/029 +++ b/tests/nvme/029 @@ -16,6 +16,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test_user_io() { local disk="$1" diff --git a/tests/nvme/030 b/tests/nvme/030 index 9251e17..b1ed8bc 100755 --- a/tests/nvme/030 +++ b/tests/nvme/030 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/031 b/tests/nvme/031 index 0bf823d..b98630a 100755 --- a/tests/nvme/031 +++ b/tests/nvme/031 @@ -23,6 +23,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/033 b/tests/nvme/033 index 70a73b8..7a69b94 100755 --- a/tests/nvme/033 +++ b/tests/nvme/033 @@ -13,6 +13,10 @@ requires() { _have_kernel_option NVME_TARGET_PASSTHRU } +set_conditions() { + _set_nvme_trtype "$@" +} + nvme_info() { local ns=$1 diff --git a/tests/nvme/034 b/tests/nvme/034 index 409324a..522ffe3 100755 --- a/tests/nvme/034 +++ b/tests/nvme/034 @@ -14,6 +14,10 @@ requires() { _have_fio } +set_conditions() { + _set_nvme_trtype "$@" +} + test_device() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/035 b/tests/nvme/035 index ecf6b72..cfca5fd 100755 --- a/tests/nvme/035 +++ b/tests/nvme/035 @@ -20,6 +20,10 @@ device_requires() { _require_test_dev_size "${nvme_img_size}" } +set_conditions() { + _set_nvme_trtype "$@" +} + test_device() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/036 b/tests/nvme/036 index 36ea792..ef6c29d 100755 --- a/tests/nvme/036 +++ b/tests/nvme/036 @@ -13,6 +13,10 @@ requires() { _have_kernel_option NVME_TARGET_PASSTHRU } +set_conditions() { + _set_nvme_trtype "$@" +} + test_device() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/037 b/tests/nvme/037 index 66d6656..ef7ac59 100755 --- a/tests/nvme/037 +++ b/tests/nvme/037 @@ -12,6 +12,10 @@ requires() { _have_kernel_option NVME_TARGET_PASSTHRU } +set_conditions() { + _set_nvme_trtype "$@" +} + test_device() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/038 b/tests/nvme/038 index 007b5f4..8435415 100755 --- a/tests/nvme/038 +++ b/tests/nvme/038 @@ -18,6 +18,10 @@ requires() { _nvme_requires } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/040 b/tests/nvme/040 index bb9ed5e..9536f35 100755 --- a/tests/nvme/040 +++ b/tests/nvme/040 @@ -16,6 +16,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/041 b/tests/nvme/041 index f1fa00c..aa44f04 100755 --- a/tests/nvme/041 +++ b/tests/nvme/041 @@ -19,6 +19,9 @@ requires() { _require_nvme_cli_auth } +set_conditions() { + _set_nvme_trtype "$@" +} test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/042 b/tests/nvme/042 index a9e79c6..70c9056 100755 --- a/tests/nvme/042 +++ b/tests/nvme/042 @@ -19,6 +19,9 @@ requires() { _require_nvme_cli_auth } +set_conditions() { + _set_nvme_trtype "$@" +} test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/043 b/tests/nvme/043 index 4589423..cf99865 100755 --- a/tests/nvme/043 +++ b/tests/nvme/043 @@ -20,6 +20,9 @@ requires() { _have_driver dh_generic } +set_conditions() { + _set_nvme_trtype "$@" +} test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/044 b/tests/nvme/044 index 8b88590..9ed46c9 100755 --- a/tests/nvme/044 +++ b/tests/nvme/044 @@ -20,6 +20,9 @@ requires() { _have_driver dh_generic } +set_conditions() { + _set_nvme_trtype "$@" +} test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/045 b/tests/nvme/045 index f387ead..be81316 100755 --- a/tests/nvme/045 +++ b/tests/nvme/045 @@ -21,6 +21,9 @@ requires() { _have_driver dh_generic } +set_conditions() { + _set_nvme_trtype "$@" +} test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/047 b/tests/nvme/047 index 9bbe84d..1ab68f8 100755 --- a/tests/nvme/047 +++ b/tests/nvme/047 @@ -17,6 +17,10 @@ requires() { _have_kver 4 21 } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/048 b/tests/nvme/048 index 0b299a9..bd41fae 100755 --- a/tests/nvme/048 +++ b/tests/nvme/048 @@ -15,6 +15,10 @@ requires() { _require_min_cpus 2 } +set_conditions() { + _set_nvme_trtype "$@" +} + nvmf_wait_for_state() { local def_state_timeout=5 local subsys_name="$1" From patchwork Thu Apr 11 11:12:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13625756 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0C4F14885A for ; Thu, 11 Apr 2024 11:12:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.153.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712833963; cv=none; b=W4FT6iyK3EsONFDflRNfY1qpB6Xx9fi4vMWhJjfnK8pWe3B/RYh6zc2zsXFft4TRsver9yye28QbUw/N5sy+BtGQ6pt1C2w3kLUgBUlBNwJrJrjISff/p0gKeEPfigQX/Ak+fttyJL3VNkSOHDGuTA/R4SBL4qDjeBRjXaLW/sk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712833963; c=relaxed/simple; bh=a3mYw5dZYWpBYbWDrYxR2B8qW/L5n4xS8Y3bHI8WHVE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z6GqblNjyhv5lN0+aK7crNffSX8zBbNGPSuqQfKPOqUno6ddHwT3YeT/uWWvMG09mhqejYYj13k7+xPkJDsBqubLM32+QLzld/FaWK8FkJF/WctgH1SkGXy0T7MipBz5F/AIMkBP1CV1aLWuXYEpqBzPia9O9UHsPtjqFDfy45Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=COg16XgT; arc=none smtp.client-ip=216.71.153.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="COg16XgT" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1712833962; x=1744369962; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=a3mYw5dZYWpBYbWDrYxR2B8qW/L5n4xS8Y3bHI8WHVE=; b=COg16XgTZq5xXj4YpIGART4UpvP5Ll6OX8lTCI1I+sKAXoThy4YI5+/O NIam58maefqk3CEhOA0Pi6XXW64kw3S0NyLEAlDjl8r9/sXt850kpZl8e 4BMfxMw/A8DtI8L4JbBieCzmbqZ27pPtgBZyrPpdUg7oZLxosPT/8kn7F yEJsnA9VrqUJg1x6x8O6FK1/S5sL74tv4bxf4d5CzLOj3RD4RJdEeJBwq YQheb6WtIG7Wi3onlHoYHGTcIqpwpdt84vP9DQkVf2m7tVDbQsybRCBs9 J712sGJCHvS9KPk6oet0oQmq4a2hPahMXK/LWPrSVajA8RCGZAyCUhX2+ g==; X-CSE-ConnectionGUID: V+stwwoCRZyOMUNGi9o5ug== X-CSE-MsgGUID: MuTTxHGmTl6yTGd4VfcSfQ== X-IronPort-AV: E=Sophos;i="6.07,193,1708358400"; d="scan'208";a="13579884" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 11 Apr 2024 19:12:38 +0800 IronPort-SDR: qxu10wHl7EqCpRizKLiNaUQvtcNs5cCwhFsDV9mLu7OSPRFeFJiaXBI8fg3mHFNWlRGyH6dq7u J5HGHJKG4yhA== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Apr 2024 03:15:23 -0700 IronPort-SDR: sV749hVlOpjLYpNX1/Pd3VMuUlK0ngrRFfdB1j0RvYN0c6OTJqgZA4UrV6WBIMXt1WOl73hr3A RltqBp/MfExg== WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 11 Apr 2024 04:12:38 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests 09/11] nvme/{006,008,010,012,014,019,023}: support NVMET_BLKDEV_TYPES Date: Thu, 11 Apr 2024 20:12:26 +0900 Message-ID: <20240411111228.2290407-10-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> References: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Enable repeated test runs for the listed test cases for NVMET_BLKDEV_TYPES. Modify the set_conditions() hooks to call _set_nvme_trtype_and_nvmet_blkdev_type() instead of _set_nvmet_trtype() so that the test cases are repeated for listed conditions in NVMET_BLKDEV_TYPES and NVMET_TR_TYPES. The default values of NVMET_BLKDEV_TYPES is (device file). With this default set up, each of the listed test cases are run twice. The second runs of the test cases for 'file' blkdev type do exact same test as other test cases nvme/007, 009, 011, 013, 015, 020 and 024. Signed-off-by: Shin'ichiro Kawasaki --- tests/nvme/006 | 2 +- tests/nvme/008 | 2 +- tests/nvme/010 | 2 +- tests/nvme/012 | 2 +- tests/nvme/014 | 2 +- tests/nvme/019 | 2 +- tests/nvme/023 | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/nvme/006 b/tests/nvme/006 index a0c4096..0e1f142 100755 --- a/tests/nvme/006 +++ b/tests/nvme/006 @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { diff --git a/tests/nvme/008 b/tests/nvme/008 index 1877d8a..b53ecdb 100755 --- a/tests/nvme/008 +++ b/tests/nvme/008 @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { diff --git a/tests/nvme/010 b/tests/nvme/010 index 34914a7..0417daf 100755 --- a/tests/nvme/010 +++ b/tests/nvme/010 @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { diff --git a/tests/nvme/012 b/tests/nvme/012 index e06bf8d..37b9056 100755 --- a/tests/nvme/012 +++ b/tests/nvme/012 @@ -20,7 +20,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { diff --git a/tests/nvme/014 b/tests/nvme/014 index ff0ebfb..bcfbc87 100755 --- a/tests/nvme/014 +++ b/tests/nvme/014 @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { diff --git a/tests/nvme/019 b/tests/nvme/019 index 31020d9..fb11d41 100755 --- a/tests/nvme/019 +++ b/tests/nvme/019 @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { diff --git a/tests/nvme/023 b/tests/nvme/023 index da99406..a723b73 100755 --- a/tests/nvme/023 +++ b/tests/nvme/023 @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { From patchwork Thu Apr 11 11:12:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13625757 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFC1A149C4F for ; Thu, 11 Apr 2024 11:12:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.153.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712833964; cv=none; b=l9uIBIGtqXS36nrxRAbkebn+njmmXQatW6OvXon6mEWq/7AZ8gEGnUUnYPuFzFOAFAo2xElDez2KAAzj3/kb+pTVKKHDYEWgYG8lSB+zZrys2OqVskOAuTb4e/5I29Ihng8gzti6wJLCiAyTr87DDIOI9uY9ZJ8Wvr2AarJyc+c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712833964; c=relaxed/simple; bh=HvJF2shEgndKaExsvjj2e8YuMaD5oXBayXp85FAgT6U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mfjPTfcj31gwlmRYQ8eGupysVTeGBd2g1f9ZOP2ddwo3MUAK/N/1/J4ECZ/fvTvB5BOelkImjjgVprF0eGogE/xWjYwsOJKJiRPoGF92WpUrEakAqqBG6Io1f6oYLINtpaDzehntvZIvwzYJlCE7LEQfNcW3S/yKxFTJ94XblmA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=P/j9Gwry; arc=none smtp.client-ip=216.71.153.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="P/j9Gwry" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1712833963; x=1744369963; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HvJF2shEgndKaExsvjj2e8YuMaD5oXBayXp85FAgT6U=; b=P/j9Gwry/Yie4M6bmhTpJdTfig0R1D2E3Ybln4rLAYWBLiCnD+Z8AEOW fWl3W1bvcJ/2X/hi33b4MCCS6XNBwKLl0l8Oivkumyj9rZv8tynISb/Gz ibLbQMCw5DSegRb/hczG9RZCuWpNAk+wCf68WAkeIhWFLDiHaUGFGHyLM P6d8OQqw/IYMQtEgde/7sJjdRZcEbw5qpZiiA/aMxPdhwL3uzEl7Fnqby 19hRgEeeAKl1z+DdhD/ZsWHkZxNLRN2IPeKNjGMM1kKM+9hfqSTzrtxDe 5R05aiorUHDI+EM0kAczFYHRA0kzfFR725pudnH11evzMCurQzlDw+SfX Q==; X-CSE-ConnectionGUID: CQyhDyo9S/CbS5OxbumFbQ== X-CSE-MsgGUID: ZuvNc5XCQ3aWmapP8kI9Vw== X-IronPort-AV: E=Sophos;i="6.07,193,1708358400"; d="scan'208";a="13579886" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 11 Apr 2024 19:12:39 +0800 IronPort-SDR: 7fhvCVy7YUDX+n6wfv6yBVHGByRKWJKvl1/I2JcwvdHZt6VuaFCNpJwcsI/sKjt77WTexVWIAt kj0ObWeNMwgw== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Apr 2024 03:15:24 -0700 IronPort-SDR: F6cKlSWRv5LS+3qU6fcRI50lPVdWnwx+Hr1aqZnpALmv9JQ8rgwM30knYmI7D7AZ88f+dnMWk3 TIB/729VZYrg== WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 11 Apr 2024 04:12:39 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests 10/11] nvme/{007,009,011,013,015,020,024}: drop duplicate nvmet blkdev type tests Date: Thu, 11 Apr 2024 20:12:27 +0900 Message-ID: <20240411111228.2290407-11-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> References: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Daniel Wagner There are various tests which only differ on the blkdev type of the target. With the newly added feature which allows to control the target blkdev type via the environment, these duplicate tests are not necessary anymore and reduces the maintenance overhead. The removed tests are covered by the other test cases nvme/006 ,008, 010, 012, 014, 019 and 023 using 'file' blkdev type. Signed-off-by: Daniel Wagner Signed-off-by: Shin'ichiro Kawasaki --- tests/nvme/006 | 5 ++--- tests/nvme/007 | 32 ---------------------------- tests/nvme/007.out | 2 -- tests/nvme/008 | 4 ++-- tests/nvme/009 | 40 ----------------------------------- tests/nvme/009.out | 3 --- tests/nvme/010 | 4 ++-- tests/nvme/011 | 43 -------------------------------------- tests/nvme/011.out | 3 --- tests/nvme/012 | 4 ++-- tests/nvme/013 | 47 ----------------------------------------- tests/nvme/013.out | 3 --- tests/nvme/014 | 4 ++-- tests/nvme/015 | 52 ---------------------------------------------- tests/nvme/015.out | 4 ---- tests/nvme/019 | 4 ++-- tests/nvme/020 | 44 --------------------------------------- tests/nvme/020.out | 4 ---- tests/nvme/023 | 4 ++-- tests/nvme/024 | 44 --------------------------------------- tests/nvme/024.out | 2 -- 21 files changed, 14 insertions(+), 338 deletions(-) delete mode 100755 tests/nvme/007 delete mode 100644 tests/nvme/007.out delete mode 100755 tests/nvme/009 delete mode 100644 tests/nvme/009.out delete mode 100755 tests/nvme/011 delete mode 100644 tests/nvme/011.out delete mode 100755 tests/nvme/013 delete mode 100644 tests/nvme/013.out delete mode 100755 tests/nvme/015 delete mode 100644 tests/nvme/015.out delete mode 100755 tests/nvme/020 delete mode 100644 tests/nvme/020.out delete mode 100755 tests/nvme/024 delete mode 100644 tests/nvme/024.out diff --git a/tests/nvme/006 b/tests/nvme/006 index 0e1f142..0ea679b 100755 --- a/tests/nvme/006 +++ b/tests/nvme/006 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMeOF target creation with a block device backed ns. +# Test NVMeOF target creation. . tests/nvme/rc -DESCRIPTION="create an NVMeOF target with a block device-backed ns" +DESCRIPTION="create an NVMeOF target" QUICK=1 requires() { @@ -24,7 +24,6 @@ test() { _setup_nvmet - _nvmet_target_setup _nvmet_target_cleanup diff --git a/tests/nvme/007 b/tests/nvme/007 deleted file mode 100755 index 3b16d5f..0000000 --- a/tests/nvme/007 +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# Test NVMeOF target creation with a file backed ns. - -. tests/nvme/rc - -DESCRIPTION="create an NVMeOF target with a file-backed ns" -QUICK=1 - -requires() { - _nvme_requires - _require_nvme_trtype_is_fabrics -} - -set_conditions() { - _set_nvme_trtype "$@" -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - - _nvmet_target_setup --blkdev file - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/007.out b/tests/nvme/007.out deleted file mode 100644 index fdb3472..0000000 --- a/tests/nvme/007.out +++ /dev/null @@ -1,2 +0,0 @@ -Running nvme/007 -Test complete diff --git a/tests/nvme/008 b/tests/nvme/008 index b53ecdb..838eb07 100755 --- a/tests/nvme/008 +++ b/tests/nvme/008 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMeOF host creation with a block device backed ns. +# Test NVMeOF host creation. . tests/nvme/rc -DESCRIPTION="create an NVMeOF host with a block device-backed ns" +DESCRIPTION="create an NVMeOF host" QUICK=1 requires() { diff --git a/tests/nvme/009 b/tests/nvme/009 deleted file mode 100755 index d7b1307..0000000 --- a/tests/nvme/009 +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# Test NVMeOF host creation with a file backed ns. - -. tests/nvme/rc - -DESCRIPTION="create an NVMeOF host with a file-backed ns" -QUICK=1 - -requires() { - _nvme_requires - _require_nvme_trtype_is_fabrics -} - -set_conditions() { - _set_nvme_trtype "$@" -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - local nvmedev - - _nvmet_target_setup --blkdev file - - _nvme_connect_subsys - - nvmedev=$(_find_nvme_dev "${def_subsysnqn}") - _check_uuid "${nvmedev}" - - _nvme_disconnect_subsys - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/009.out b/tests/nvme/009.out deleted file mode 100644 index 4d53a8e..0000000 --- a/tests/nvme/009.out +++ /dev/null @@ -1,3 +0,0 @@ -Running nvme/009 -disconnected 1 controller(s) -Test complete diff --git a/tests/nvme/010 b/tests/nvme/010 index 0417daf..9ea2561 100755 --- a/tests/nvme/010 +++ b/tests/nvme/010 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# This is a data verification test for block device backed ns. +# This is a data verification test. . tests/nvme/rc -DESCRIPTION="run data verification fio job on NVMeOF block device-backed ns" +DESCRIPTION="run data verification fio job" TIMED=1 requires() { diff --git a/tests/nvme/011 b/tests/nvme/011 deleted file mode 100755 index bd29129..0000000 --- a/tests/nvme/011 +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# This is a data verification test for file backed ns. - -. tests/nvme/rc - -DESCRIPTION="run data verification fio job on NVMeOF file-backed ns" -TIMED=1 - -requires() { - _nvme_requires - _have_fio - _require_nvme_trtype_is_fabrics -} - -set_conditions() { - _set_nvme_trtype "$@" -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - local ns - - _nvmet_target_setup --blkdev file - - _nvme_connect_subsys - - ns=$(_find_nvme_ns "${def_subsys_uuid}") - - _run_fio_verify_io --size="${nvme_img_size}" \ - --filename="/dev/${ns}" - - _nvme_disconnect_subsys - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/011.out b/tests/nvme/011.out deleted file mode 100644 index ebbb4f7..0000000 --- a/tests/nvme/011.out +++ /dev/null @@ -1,3 +0,0 @@ -Running nvme/011 -disconnected 1 controller(s) -Test complete diff --git a/tests/nvme/012 b/tests/nvme/012 index 37b9056..d0eb487 100755 --- a/tests/nvme/012 +++ b/tests/nvme/012 @@ -2,12 +2,12 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test mkfs with data verification for block device backed ns. +# Test mkfs with data verification. . tests/nvme/rc . common/xfs -DESCRIPTION="run mkfs and data verification fio job on NVMeOF block device-backed ns" +DESCRIPTION="run mkfs and data verification fio" TIMED=1 requires() { diff --git a/tests/nvme/013 b/tests/nvme/013 deleted file mode 100755 index 91da498..0000000 --- a/tests/nvme/013 +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# Test mkfs with data verification for file backed ns. - -. tests/nvme/rc -. common/xfs - -DESCRIPTION="run mkfs and data verification fio job on NVMeOF file-backed ns" -TIMED=1 - -requires() { - _nvme_requires - _have_xfs - _have_fio - _require_nvme_trtype_is_fabrics - _require_nvme_test_img_size 350m -} - -set_conditions() { - _set_nvme_trtype "$@" -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - local ns - - _nvmet_target_setup --blkdev file - - _nvme_connect_subsys - - ns=$(_find_nvme_ns "${def_subsys_uuid}") - - if ! _xfs_run_fio_verify_io "/dev/${ns}"; then - echo "FAIL: fio verify failed" - fi - - _nvme_disconnect_subsys - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/013.out b/tests/nvme/013.out deleted file mode 100644 index a727170..0000000 --- a/tests/nvme/013.out +++ /dev/null @@ -1,3 +0,0 @@ -Running nvme/013 -disconnected 1 controller(s) -Test complete diff --git a/tests/nvme/014 b/tests/nvme/014 index bcfbc87..1429180 100755 --- a/tests/nvme/014 +++ b/tests/nvme/014 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMeOF flush command from host with a block device backed ns. +# Test NVMeOF flush command from host. . tests/nvme/rc -DESCRIPTION="flush a NVMeOF block device-backed ns" +DESCRIPTION="flush a command from host" QUICK=1 requires() { diff --git a/tests/nvme/015 b/tests/nvme/015 deleted file mode 100755 index b5ec10c..0000000 --- a/tests/nvme/015 +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# Test NVMeOF flush command from host with a file backed ns. - -. tests/nvme/rc - -DESCRIPTION="unit test for NVMe flush for file backed ns" -QUICK=1 - -requires() { - _nvme_requires - _have_loop - _require_nvme_trtype_is_fabrics -} - -set_conditions() { - _set_nvme_trtype "$@" -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - local ns - local size - local bs - local count - - _nvmet_target_setup --blkdev file - - _nvme_connect_subsys - - ns=$(_find_nvme_ns "${def_subsys_uuid}") - - size="$(blockdev --getsize64 "/dev/${ns}")" - bs="$(blockdev --getbsz "/dev/${ns}")" - count=$((size / bs)) - - dd if=/dev/urandom of="/dev/${ns}" \ - count="${count}" bs="${bs}" status=none - - nvme flush "/dev/${ns}" - - _nvme_disconnect_subsys - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/015.out b/tests/nvme/015.out deleted file mode 100644 index f854f0b..0000000 --- a/tests/nvme/015.out +++ /dev/null @@ -1,4 +0,0 @@ -Running nvme/015 -NVMe Flush: success -disconnected 1 controller(s) -Test complete diff --git a/tests/nvme/019 b/tests/nvme/019 index fb11d41..d4cb926 100755 --- a/tests/nvme/019 +++ b/tests/nvme/019 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe DSM Discard command on NVMeOF with a block-device ns. +# Test NVMe DSM Discard command. . tests/nvme/rc -DESCRIPTION="test NVMe DSM Discard command on NVMeOF block-device ns" +DESCRIPTION="test NVMe DSM Discard command" QUICK=1 requires() { diff --git a/tests/nvme/020 b/tests/nvme/020 deleted file mode 100755 index 4993e36..0000000 --- a/tests/nvme/020 +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# Test NVMe DSM Discard command on NVMeOF with a file-backed ns. - -. tests/nvme/rc - -DESCRIPTION="test NVMe DSM Discard command on NVMeOF file-backed ns" -QUICK=1 - -requires() { - _nvme_requires - _require_nvme_trtype_is_fabrics -} - -set_conditions() { - _set_nvme_trtype "$@" -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - local ns - 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" - - _nvmet_target_setup --blkdev file - - _nvme_connect_subsys - - ns=$(_find_nvme_ns "${def_subsys_uuid}") - - nvme dsm "/dev/${ns}" --ad \ - --slbs "${sblk_range}" --blocks "${nblk_range}" - - _nvme_disconnect_subsys - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/020.out b/tests/nvme/020.out deleted file mode 100644 index 61be280..0000000 --- a/tests/nvme/020.out +++ /dev/null @@ -1,4 +0,0 @@ -Running nvme/020 -NVMe DSM: success -disconnected 1 controller(s) -Test complete diff --git a/tests/nvme/023 b/tests/nvme/023 index a723b73..78dfb9e 100755 --- a/tests/nvme/023 +++ b/tests/nvme/023 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe smart-log command on NVMeOF with a block-device ns. +# Test NVMe smart-log command. . tests/nvme/rc -DESCRIPTION="test NVMe smart-log command on NVMeOF block-device ns" +DESCRIPTION="test NVMe smart-log command" QUICK=1 requires() { diff --git a/tests/nvme/024 b/tests/nvme/024 deleted file mode 100755 index cab1818..0000000 --- a/tests/nvme/024 +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# Test NVMe smart-log command on NVMeOF with a file-backed ns. - -. tests/nvme/rc - -DESCRIPTION="test NVMe smart-log command on NVMeOF file-backed ns" -QUICK=1 - -requires() { - _nvme_requires - _have_loop - _require_nvme_trtype_is_fabrics -} - -set_conditions() { - _set_nvme_trtype "$@" -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - local ns - - _nvmet_target_setup --blkdev file - - _nvme_connect_subsys - - ns=$(_find_nvme_ns ${def_subsys_uuid}) - - if ! nvme smart-log "/dev/${ns}" >> "$FULL" 2>&1; then - echo "ERROR: smart-log file-ns failed" - fi - - _nvme_disconnect_subsys >> "$FULL" 2>&1 - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/024.out b/tests/nvme/024.out deleted file mode 100644 index 76c3e29..0000000 --- a/tests/nvme/024.out +++ /dev/null @@ -1,2 +0,0 @@ -Running nvme/024 -Test complete From patchwork Thu Apr 11 11:12:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13625764 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49973148312 for ; Thu, 11 Apr 2024 11:13:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.153.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712834027; cv=none; b=SzBOe7cyReYVtC8QkFL01/FWmPazn3YCpuW6pNM9uBYEbxcw7ZBIjfKzttgQtQN34Ow56WcBK41qCRMJh+aajJ7XJIvD88NekL5COWjjGhLZ5C437nRBPRwATz9fFetwvBlbMd+Blu7Q1BeeiZtW55f6W5oJ0hTRd6/irpWaNFQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712834027; c=relaxed/simple; bh=rzcMOsqH0Im5ddUaeNbwuyBxslay/s5Hc/qroNU+kX4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BuJWqYn/OxTVKXa73USR6ZNLF81V851mmxuj8y8DU8eGVW0Z96aq/pmBbKFKk48QgPHT+L4G1fGphnh6E6YtkzPs0HtXz228bdXc8QTtBDLV8rny8DWCVLUPvg0GhefZZ0mceggSF4+3+u6jbZ4lpZ1mrNMIzqSL0h9BzXSwMOU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=nLoNYZlg; arc=none smtp.client-ip=216.71.153.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="nLoNYZlg" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1712834025; x=1744370025; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rzcMOsqH0Im5ddUaeNbwuyBxslay/s5Hc/qroNU+kX4=; b=nLoNYZlgJ3TaU8GOZWEtb6EcrWgpqJBsKM2n7mOa/qsxKxBLPWMy4Q7j UCubBtRcxUvvN9SdsieFkDqTfpMxi8hDB1Pi7zvPG916H/bEGt+HW1lYv xhJP8aTJ3VlNGrFXVymOKy9GbdruFGcizAbx5ll6TBYcGHZLKZUztN0M+ j8wAnxEydH9U+NDshzHdGJXNF7NmNlif2TDqrKjl8Z80sny7jT2g02lZs VEp0EskOAswOLfAWWSxxhdNYiVHsQOHM7lTeQKCpeRJGt5xTssOcvwlTw 4cP8Km2sfcO9ci9QiwlO8JAFEagwKq2rybR+F6RX1mzPF3PwCdvgSIhmU g==; X-CSE-ConnectionGUID: haL6C4d0RHGdZxJq5OzEoA== X-CSE-MsgGUID: SKsZGPQmTQ+tZbohNy0nCw== X-IronPort-AV: E=Sophos;i="6.07,193,1708358400"; d="scan'208";a="13579888" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 11 Apr 2024 19:12:40 +0800 IronPort-SDR: nwJtW3WXeQtOpPjpZqZXmhpHEEQvk+juyo3c0Kb+eX2VQBhAQlyd0eP5inrY7amgi0K2BJbhEL wWQE9USSbbpg== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Apr 2024 03:15:25 -0700 IronPort-SDR: w/zvdokllRG3IQ/t8GLr6ZxyQmQjxVix1TTXCZZRY/OOWLRo0n26YBRIBTb5zpsf+XUxhPwPF7 2GVy72YuDStw== WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 11 Apr 2024 04:12:39 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests 11/11] nvme/{021,022,025,026,027,028}: do not hard code target blkdev type Date: Thu, 11 Apr 2024 20:12:28 +0900 Message-ID: <20240411111228.2290407-12-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> References: <20240411111228.2290407-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Daniel Wagner There is no need to hardcode the target blkdev type. This allows the user to select different blkdev types via the nvmet_blkdev_type environment variable. Also modify set_conditions() hooks to call _set_nvme_trtype_and_nvmet_blkdev_type() instead of _set_nvme_trtype(), so that the test cases are run for all blkdev types set in NVMET_BLKDEV_TYPES. Signed-off-by: Daniel Wagner [Shin'ichiro: modify set_conditions()] Signed-off-by: Shin'ichiro Kawasaki --- tests/nvme/021 | 8 ++++---- tests/nvme/022 | 8 ++++---- tests/nvme/025 | 8 ++++---- tests/nvme/026 | 8 ++++---- tests/nvme/027 | 8 ++++---- tests/nvme/028 | 8 ++++---- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/tests/nvme/021 b/tests/nvme/021 index 270d90e..d7add6f 100755 --- a/tests/nvme/021 +++ b/tests/nvme/021 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe list command on NVMeOF with a file-backed ns. +# Test NVMe list command. . tests/nvme/rc -DESCRIPTION="test NVMe list command on NVMeOF file-backed ns" +DESCRIPTION="test NVMe list command" QUICK=1 requires() { @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { @@ -26,7 +26,7 @@ test() { local ns - _nvmet_target_setup --blkdev file + _nvmet_target_setup _nvme_connect_subsys diff --git a/tests/nvme/022 b/tests/nvme/022 index adaa765..0f2868c 100755 --- a/tests/nvme/022 +++ b/tests/nvme/022 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe reset command on NVMeOF with a file-backed ns. +# Test NVMe reset command. . tests/nvme/rc -DESCRIPTION="test NVMe reset command on NVMeOF file-backed ns" +DESCRIPTION="test NVMe reset command" QUICK=1 requires() { @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { @@ -26,7 +26,7 @@ test() { local nvmedev - _nvmet_target_setup --blkdev file + _nvmet_target_setup _nvme_connect_subsys diff --git a/tests/nvme/025 b/tests/nvme/025 index 224492b..a171099 100755 --- a/tests/nvme/025 +++ b/tests/nvme/025 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe effects-log command on NVMeOF with a file-backed ns. +# Test NVMe effects-log command. . tests/nvme/rc -DESCRIPTION="test NVMe effects-log command on NVMeOF file-backed ns" +DESCRIPTION="test NVMe effects-log" QUICK=1 requires() { @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { @@ -26,7 +26,7 @@ test() { local ns - _nvmet_target_setup --blkdev file + _nvmet_target_setup _nvme_connect_subsys diff --git a/tests/nvme/026 b/tests/nvme/026 index 6ee6a51..7196c60 100755 --- a/tests/nvme/026 +++ b/tests/nvme/026 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe ns-descs command on NVMeOF with a file-backed ns. +# Test NVMe ns-descs command. . tests/nvme/rc -DESCRIPTION="test NVMe ns-descs command on NVMeOF file-backed ns" +DESCRIPTION="test NVMe ns-descs" QUICK=1 requires() { @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { @@ -26,7 +26,7 @@ test() { local ns - _nvmet_target_setup --blkdev file + _nvmet_target_setup _nvme_connect_subsys diff --git a/tests/nvme/027 b/tests/nvme/027 index a63e42b..b117cc1 100755 --- a/tests/nvme/027 +++ b/tests/nvme/027 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe ns-rescan command on NVMeOF with a file-backed ns. +# Test NVMe ns-rescan command. . tests/nvme/rc -DESCRIPTION="test NVMe ns-rescan command on NVMeOF file-backed ns" +DESCRIPTION="test NVMe ns-rescan command" QUICK=1 requires() { @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { @@ -26,7 +26,7 @@ test() { local nvmedev - _nvmet_target_setup --blkdev file + _nvmet_target_setup _nvme_connect_subsys diff --git a/tests/nvme/028 b/tests/nvme/028 index 65c52a9..d6ffdd6 100755 --- a/tests/nvme/028 +++ b/tests/nvme/028 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe list-subsys command on NVMeOF with a file-backed ns. +# Test NVMe list-subsys command. . tests/nvme/rc -DESCRIPTION="test NVMe list-subsys command on NVMeOF file-backed ns" +DESCRIPTION="test NVMe list-subsys" QUICK=1 requires() { @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { @@ -24,7 +24,7 @@ test() { _setup_nvmet - _nvmet_target_setup --blkdev file + _nvmet_target_setup _nvme_connect_subsys