From patchwork Wed Apr 24 07:59:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13641444 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 40E06158A0E for ; Wed, 24 Apr 2024 08:00:05 +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=1713945607; cv=none; b=bIgUoF85v3wqe8W2As17kX6evWRkhPM9CCkYIPVtMie8Z2OfMRXVCMw1TDCSwfgZweCSOc8QpteN6TlPPICt1flnU05bp8RmiP4UJ0ziebf8ugOQbDvAhW2hWF/pvSv0RLDhk5onQ6hfOB3/kdz5pbCx4sgevgGVZrBn0jMLqew= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713945607; c=relaxed/simple; bh=29N5U6N1y9BlM6ECK69L6XwHI/nK7ulbD7kVCqyaSx0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X6h5trBD/4GKiycfgOSI3k8/3QyAvA3ijKerp0ep3Ko683bt/uEsGalgi0C6lxxclVbtpM7EChzHDCTOkiAKVbXaG1J3f0/aJQJNG74zApZG3VOrTzNUu15kmKJigGX1+qKo4BCeJVhYrXIHnDkyhImzB3y4Cbn2WPreJi6BPNw= 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=NX1jxUhg; 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="NX1jxUhg" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713945605; x=1745481605; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=29N5U6N1y9BlM6ECK69L6XwHI/nK7ulbD7kVCqyaSx0=; b=NX1jxUhgxoU8gpao+yTHv7UaSLe+5rTFV0P3btLiyHdAhTyTeOjpkGAV jr12nIwupmYECyRRK/+xnNzapLl5aA9DpVclTTIyrIB6MZacfU4mNqINN +aapo6vkEAUunCf5uew68DIRpkHUuwoFPXasjLQO19iprcFu/RcFBN36C NLdwFsQ2iOCH+mDGyOp491XROul3qSsco5b4lSqBQQE+hr57Twwvu1IIE BdCllGKP6a3K8ieQzGgNgZwCjHUoYsuCxqjx7J4oqPgAMMWUDuGT29xVV Yeb+qqsO9Mfa1bWB00bJ/YVPIIuCebadilDfMzMDMQGO2FmZHl0eBlIOE A==; X-CSE-ConnectionGUID: vZZTdpT4TNuccYAbwe9jRg== X-CSE-MsgGUID: h31mIjoJQrWOjcJHPlEK2g== X-IronPort-AV: E=Sophos;i="6.07,225,1708358400"; d="scan'208";a="14515670" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 24 Apr 2024 15:59:57 +0800 IronPort-SDR: 4HqjoBhoD6vkZ8M9YYB+fDPGU/MzuIC2Ftd8eIELvy245fpX61s1XTDXCEElffSDDzXDCDcqKF 7tDpYym44bTEYK68jhaZhsc8x/ZENGxKeWcRJBwADsAZUc+L1WxZMQ96ckHRD6ZNP60H9dc6mR C9WWOD4b2Rpm+HykQpGkJc87mz7mPwvPm/3+sLWTkvfz5oz9DmpN5DUtoLJA94Vbf7ZJ9eSG0N yy3SLXrqzAFktuUfYgSOPaH60Z5+jJf9ADVxbT7TPwPeKr6eOqhB0jJCKvsYsQwqZT6+67mXEj oOA= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 24 Apr 2024 00:08:07 -0700 IronPort-SDR: nBmiefH4CHw2SsOQtpcUduyjB5QQNs1gVt3JDxhSep7wcQpdN67xR+XN/0hGvJgXgTcXmHatPS GuHwaVsVtwfY+9CpRvDd/V8EUOC2hhIOvssoU45K0CmygkmBkE5NiO7SUc0/oBDYx59zme8m+L 1WcQq53Al1jl6vwxfRrMg7VeU3c7pNdYDXTtBQLbSonSvJ8oPYPReB/tNX5LOPGmVa+GzbVxof 7bihKXNlLp18USScw3PPRz/LeBkYhWB7N/ldZ9HLYFWrIMixtD9BPNGzwXjXcbwbzJzIBmMk3j jxU= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 24 Apr 2024 00:59:57 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg Subject: [PATCH blktests v3 01/15] check: factor out _run_test() Date: Wed, 24 Apr 2024 16:59:41 +0900 Message-ID: <20240424075955.3604997-2-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424075955.3604997-1-shinichiro.kawasaki@wdc.com> References: <20240424075955.3604997-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(). Reviewed-by: Nitesh Shetty Reviewed-by: Daniel Wagner Reviewed-by: Chaitanya Kulkarni Acked-by: Nitesh Shetty Signed-off-by: Shin'ichiro Kawasaki --- check | 93 +++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 56 insertions(+), 37 deletions(-) diff --git a/check b/check index 55871b0..7d09ec0 100755 --- a/check +++ b/check @@ -463,6 +463,59 @@ _unload_modules() { unset MODULES_TO_UNLOAD } +_check_and_call_test() { + local ret + + 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 + local ret + + 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 +535,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 +558,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 Wed Apr 24 07:59:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13641445 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 1E9AE158A0B for ; Wed, 24 Apr 2024 08:00:06 +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=1713945607; cv=none; b=EU1v5jP5xU4gVdBf3Ui3iGNlAU4LSE5i90fqfuchgWjpF2edbr1KfaEQKARAAoVjrk+J4RLWSnVl6w9E1B6FuUQcg0sqBBhOXlitJJUOW8+IGmFth80k4dumvqtEgKcwkY6sYOc7rfiJLUjwq8U6s0eNBNbBszaDEUSgmTiD/Vg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713945607; c=relaxed/simple; bh=ZLlifhfpZJXP+J/JjbvB5VBhA8XjzFfCMvsSmzXLv0w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CkESW3kd/MKSt1RkEDFvyq1VIaN+QIRO5lrGBCSlkywOkaaxtz43xjRVFWtLt0SrPx1UQ5HAQ+K2rQ4krjUFn4Bh8CSzdgWb5PTlBbDV47hXQEBM7P1mNOJMa49gGjTtGf63VLmk8IGR/6+XW/sseZHrXpT/XZ+3UrHIu3FiycY= 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=JS+aRe7j; 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="JS+aRe7j" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713945605; x=1745481605; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZLlifhfpZJXP+J/JjbvB5VBhA8XjzFfCMvsSmzXLv0w=; b=JS+aRe7jnjPX+v6fZUmeA7dVSl3YbmcT2CSZNQyczaDq1BAa/epx8L89 wrX9LgRGmofmRbBU7CmV5pZoPbWYqqe7DWx8pzTtbLbLOveIFUauG167U a1DDL9PoKnJYRI8d2rQfIySaz9jQMgtT3OfCOJAsesaJAJ1XCqyCzx/9c Kd7sdo0oDf6WFXcCqU24EnLP+3Idd5T3TmrvEMB3AMXW6uJvJ6i7Nb+Y7 0l33L/ywqGgDDe2m9A0Fa+SHMCxdGs5Ep8U5zv9WuxUpQmXrBDJYGCizk beVkwSmOAmWGgEhx2ldwGpWgbUdG6usxeyr6QHWVIvk+z/qmrctoJSNZJ Q==; X-CSE-ConnectionGUID: O0cF8cNnR9aVj5wOObV98Q== X-CSE-MsgGUID: wCxSSeZ1RPCjaUUgfpaqXA== X-IronPort-AV: E=Sophos;i="6.07,225,1708358400"; d="scan'208";a="14515672" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 24 Apr 2024 15:59:58 +0800 IronPort-SDR: mcJCSdHUuKZpi6aJH6VdMuEodqHggPyFWISdK+Z9q1BDZMTELCijGcP8IERrHJ3LR9oBFAKfuk 5zM6K7iuAaRNCVhG66T5XmqGQghyFecGNm5BCuxtgLHlVrUpmy6LhisruewAzhtN+ysSSubUGU WDMTnGSFBW4Zxqg7G/iBQenDMTyLngEqOwFLDwybY1XIQctdn50/1T8o8Lk305eGTi4JDKrfiw SZFg3V83enZtn7H5zg4V0T6BgGTbqO+5D5VZ1J8ZfUqsK0Nr6dUxwDpiDLFHMIOq/GmX0e4nhl V1o= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 24 Apr 2024 00:08:08 -0700 IronPort-SDR: X+EXbWWxdDYCPucFiaDKmCDEkn/EEXcZ9jsRsOTtlcXR4MmobsyJex6VEMpJMpw7XqJExWZoD9 zDMd2NvTVTLJtRTYlpHh0u2ZNWS55qgrxqQMDlE44HeX7Sf+NMR29gtzQ7mdtdjd5NxwZ8lrT+ q2EvnbzVhxRnt+pCH87G4oDN+llwKP2xVr+ycCI4a1QbcMTvnXaBiNRpjoautOFqZTBbZVDGeu r8IXC7NEJBBecarx6uRA5bjvstduR1Rm+tgz8kqaN0pWd7IS9hzwEI8keN7pMOUb7cRrKjEH+/ e+s= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 24 Apr 2024 00:59:58 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg Subject: [PATCH blktests v3 02/15] check: support test case repeat by different conditions Date: Wed, 24 Apr 2024 16:59:42 +0900 Message-ID: <20240424075955.3604997-3-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424075955.3604997-1-shinichiro.kawasaki@wdc.com> References: <20240424075955.3604997-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. Reviewed-by: Daniel Wagner Reviewed-by: Chaitanya Kulkarni Acked-by: Nitesh Shetty Signed-off-by: Shin'ichiro Kawasaki --- Makefile | 3 ++- check | 57 ++++++++++++++++++++++++++++++++++------------- common/shellcheck | 2 +- new | 21 +++++++++++++++++ 4 files changed, 65 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 7d09ec0..edc421d 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,17 +463,19 @@ _unload_modules() { } _check_and_call_test() { + local postfix local ret 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 || $? )) @@ -484,6 +485,7 @@ _check_and_call_test() { } _check_and_call_test_device() { + local postfix local unset_skip_reason local ret @@ -491,6 +493,7 @@ _check_and_call_test_device() { 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"]}" @@ -504,7 +507,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 @@ -522,9 +525,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 @@ -535,8 +540,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 @@ -558,8 +573,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 Wed Apr 24 07:59:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13641446 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 046911586FB for ; Wed, 24 Apr 2024 08:00:06 +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=1713945609; cv=none; b=OJIHq/ENRrPTtDI3x2DfXFF/qFf/3msBw1Ap9QYc9fRWqhT9hQlwvumNMa8OT/ACOPUZacYY6dn3rHFtK7CDgQBzyGula0jUS4lpB2cQdFBV/0QTAVC2SB8xqdZPkJvTS3WtLq7JDs2vyzX1iCWUCjtWr+WE2c3tbLMxxbGBeGE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713945609; c=relaxed/simple; bh=lG5GYMuyEZNZtr3PgzkOH8KI6EYXvgXm7PdLubwRkjs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fI5/lcV4qEQcG/1fLU1aQq9xFqVoTe7kdUhCZNF5KiCv8AXEpTqa1OwxoKxPtsfQkFtQoWo6J0PdB9d64gvZmGZVw+yZWTUbgbEdx4Vvs64poUCcBIpQGTl+otA36BAqRBt9KAf7AJkDUYH4iT11+KKTK66MByHKmfOmT1TfXWY= 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=Jk6CMth9; 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="Jk6CMth9" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713945606; x=1745481606; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lG5GYMuyEZNZtr3PgzkOH8KI6EYXvgXm7PdLubwRkjs=; b=Jk6CMth9jWD2blK8ulklfwIkz80ViDU5cyskahdgr2xLibssSett1RjR z8AKV4j7G6MqmgYsM/sXSpv/fVKDkLxwfAY5InVlEju7zIai7SWJVidRw c83pz23AHQsMp7MdJPw9FG+TxC0dLCtI7TKINqdPTo8mtKNLBO/hJicsO Z7dtGQs7WnwOwl67RxPH0LgHgFTHls+lnBEUw6qm0iCDT2PDomU4SG+6j zCOe0Jj3Qhann8UqBcqGwMfjxQ89Y7xH5wHbXSA0GLF3n/cyqhXLzkYJ3 dLK/6cwiZKyXMPX5QfkPkG/O/qVMtMOtGU0JGIv7xQx3KLlhHnImvjnvG w==; X-CSE-ConnectionGUID: wG140JrvQJqiyUoL626xmA== X-CSE-MsgGUID: u3knHSk8SxKTXw3wc+sDAg== X-IronPort-AV: E=Sophos;i="6.07,225,1708358400"; d="scan'208";a="14515675" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 24 Apr 2024 15:59:59 +0800 IronPort-SDR: MN8+eeGloKnfdxKlXprGphog65THY4AXf7y1g3Q+ZWgfcU/Nt0VerzIP01L1msGN5JYbyMeATN E10IwSScVnE+pXphwgMY5p1ZO6jlxAaSRyDYmmb9dAE86sZ9pkIGydnPJ5mlTUWyWz4FH9mvWt /nnroghjNBDPawPoXVAqcs37+ikll+jsnDaqUOCLFPUjj6r7fpDCabSs0//37ywI1zbRq9WGmw UieAhRS0USQ6lAHjzst7H5rrwxOy8ZMTpCElXN/cx4k27uHKp/pZIj1s1/AnJGYvAf8ojqiLbY wGQ= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 24 Apr 2024 00:08:09 -0700 IronPort-SDR: 7ZI83bO/6w3h1mphMJLq9putUiGHtXW82tRutl7d8uisL7r1SW7JsxGSx8qtfxXtCRl1zscLAR gA0+Q+4lua/hXXIYu2WVcyHD/ROKUBFLO1GNTCHrcVEMODcHdJS8i4oS0+YAs1SLyTrYnVFGfB WJJ7aMHPcstomIYQSj3AInQNbskfAbaOBKxqjB5kgtfNKafRh5N/KHoFeSCF04kCxdz/5A9Evy PBjo+7dTeuESjCmE9WtHL5y3Grm23RKr8VcwnLQgs+PVig9urxfczxfI7ridHoGHRsVcxVCs3/ DCg= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 24 Apr 2024 00:59:59 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg Subject: [PATCH blktests v3 03/15] check: use set_conditions() for the CAN_BE_ZONED test cases Date: Wed, 24 Apr 2024 16:59:43 +0900 Message-ID: <20240424075955.3604997-4-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424075955.3604997-1-shinichiro.kawasaki@wdc.com> References: <20240424075955.3604997-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. Reviewed-by: Daniel Wagner Reviewed-by: Chaitanya Kulkarni Acked-by: Nitesh Shetty Signed-off-by: Shin'ichiro Kawasaki --- check | 19 ++++++++----------- common/zoned | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 11 deletions(-) create mode 100644 common/zoned diff --git a/check b/check index edc421d..3ed4510 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}" @@ -464,7 +468,6 @@ _unload_modules() { _check_and_call_test() { local postfix - local ret if declare -fF requires >/dev/null; then requires @@ -473,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() { @@ -540,6 +534,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 Wed Apr 24 07:59:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13641448 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 2588F158A35 for ; Wed, 24 Apr 2024 08:00:07 +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=1713945610; cv=none; b=iOzOj3p6tiusvxtATL1YAL7WLc8b78/3BWBgEEBwEQIegnfa7hAJt0rM9GTSeQIE3mRNi/8lwOI5aSbTSbCM+EBmLQ2esbw6QXCXSU0Up8qe7L1j31zDuD2cvHUoTFTGXLV5CX2psntqOII5/7sMHUiQO35jhehraMFnaTlEdyU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713945610; c=relaxed/simple; bh=3dx9il75eOILsBu5G1//4p+1/FA3YyekAV1bi+io5+Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CUl100uGEBe29mIWUbqjyZOLdA03Tmw11mKdV3tTp3jbCZa+vRMrOwHzVs/nhpHOv4JcdfvxgxaZO0ojDxOp6gaz3dkmqqQSNdos77sNAGi56i0Dvydm+2c+SktPEXwB5gSlpjpjge73l7jUAuCoyWLMTnKdQP218z89UT+/z28= 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=BU+uXQq9; 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="BU+uXQq9" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713945606; x=1745481606; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3dx9il75eOILsBu5G1//4p+1/FA3YyekAV1bi+io5+Q=; b=BU+uXQq9eMo3ugAKi4xeQPEiTdsCUwQM7feB6SO2IY9wDHS+gmCJNMSP zQoDtqT/GmxzD8LAi4hildHk+Cye1I/MK5FNTVE9H2chdMX2pPCApx/eU NtKIyCzuW9gVTbOa/r4YaSECg3K+80LY+wDIOb8vlho6DYUIRK6bS/ZRm NpJjjUhTQyeVz30yhd4HDXuPiADyaof2gIAdXI3WBobVB+KI5yY5AD1SP SscaBb0Max/HhxlCYXf8/Yd9B5s90tfy43HU1x4yd4TTvUz7a/Sx87Ds5 MdDMyBto0GPip5PA0GeGnuRSvbJRPDo3SoW5dRUhwKaSxL69TtKAFTKYx A==; X-CSE-ConnectionGUID: K7qNyQZtTtmqpwPUtEihIQ== X-CSE-MsgGUID: TZPjq2FGRhmO/OfQq015JA== X-IronPort-AV: E=Sophos;i="6.07,225,1708358400"; d="scan'208";a="14515679" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 24 Apr 2024 16:00:01 +0800 IronPort-SDR: t2ByMtkuTT7HiRvhOPp9OJr9B5wK5d0A90oGv39U3ONgA/jweTmWJQnC0smnT+AOqw3fyeV2bw 0C1BfZ5wHESBm2/l73V/zsimm3aF1EaMcwpAzn+RAhaaq171SdgQ9qVvldIkM6mZ9RemGhD82Z wYW6eSiop6ICuoKM6w/e6I5gXevQqvOALzeNYs7rah8LInA6286Dt5OQDkAv1dhuuBPvONogOn AXy098K1kE08txoaHe4IhGpaDxOYrOk2zsq1Yh3x384kWU8wlxOLuEqd1CAUAF7+dj80XetCbS 7x8= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 24 Apr 2024 00:08:11 -0700 IronPort-SDR: 5eQpFKT9/T8nkJ8Clm2XKneTWPatvF+Rgcfg581snZinkRIpgrPpuomMpDtXGoKWr0AVyG6Q4O PULOvIqEsLQ+9RnttqUkUAEPcFgGe+dEXoyluVIlsy7m7hMkEUBdgO6oXLRqjYoN++GBznP5sK jMA9c4TLoYTASJY7OVK6Jd3dB53wVWm7SQPdvZ3lmzePFENpUzwwOGO3odrI+5i/5bMg4Phbqg AJm44hIFtLTgPuoEt1KMhMdE+KJ2m/pgkQomKLoC4TNDesqwHWwx+npsd8itwLdkjbafHFs9Q9 IU0= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 24 Apr 2024 01:00:00 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg Subject: [PATCH blktests v3 04/15] meta/{016,017}: add test cases to check repeated test case runs Date: Wed, 24 Apr 2024 16:59:44 +0900 Message-ID: <20240424075955.3604997-5-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424075955.3604997-1-shinichiro.kawasaki@wdc.com> References: <20240424075955.3604997-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. Reviewed-by: Daniel Wagner Reviewed-by: Chaitanya Kulkarni Acked-by: Nitesh Shetty 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 Wed Apr 24 07:59:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13641447 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 09F15158D7E for ; Wed, 24 Apr 2024 08:00:07 +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=1713945609; cv=none; b=YPuXL3gHvFZIxw2hDtaMMt2uLQYYbM2LVAp7F73qkLgqBbFOiMbhEEV9uujPClwqi1pjwa1yT5Mw2N2gUZspdc/gWYS7hWmtlbVMhERsR8mEU3eybqyD+DhqgtoW3tlBdkxsTm3EfT47x6eG1g3/VqJzEuqNT/1V5XKv+zCohwg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713945609; c=relaxed/simple; bh=yHpLX1JLyja72v9Ay7upFM5xSkaMZAaYoylx1iwvVZI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Wgv8YYTYMTk+2A5DMRwnBvbSfKatBjATUzFGZBY4MMaAM2c/f7SDeXSEOy0BshDn6BMWNII8oLgMmp2A4yFJ7Fz/HIT5fvogarfZraO53rzLkxlcKufO/m0doRhIHL9IB7gPpVZ1E5AUOgirJapEzmQ73XJI0332CwIshkBNiKI= 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=G86KzTZ/; 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="G86KzTZ/" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713945607; x=1745481607; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yHpLX1JLyja72v9Ay7upFM5xSkaMZAaYoylx1iwvVZI=; b=G86KzTZ/RUEGH0WV5BLsRtowZzZWrvanOSs6qDbEZ4uIubcPR66KlKfF 7B8E6UUPoQ0JscHXIoXZX2Pdh7N+65MKG2z7ahlwb9eNHEDDz6LVjgaTa GYul84HVh20ErRv3LmLb0NbjB2ujSo1dzoU7rhdB0nLoDx4RxLUvJOdMK LtiSdgur705s4nth9cfOu4a7X5GjDhQFjsk5D+va/FQBFCZ/MzGI9ix2m VOPSq3GtKpBU5GPOWwykYtEhVC9LxzSmvbDXFhxlynP91FcGW+018If86 W1LJvjk5+pa/IWiefNVgRaCQtzjc8Y27OabK0Qqdi1fD+WFdpsD3L1DYL g==; X-CSE-ConnectionGUID: DSMaZdAGSSmS8/fpf7yMOQ== X-CSE-MsgGUID: PcOW90XSTX2IeZFsioVsdQ== X-IronPort-AV: E=Sophos;i="6.07,225,1708358400"; d="scan'208";a="14515685" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 24 Apr 2024 16:00:02 +0800 IronPort-SDR: RxPJWP7QlONYxujlJfCIlLhp163T7N5fFIouK3bdEyW2g2XnBKZJQ4+H93msPGVyd+9MTbsv4K R1WPtIZDZsCB7/xanzu5DO+gQz92DWzA3Tk7PW0IvQkXpI3aHNzBSu+DChjhXTRcutmz4Pmo22 wbWsz3+qOKLaCMDWNOzI5x6IYdEmW+Hp9fWt8UnlNhxahIlkL0uNpg3OkDUG52WCJ9oAQXE21f oi5qwXyizgoXvl/dpDFeXO/rE/zL1clG8FruHAuOtzYuKoxXC+LrB3RvPJJs55kWsO0wXRoq0+ ap0= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 24 Apr 2024 00:08:12 -0700 IronPort-SDR: YaJvLZZoTODNj7TXjVY2iiIDjM4IZettOgbKTI+aAfCtUcqs2qNw9++Tj9qq5AgC4crPWUb5x3 /OAn7u11b7sCgVuawFR0Lw/0wupxvCQB+8eks9CUlYNXWqlbYI4yLzyBObTQmqxLm0kgVcCORV MAQlSvSw8ufSvp00CRwmd5vGsVWdmL+ObuEpIMa03+vH991SH2lwSpy0LPyK54nt0O5RC67Ypb YS4fGl8onh5a2UmAq9UHC55YtiTJlmSnoJgCWgluwfPM/ihNoMMXOkjY7ZEXZgaVX7MxDg9bPX MB4= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 24 Apr 2024 01:00:01 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg Subject: [PATCH blktests v3 05/15] common/rc: introduce _check_conflict_and_set_default() Date: Wed, 24 Apr 2024 16:59:45 +0900 Message-ID: <20240424075955.3604997-6-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424075955.3604997-1-shinichiro.kawasaki@wdc.com> References: <20240424075955.3604997-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 Following commits are going to rename some config option parameters from lowercase letters to uppercase. The old lowercase options will be deprecated but still be kept usable to not cause confusions. When these changes are made, it will be required to check that both new and old parameters are not set at once and ensure they do not have two different values. To simplify the code to check the two parameters, introduce the helper _check_conflict_and_set_default(). If the both two parameters are set, it errors out. If the old option is set, it propagates the old option value to the new option. Also, when neither of them is set, it sets the default value to the new option. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Daniel Wagner --- common/rc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/common/rc b/common/rc index c3680f5..9ff31cf 100644 --- a/common/rc +++ b/common/rc @@ -470,3 +470,30 @@ convert_to_mb() echo "$((res * 1024))" fi } + +# Check both old and new parameters are not configured. If the old parameter is +# set, propagate to the new parameter. If neither is set, set the default value +# to the new parameter. +_check_conflict_and_set_default() +{ + local new_name="$1" + local old_name="$2" + local default_val="$3" + local new_name_checked="$new_name"_checked + + if [[ -n ${!new_name_checked} ]]; then + return + fi + + if [[ -n ${!old_name} ]]; then + if [[ -n ${!new_name} ]]; then + echo "Both ${old_name} and ${new_name} are specified" + exit 1 + fi + eval "${new_name}=\"${!old_name}\"" + elif [[ -z ${!new_name} ]]; then + eval "${new_name}=\"${default_val}\"" + fi + + eval "${new_name_checked}=true" +} From patchwork Wed Apr 24 07:59:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13641450 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 B11B0156C69 for ; Wed, 24 Apr 2024 08:00:09 +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=1713945611; cv=none; b=QZ5AE7BA6h8V2zgOsVcFjzIWGoP3FHBFUS0dtCQVpmCztTWsv0cquwZyQanpK5cGgdq2pWTKWh1QQ3KfpfQCSgBu+EGlOvOxdtBEjRN2QvY+NheAGhxwRWdz8/rSpLTjDbUO6jfUzI73xEYOhC2UNUrRVMpolkrgKnsnbomTUB8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713945611; c=relaxed/simple; bh=8AhslQoyHiXqPtsxsMjtks4PAsu+KungIzCjBimCEE8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CnbN3lxOrZsKycQmPf0LSmKegbnOnIt1Zcd3RY0hVE78cB7GtkCRFQHYpbcakoFWIiQFgUgiPR+EjgfAmolnpy4gFZIOiM94v2eoBwmk7ha5tdq9emNhicfglXZUI0jKUi2gbtfdExqBSu5rmwkXE8NDetRmf+0Z8hLTo7/D2Ms= 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=F3OFwM1z; 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="F3OFwM1z" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713945609; x=1745481609; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8AhslQoyHiXqPtsxsMjtks4PAsu+KungIzCjBimCEE8=; b=F3OFwM1zo2qhlr2dsKCiMHOVIEa+rjx+Av1qnSYDy2mlqKla7iuN8LXz x/n/1PwlfsC29FIU50Rb0Q0+lr7Uf1UTHvIKIm9B+c4hTeYfUsHG+AMWJ wAJpbo3MlmP7kHKSLHgUzEFr9F3tWOKTqTLlOmBNPhj4oEV2FyEMV67XA lSaYONm4+4oargfuWAGMJWuSeobb9YfTxtmEUV/OuACISt1eQ2a/Jvxtt Ff7UFb2JyLVtdd0bKtGIlHcEJmTXqZ3dxHeBAxpMbdnJYF41pJfh723A2 zhrsX4xln8VxLyGCtqroDTblNb5otOcaoUoUQx3Qs9nRGP9+xMicm4I0T Q==; X-CSE-ConnectionGUID: lNNn3pToSpCi5vxHhG9wFQ== X-CSE-MsgGUID: 4ERLIYaoTreWDUO7Ta0CDQ== X-IronPort-AV: E=Sophos;i="6.07,225,1708358400"; d="scan'208";a="14515690" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 24 Apr 2024 16:00:03 +0800 IronPort-SDR: 0MIoRPnGBKp+FB0/ook2hc4mOpv4pPPSQKzPr3xUMQKy5FukBdyjDhGQ7XOJKenYLiprBynOQh iikhp8CcEAMFGaW52hdd9D9VRjNkBsRayJ9hkb1Pj0WL1WmTL1wtrZxdzMqV78DLdaMcW8Ra+o I39ae9bHx1785rMYF3zCH0kzGZ7C0IRDI6FRucATNaVE7TDPQxRwy/KYuc2eNw7D+3oIZWIt0x 5GT2x+5aWZCXiDHNRgXokAEEQY2ycagg2gvxQvI3US6yRa/kUt+895B3+uvLNNlKH9pp5ohRdj xYg= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 24 Apr 2024 00:08:13 -0700 IronPort-SDR: e0zR8Jg61eGL9i1fBhmIbWTW9FM4CMn0LqyDQfnL42ZXSJhoi2lr25xY7HzzVrN8K5B5QoAo2K cnB9tSNstd130Kw0qnZusqpO4NFgR/xwxkYJbPPhchd5vDhwSRf2ynUdziBL+WWFIyEs+zHodv Inngov/pQ8rDEMEMgM4CoYGC4iIcWzoFmfUkrsDjJVesLz7Qi39NtLkkYLeWWfWbcE+scpKCUf 1Fdr8tZmeu0xwARefHb/65whGNsirXbZa44JxWueb9jnzuYow2uD2jejhulE/4uf9CUUgqHBq2 oo8= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 24 Apr 2024 01:00:02 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg Subject: [PATCH blktests v3 06/15] nvme/rc: introduce NVMET_TRTYPES Date: Wed, 24 Apr 2024 16:59:46 +0900 Message-ID: <20240424075955.3604997-7-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424075955.3604997-1-shinichiro.kawasaki@wdc.com> References: <20240424075955.3604997-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, allow setting multiple transport types. Taking this chance, rename the parameter from nvme_trtype to NVMET_TRTYPES to follow the uppercase letter naming guide for environment variables. NVMET_TRTYPES can take multiple transport types like: NVMET_TRTYPES="loop tcp" 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_TRTYPES, and set nvme_trtype for each test case run. Also introduce _NVMET_TRTYPES_is_valid() to check NVMET_TRTYPES value before test run. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Daniel Wagner --- Documentation/running-tests.md | 12 +++++++---- tests/nvme/rc | 37 ++++++++++++++++++++++++++++++---- 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/Documentation/running-tests.md b/Documentation/running-tests.md index ae80860..571ee04 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. -- nvme_trtype: 'loop' (default), 'tcp', 'rdma' and 'fc' - Run the tests with the given transport. +- NVMET_TRTYPES: 'loop' (default), 'tcp', 'rdma' and 'fc' + Set up NVME target backends with the specified transport. Multiple transports + can be listed with separating spaces, e.g., "loop tcp rdma". In this case, the + tests are repeated to cover all of the transports specified. + This parameter had an old name 'nvme_trtype'. The old name is still usable, + but not recommended. - nvme_img_size: '1G' (default) Run the tests with given image size in bytes. 'm', 'M', 'g' and 'G' postfix are supported. @@ -117,11 +121,11 @@ These tests will use the siw (soft-iWARP) driver by default. The rdma_rxe ```sh To use the siw driver: -nvme_trtype=rdma ./check nvme/ +NVMET_TRTYPES=rdma ./check nvme/ ./check srp/ To use the rdma_rxe driver: -use_rxe=1 nvme_trtype=rdma ./check nvme/ +use_rxe=1 NVMET_TRTYPES=rdma ./check nvme/ use_rxe=1 ./check srp/ ``` diff --git a/tests/nvme/rc b/tests/nvme/rc index 1f5ff44..f35ed09 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -18,10 +18,41 @@ 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"} +_check_conflict_and_set_default NVMET_TRTYPES nvme_trtype "loop" nvme_img_size=${nvme_img_size:-"1G"} nvme_num_iter=${nvme_num_iter:-"1000"} +_NVMET_TRTYPES_is_valid() { + local type + + for type in $NVMET_TRTYPES; do + case $type in + loop | rdma | tcp | fc) + ;; + *) + SKIP_REASONS+=("Invalid NVMET_TRTYPE value: $type") + return 1 + ;; + esac + done + return 0 +} + +_set_nvme_trtype() { + local index=$1 + local -a types + + read -r -a types <<< "$NVMET_TRTYPES" + + if [[ -z $index ]]; then + echo ${#types[@]} + return + fi + + nvme_trtype=${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() { @@ -61,9 +92,6 @@ _nvme_requires() { _have_configfs def_adrfam="fc" ;; - *) - SKIP_REASONS+=("unsupported nvme_trtype=${nvme_trtype}") - return 1 esac if [[ -n ${nvme_adrfam} ]]; then @@ -92,6 +120,7 @@ _nvme_requires() { group_requires() { _have_root + _NVMET_TRTYPES_is_valid } group_device_requires() { From patchwork Wed Apr 24 07:59:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13641449 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 B66691586F6 for ; Wed, 24 Apr 2024 08:00:09 +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=1713945611; cv=none; b=PSWQj5zc+G0LM/0XWeWQq7nIh35ChqxffEDSwR0Gd2j/6nv+3UPUpkR/UcswQYiNUpKqlGRlhZHziZEAR+JAg4uCtcK+BbYAB5hhzyQ638ER2sU5/UDjTCyv/Yk+AtqSFDsWiXOt/ui9rmbDpvMz55oc1tlAhdeYMefpcqZnn1E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713945611; c=relaxed/simple; bh=nqz9/msx15KbB+BgGwlvy/0PKz1/iD3nOvV9RFRZu68=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fRkC9xyMYx18WcApxjz2nVJ5+wOG/doOyfrgufW+D75CtCScqE6QfVeSdoOPSn2ubKSiCMIezxQ7jdewak/UP8QVAQk7Wm5tWEQz6X9Gtynue9c2bnqmrNosVIe+YA+RCUImOrQsqhwSQQArhWhnJSkjsnWj8tXIFdhl+oeIymA= 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=nwaAcxXH; 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="nwaAcxXH" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713945609; x=1745481609; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nqz9/msx15KbB+BgGwlvy/0PKz1/iD3nOvV9RFRZu68=; b=nwaAcxXHuhr6HXFMIwDU1y8MrofUeYsGs1FPp65Fz1eSGtKrgxM1syBk wjBlAftKedk2mdENOyhcTiF4Oy+1wzzttbWGc77+B5EhfFRVgUM/uqy+N Kk6ahVkav8SMJ/8PLOVHz1mttmzxRrI/2KweLCwUNePtYQKEa6BZ6KomQ +8gUeobe5H9c830UOBRB8F4Uu3h1rzDYazlBE+uFhf7a95V84bpn60lec Jtxd3x8S+k/hEQ3aZ+w7+/HQW12DJlDjcuz4M0to7ZH2awyq7erzLLlNU G6DODw2GL4RcN0eZi28x3N+LbP8E3bLXdZpDUc1KHGjgjadPWbSEjEKi9 g==; X-CSE-ConnectionGUID: 6D1e821VRMK/G+OwVvPyCw== X-CSE-MsgGUID: empZ2SAEQdyC2eplh/nctA== X-IronPort-AV: E=Sophos;i="6.07,225,1708358400"; d="scan'208";a="14515694" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 24 Apr 2024 16:00:04 +0800 IronPort-SDR: YVUbv9+3qDLxrUhZBFiBryonU7wYuF+y7gtEdKTLAmenGRNcsoaJjX132I9THyJewURtHISHwI rze3c3PyE/znZ1KngpMeiQP5ojEM9qG9noyzLgevf0oHZ1bOVQERGdpK/AHU+Yp8FsRNZKgN8Q gvLrw9Ef6Cn/aj+3jXuJmLk2u6LregjlEkVOWdMv9fUXF8Hm9CDLw/PYCC1oxh8dhfptfqrrvY /cTt7MGltHr1CZHpabcJpNtjpT8nHyY1Q2qDCl1eBXIGlFsHFga0yU2KQJ7uKu2ZPm1eHoMn5q TeE= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 24 Apr 2024 00:08:14 -0700 IronPort-SDR: pzNP4i1S5B7uUSQ5rY6jpRFfzZUbNZEQHnHXl9DZ9h7MioOlSR4BFRsQflb5dPBzdzuWywqrVx 11bOxLgkwBvisEqu5m6ZpwlVSTj9rMGgkqMPc++2ZI6/1Mi8cNYl/NNRgfq73g2lXpTyIuhuS6 Qj7y4fmkwlEk+w49ECBKu0++L6BqAPR3CzYRG/XVG7nI7BecOpsY3ShtW94g5Xkz78GUtxIPrS NHkw0m+yGe6FyuIm3ZdF8AdimR9VXHIa+qSVNRm9nUd7JYP9Hl2+j7dUlkg7zAiHkoLQIQBsLq XSo= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 24 Apr 2024 01:00:03 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg Subject: [PATCH blktests v3 07/15] nvme/rc: add blkdev type environment variable Date: Wed, 24 Apr 2024 16:59:47 +0900 Message-ID: <20240424075955.3604997-8-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424075955.3604997-1-shinichiro.kawasaki@wdc.com> References: <20240424075955.3604997-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] Reviewed-by: Chaitanya Kulkarni Acked-by: Nitesh Shetty 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 f35ed09..ec54609 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -21,6 +21,7 @@ export def_subsys_uuid="91fdba0d-f87b-4c25-b80f-db7be1418b9e" _check_conflict_and_set_default NVMET_TRTYPES nvme_trtype "loop" nvme_img_size=${nvme_img_size:-"1G"} nvme_num_iter=${nvme_num_iter:-"1000"} +nvmet_blkdev_type=${nvmet_blkdev_type:-"device"} _NVMET_TRTYPES_is_valid() { local type @@ -855,7 +856,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 Wed Apr 24 07:59:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13641451 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 4DE85158A20 for ; Wed, 24 Apr 2024 08:00:10 +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=1713945611; cv=none; b=Qxu1RI5LEmVbe5Rw9vLR6/fSNKa96cyfD0kAXCNCy2n1/4GqGg1zsX8ZBPmPtSQ5dO8vnH1/QvuNDyL87vm2PrPL2k44Xvb9ERzwlDD+oyTtyMYI7IyX+Oi1k7iudUHwj/tOO5c37iW8jRJ68sPjivRlsAJ9QlAAjoeD1Z0DVAI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713945611; c=relaxed/simple; bh=tGY6fd0PKJRJ+c573V4B+/BeY3ESXX4f9SxgBT516LY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IbPljayLZ29CrkIxwfq/Xrh++1LqhMza+BWkp6Rv09nfI9q3kPanCf5ZMk25AFdPjLHjxKuHOZpKvwiSKr3YrpSjkjj6S04fTTx6m04BY450k+uhYwFydjdI8Hdrgv1wU3RvNNH7naXrOwpsII0aYuQbEJsKbZA2pU5shdWsppo= 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=W5hbvpYm; 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="W5hbvpYm" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713945610; x=1745481610; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tGY6fd0PKJRJ+c573V4B+/BeY3ESXX4f9SxgBT516LY=; b=W5hbvpYmbYZhV/Nu1P0m265gTocpdAMZ7Cyqq11HGM3IxtSg1VUO1RFH JvbRuFDeC0xbjADAEaCeGOeqyi8naH6kHR0yNeHPR72RAIOE0U01XOE+T KpI6LDs/kkkDvngphxijbcdjNUzmhV8N1UUDTEyjiPV4zZCpbtJZVpphr N7bg0Qwu+QcQiZuDRpAuKC36nN5mPKa1T+hBabjJKY8P0VUcCWUpBqcwc xoztD564pn+KXKhkQc3PDut0bbnyZ7w2PwXzyQRdXVFObBq3NleWu1IcM oKoagVdk6qh/6nL70aIr+zL/FiP7dCoU7oA9xlkCJijWVLaGPcfHMOB9B w==; X-CSE-ConnectionGUID: ugb9lnoLR8e7jT6xze7asg== X-CSE-MsgGUID: 1Kaud65ETCSeKpvtldswIw== X-IronPort-AV: E=Sophos;i="6.07,225,1708358400"; d="scan'208";a="14515700" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 24 Apr 2024 16:00:05 +0800 IronPort-SDR: tq7xn2DDSpkGDJnkekyDJX/ChNU3xf/NZ9x6oOUeb3dMcCsBytqiXwmMkvpqw6O5cqn2Gg6ede 5sGRcuP90nUuNTNMLpxOUN1DUZXLmQqdNxOSUG625MOQFTxgNX2fqrOXtj/pspu89GOgGPpnek 33q0vzXXqbj+uuoTHnPAYPqlFey3rbMr9b8vq7f8BS5Abr4b06qdZK7RZC4Z8S1sBD2sYwuI8g lMvQqUS5gKPP6/ElXKhb0KJeJ2VBPNsM+S1IWYFrA8D9o3/Ep/at1ifrOA9kN8AVhbovaOJGN4 KgU= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 24 Apr 2024 00:08:15 -0700 IronPort-SDR: 1GChv3wADjXNeXIlpYLQmCSm5xc5biJkfcbVcALA+mSe4B1ZFgsvHGu7izbaS5LxuCouLHTWnW vpKyqoL0tF84N5ukoaaqJTJLUe718pZ5TKmNuh9x1eZa98/5WyYvbM1/MdmL4zpMiRdwaduf8F ASdfV11LsQ4q71SAYQng2RDLFmMe0dA3U1opq7XxpTW10KOUwIC+sO0lbzLlM6yGEQE8Ue8mUF vL1swgm2pP8g2ClQlkcEnP82GHqMxD/OJTM6+Gy+RhFAkFyl5GIfQ6ZEW6I0JtK0oDkU2z0/MG V9E= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 24 Apr 2024 01:00:04 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg Subject: [PATCH blktests v3 08/15] nvme/rc: introduce NVMET_BLKDEV_TYPES Date: Wed, 24 Apr 2024 16:59:48 +0900 Message-ID: <20240424075955.3604997-9-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424075955.3604997-1-shinichiro.kawasaki@wdc.com> References: <20240424075955.3604997-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 the exact same test for two blkdev types: device 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, 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 parameter specifies which blkdev type to setup for the tests. It can take one of the blkdev types. Or it can take both types, which is the default. When both types are specified, the test cases are repeated twice to cover the types.      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_TRTYPES. When NVMET_BLKDEV_TYPES and NVMET_TRTYPES 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_TRTYPES="loop rdma tcp" Reviewed-by: Daniel Wagner Reviewed-by: Chaitanya Kulkarni Acked-by: Nitesh Shetty Signed-off-by: Shin'ichiro Kawasaki --- Documentation/running-tests.md | 5 +++++ tests/nvme/rc | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/Documentation/running-tests.md b/Documentation/running-tests.md index 571ee04..64aff7c 100644 --- a/Documentation/running-tests.md +++ b/Documentation/running-tests.md @@ -108,6 +108,11 @@ The NVMe tests can be additionally parameterized via environment variables. tests are repeated to cover all of the transports specified. This parameter had an old name 'nvme_trtype'. The old name is still usable, but not recommended. +- NVMET_BLKDEV_TYPES: 'device', 'file' + Set up NVME target backends with the specified block device type. Multiple + block device types can be listed with separating spaces. In this case, the + tests are repeated to cover all of the block device types specified. 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 ec54609..a31690d 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -22,6 +22,7 @@ _check_conflict_and_set_default NVMET_TRTYPES nvme_trtype "loop" nvme_img_size=${nvme_img_size:-"1G"} nvme_num_iter=${nvme_num_iter:-"1000"} nvmet_blkdev_type=${nvmet_blkdev_type:-"device"} +NVMET_BLKDEV_TYPES=${NVMET_BLKDEV_TYPES:-"device file"} _NVMET_TRTYPES_is_valid() { local type @@ -54,6 +55,27 @@ _set_nvme_trtype() { COND_DESC="nvmet tr=${nvme_trtype}" } +_set_nvme_trtype_and_nvmet_blkdev_type() { + local index=$1 + local bd_index tr_index + local -a blkdev_types + local -a trtypes + + read -r -a blkdev_types <<< "$NVMET_BLKDEV_TYPES" + read -r -a trtypes <<< "$NVMET_TRTYPES" + + if [[ -z $index ]]; then + echo $(( ${#trtypes[@]} * ${#blkdev_types[@]} )) + return + fi + + bd_index=$((index / ${#trtypes[@]})) + tr_index=$((index % ${#trtypes[@]})) + nvmet_blkdev_type=${blkdev_types[bd_index]} + nvme_trtype=${trtypes[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 Wed Apr 24 07:59:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13641453 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 4165D158D88 for ; Wed, 24 Apr 2024 08:00:11 +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=1713945613; cv=none; b=px9dg3BAitKVmlORK/dqVHDxsI4lFUD7tkF1HVpUdU4t4mVqdFH4SQKcS9Kj97IKtqYgxPe4adH4OUoeVvDzpP3uXYJ5bD45bWTPQ9x6YyGmdnR3zJe1vDec2fp3IdtNSCfBe0kcXzWqAyoOLkln8FC+NHDySAfWbQrsnhi7NWI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713945613; c=relaxed/simple; bh=sLUU92HlqI7uQ9oXxDhbvXA5yCtDZlU1fVCBorHb+ik=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P08x7W2xMeYD0ZbEuklYm/dbO2XeGuoJVbFmCy+1dLDEJeDSDrDBptyqK2ODJQK3/j1qd+/vA9A4dN4Akp6NnMRykD182bdQPXgHFYszlswlVoU8j2yW3aUvC+fdr7MJrIJabX+4cSS0miYfj3+d6RYdAgcA8LMUigNoOZ7Wgwc= 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=C58GyVl+; 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="C58GyVl+" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713945611; x=1745481611; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sLUU92HlqI7uQ9oXxDhbvXA5yCtDZlU1fVCBorHb+ik=; b=C58GyVl+L+NpUDzuwn5k16uh6yi1IsIsVh2iNUjyRUJRmVT5X1stsV4+ p1RcLi1hi3KRXwPNQFXNq/sZ3AEZaS9d6vlM+9CiNdhINorTByxMoNo1D 7CYwOUepNpvevDWmGtRS2w9Sg4ZJJ5Otidm1ZssqUV59iPszsSCLccqZP UCUnJTIG4MXDeFYR3RvbRbtA1CnE3KCCpE3bPTTtKH0wUmQl8WueTPhzq WvYfIFRGAieD4d2ppLnj86aCtZiU8lReRVamnIuUvb9SCSf+hs3YeVysq E8eCM7gUt4NSRKwdw3DxyTbYDOJudzWXADEtcRdReA2YWgc1x5/21V5cD g==; X-CSE-ConnectionGUID: kBQ6BU1SR/WORgFOT9BB/w== X-CSE-MsgGUID: pR0PHkrLR82G5I09ZxAKBw== X-IronPort-AV: E=Sophos;i="6.07,225,1708358400"; d="scan'208";a="14515701" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 24 Apr 2024 16:00:06 +0800 IronPort-SDR: cpIb91bU2lFcCFgPc+2WOyrgrKfHTTrl0pJnLmWhFJtDPO7q/Ny2fwiM3MP+7+/qhdK9xmvwIz r5RhZlQVRwiBRYkvvR8cCLtxouyGPAoeue4hnL6IYPAZVLN2I6J4l5UIN83ydj/fXBZ+rOPnfI t5IVBXTJ4ve7MeEHRbdwlLjNLjI6Kmex+iZ4rWfhlrDdCb9I4vBfQR9fxbqpg5LDSYtusr/6ai 3brv8+ACD9T3jGiS6WlDejjVHlk+fz74sjaBDs6HO7xW7YCKBk+ja++0Hkh7dqrQBMn7J21Lwc 3oQ= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 24 Apr 2024 00:08:16 -0700 IronPort-SDR: YMU4ctI9s5/7PjcWZycVO811+zDpma/UUplTCTimmurmH5VVeeGVC0f+3hosHZY6p5hr4e/Rev /q60sV2XUQcntjI0m66ChlwsJQaxy1aMPQFTT2zkZQhKfI4IkaphY35yVNO3s1l3bOuGbelGGT 6VTqvZCKTtiOjaww7xwac7f1fKmRcVn9VqCA5iAxIZUV8N9zFgUjjfgxHeMI87fe1ipnfULmra ktsio9XseVsLvFl9o82eRyqhjUazZxdPJaPAjtlQwl6j38z2oqlZIaBKei3mmAPBmUqyxtM1aT 3sc= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 24 Apr 2024 01:00:05 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg Subject: [PATCH blktests v3 09/15] nvme/{002-031,033-038,040-045,047,048}: support NMVET_TRTYPES Date: Wed, 24 Apr 2024 16:59:49 +0900 Message-ID: <20240424075955.3604997-10-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424075955.3604997-1-shinichiro.kawasaki@wdc.com> References: <20240424075955.3604997-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_TRTYPES. Reviewed-by: Daniel Wagner Reviewed-by: Chaitanya Kulkarni Acked-by: Nitesh Shetty 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 bb96d1d..36c0753 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 ccf752c..ff0a9eb 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 b92f5d9..cb2637e 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 Wed Apr 24 07:59:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13641452 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 539DD158D8D for ; Wed, 24 Apr 2024 08:00:11 +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=1713945612; cv=none; b=B7m7AvewGhQt3jo4G9HH7QwJpayu+ornPjRxCw6E2T64aZbkKrC59UYH/JcE0ai9s3h7fOHXWkDmSFqieLNIpxdQ3z8S4rQ3TIKzDgWnirpCLwMRqNNKq0yBInrCbNrZZCvgk4Q4T6NfLGEUS98U7xG2Jpk6OsiFQ7m9z+8lCxs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713945612; c=relaxed/simple; bh=e3O80rkK1CVAuLxzt039J7MwxeMHq2ELp8O6/iaSTkw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TUUMSrlpy1t3IMPUnUB15ctrN74VXYtEQbcfXQkS5PMa3nWMQ04ppp1P5eMfaqzbtg4zZGkqlIDef1RE20b+F4v7+f0hZNWtFJv0Eg1wT6ANdCrqLse2yV3tUszN4kxsrfRqKL/lvOF3wGzWQzPIroi7kuCA5j4xb6gF0u4RCU4= 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=FzwCTONh; 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="FzwCTONh" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713945611; x=1745481611; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e3O80rkK1CVAuLxzt039J7MwxeMHq2ELp8O6/iaSTkw=; b=FzwCTONhQvBFsk57v8FHM8p5NOVPEWsz/W4PaCpD0+CW1j4dW04RP63u ICHXClOagY+/Gqo3BfwoY6zFdq/QJPSP2efqrTDdibEiyAqkxth4vfxZa byVwa9oEF0vBHOVi+tN1WU+WWH7S10DrgvlWGa5Wra+roCOzB1ifQZNlS q3a+ekNpUDpzW30fidKVsBccgDBPTbi0jAX13okByifVe/NqWmo8mlBfI V0/5SvjdYP3s2MyvOzxFYxwszwJ3a6Eo1pTO8mf4Q23WIeYQhIoP6WB2K 69+XwW7090B+08ISCfyuvIS+9ZmCn+VVhtJ8OjILIQm7CJFgJ0USw8rmz w==; X-CSE-ConnectionGUID: FY4KImWxTPypghjxWYPaag== X-CSE-MsgGUID: lhnIuKfIQ6q7AysHkXiCNw== X-IronPort-AV: E=Sophos;i="6.07,225,1708358400"; d="scan'208";a="14515704" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 24 Apr 2024 16:00:07 +0800 IronPort-SDR: fm8dE1IAZURMBb7j36O4dtnFlxv6Gut+ASMVhByCawj65xv9rZVT2CMFSToHo/aRtM0j64Id/5 e0ubwKrCAqxu6Tx6tU0Qu9b1HEIm1NlSLMdsArJhD2X5zQFNYpxKy4Wz6NyERSLiwy/0dQ3Rh8 6TM7Drs6t/k2kkAEt0GM7mv3TmDVZI0SZhoXJEUK3GR4ve/Bn55dfiqWAuk1unnKQN//NGZ1Hf HCM8+d2bSZpy9jvuNoX7lIAkzMDDO8NM+UIqPojXbilGIMxMsDP30gK2uNqN0ui7sQBybKU3nN Mes= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 24 Apr 2024 00:08:17 -0700 IronPort-SDR: n8nDbOR+7WshaDgN5fl6gZMoqhKTX8niSXw6hoGP1JzWJBPdcyY8d7JT1hf00uuEWQ6UryubBh snv3ADs/QkbXTmRfNkW/YiG9I2mq8BdB9KtpoNKWJz8jzLU1e1hnSJjz8zqqauF7RLSqXfgk5J SlzlaW2zNzzNQg5lXcvu5WqQ8BTIVMDoYKRZ3nyO8BT4HIuDz93hFhcAD65dQqA5vmHud3xjSQ 1NpZ5aI1VflViAqDVBm/fc6Ptq0LJcx/XizUPS8XJsW5R/Qthg7XExjYPJKeugE5WiO25yXXXW SpM= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 24 Apr 2024 01:00:06 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg Subject: [PATCH blktests v3 10/15] nvme/{006,008,010,012,014,019,023}: support NVMET_BLKDEV_TYPES Date: Wed, 24 Apr 2024 16:59:50 +0900 Message-ID: <20240424075955.3604997-11-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424075955.3604997-1-shinichiro.kawasaki@wdc.com> References: <20240424075955.3604997-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_TRTYPES. 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. Reviewed-by: Daniel Wagner Reviewed-by: Chaitanya Kulkarni Acked-by: Nitesh Shetty 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 ff0a9eb..c543b40 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 Wed Apr 24 07:59:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13641454 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 074BD158A21 for ; Wed, 24 Apr 2024 08:00:11 +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=1713945613; cv=none; b=gYxuigMt6w9+rD88pvtRuSwpKJfZDgwRGjJqQtAIR+09tIzwBQukZ+fDjQ2idxBkVFW9lcF8SqHzJId77gcBB2p15SKB2lnXZ64Ytudn9IqdXqM6++FR59o3UmejLeMOCSrcybrLrfnBZip3JcqNQjGGy2VykIQ7xsfLxWBfih4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713945613; c=relaxed/simple; bh=IUIBD9g/6z1tK+pWEKQXbrEXQF5v0iVXjPf8Nl14PXI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kvIr9pEuCHoWCJiHvB8apAwQTRnE4dqThLiyI5tneqCxkzOL3v7wOmBWQd8QmecOYTD/tk5so1QJCaWyw1MrLNkselkSmULp9FWIwh0ew3ABncVXI7/LIcvI955c/I5Ongov2RmKSGoM7/L/gxneHTZTN+cIV//3MRNYNPLD460= 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=TZRjOpvT; 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="TZRjOpvT" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713945611; x=1745481611; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IUIBD9g/6z1tK+pWEKQXbrEXQF5v0iVXjPf8Nl14PXI=; b=TZRjOpvTgRRHiTOsP6Qt7Cun/3ISCxLg7uuo9xLOASf5zndXCQwixw5S /ZBp+7gWQgfmg2NNdkAkgCDkGF8OvCdC8bq5oey69iTqdDLun4Ezt+SNo 5pA3JFeSVWTh7tIodPGON6MpFpylISaO3UGADG8MU2wYmCIs37BrJXn/5 Zdt0MnKX/ktjSs6jI7vE7Ijc0EuqCEvzM9z54Qf1ksdPpGKXXEAXqQnxX iOLbN+PAcSA0HRI5Q9ox72VVbbmRpm0J7ZgkHHYBu1hzJtrG2e5bBgPi1 S3xHiOowNfx34qPe5msJ3UwZzYERB1qJ2q7YgzccQpI+3YxTq3+O2X2X/ A==; X-CSE-ConnectionGUID: 1UnKSCM4RaqGQE0MUUjjfg== X-CSE-MsgGUID: 46w2WjGRTa6YeOzA/yMlMg== X-IronPort-AV: E=Sophos;i="6.07,225,1708358400"; d="scan'208";a="14515711" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 24 Apr 2024 16:00:08 +0800 IronPort-SDR: +eFUMMdgWDpjSWUPjChdx/cWJ5+LJr51n+UK84kc45OeTVQiBwZoklbmYsGWMhovtIFStbJxBB Fav8hwdsnbi+alnJL2vjiFVLwX7A6NQAuZYzEyZaLFSMWrVu2sMmCr11Ro/5NMdioFDEGhMSfv bZmjK4s6XQdxPBZPTY2NOQDjjZKE/wmlrcYOgrvNW6sQwR/OgCZbTXnPXiyvgRRVGkZkdcSvRl +FoWtAqTgf4g6iQlIkeHWpReDaq9M8BzRyJIEJbOKBeZ0BiGoDaZQY0OjqmhSDRVsbWOZPaAwO 8ZY= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 24 Apr 2024 00:08:18 -0700 IronPort-SDR: RbdhU4trjlLp62PDqj3K9aSk+oPtYkuqU8XF2AZLzr0o6BLN6ZAWWJLzGDf39dWfw3yLwssOS4 DC0mU3Pxvw9Su5AZsAKKwqF6rQqruK+sqeHntlLRm5/fU/Dy8XeBqokSPB1AyG0ea4rOFt1UDW NJknRXe43PqD0HgTBzhFJ6NHRnUDul0PoHrMeO47y4956tqqwUTLxKM3bj0NYmPIEwKebtG06M oln7pNwvIw918+xJJsof19lb+hfkkr3gq9zLKVjo7h4HHotx/EILEORHrcK7Fw58BmOmlx+Gfi m8Y= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 24 Apr 2024 01:00:07 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg Subject: [PATCH blktests v3 11/15] nvme/{007,009,011,013,015,020,024}: drop duplicate nvmet blkdev type tests Date: Wed, 24 Apr 2024 16:59:51 +0900 Message-ID: <20240424075955.3604997-12-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424075955.3604997-1-shinichiro.kawasaki@wdc.com> References: <20240424075955.3604997-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 Reviewed-by: Chaitanya Kulkarni Acked-by: Nitesh Shetty Signed-off-by: Shin'ichiro Kawasaki --- tests/nvme/006 | 4 ++-- tests/nvme/007 | 31 --------------------------- 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(+), 336 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 c543b40..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() { diff --git a/tests/nvme/007 b/tests/nvme/007 deleted file mode 100755 index cb2637e..0000000 --- a/tests/nvme/007 +++ /dev/null @@ -1,31 +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 Wed Apr 24 07:59:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13641455 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 DED56158A22 for ; Wed, 24 Apr 2024 08:00:12 +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=1713945614; cv=none; b=ejGPzyKymSQW0U6BjVxFVwXnAoScuEQUAuJyEGz/xEY4jAHTPJc52KlON2J7V8NXmkt6wUXbINCKSY3bGBfVdyuLJt6dz2if0/kuZT2XMLIX0YCo1MliZfDtgP1MtiUrJb1mjCvpCPvG+OZ2HIFk9wDuiJwXATQn2DH08ovg5zc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713945614; c=relaxed/simple; bh=8xdHdVnq2DuNvi82OK9GytjO+E9jtZ70bPcGmaQ2f08=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TLLtBjg8HTMkOOhGQ4alAEyCIHhuQTPJrv9GV+jwOjXibgXlQkouqLLrNNUplwzpB3gf4LhJIDAFhpGj9kZOzvqAzC0ZurP0UF1lIDJzxTgEc1mbCe3wNzVVlL5NuBo8VuDcqAm4nVbteaOtCzl5UZx908UvjNZJtyuys/o3CVg= 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=fxG1fwa3; 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="fxG1fwa3" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713945612; x=1745481612; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8xdHdVnq2DuNvi82OK9GytjO+E9jtZ70bPcGmaQ2f08=; b=fxG1fwa3PgQOajDbvRM8Pm93RUpn26nRgeIRGJsx9Xy/4crSgQrHefUc 5JLqr3TXcYn8KwPcKlvnDUJMODyBwGaAAihTPGSVRaigBCaXeP7awdnfq G7fuDc6Via//jC9JrXI8MuQ40ZVxXX8XmLzN8lCXf3O1+ig3/qGf9umKp pVlb6yydMSlizyBEexlcmMDaC6E1tVogMBg5/6p9IaO02ogg4ZRb8KSRE VzWtsUfmQqFQHAv6BcHSW9Y0ZR97xGoy+KrjkvTYi7gUJoSNR8VdsAYV2 aWYtvtJz42iHDTL7tw/sKcOfgmI8ZU7NXhkCKd+vd7fOgL47S1Dpku2yO Q==; X-CSE-ConnectionGUID: BrS8ypeiTK+wM0zFwsOK0Q== X-CSE-MsgGUID: YgmxmrzyTNO9seE3pYh8YA== X-IronPort-AV: E=Sophos;i="6.07,225,1708358400"; d="scan'208";a="14515716" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 24 Apr 2024 16:00:09 +0800 IronPort-SDR: UTpcGPlBSzwSvXWv3akAjNDFWu5oeP/juKv1DnP7xwx4iH/gOB/TDKgfS56RhX7SRaCa4uWXKY wWadGmiZ3kJ68BZpd+COWVV1IkElc06e6tnb0uk9oRaWFjQjl3N3vP53Mww72miwQ2fJ6E+qxu WF+CuKjzeqS02Xrcv6Ama2EPhncaLUxeu0QSBHEpjXdcdMlpnPtftgTqvaFBHEQp6WLD4vqcpi MJMvlm4aX6YyGoPsVpWXWFsjXub3uA6RjvlLdmulD8epU1GsQMdZg1Q02kmJE8wk46oB7TSS1Z ed4= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 24 Apr 2024 00:08:19 -0700 IronPort-SDR: 3ZbTAafxwQ4Xu/YkdmnTyMImm4/52wWERPKIemNrZ9bUE4R4ka3f0bql00Umq6k74qFvAqo3z4 V1h4epcXg3GgOmA9nnRmBAonPEfQHb7VWKgsMQTcNuM1lcHbBbL5nBkyNq1qBJKp8fTSTxe4Fl 9fbWqToX5ANZLGgoJwIu4ZXmY9Ven7Qjab1k1aMw6SRTFI8ou1RCgd6meXvD0WsMwsNPBdM4ln t0n0AB9iUE5c6WWWgRmv/PTUpblIWx0NKxcc3Nx18Vxg386JJSf3luwFJJLS8dXr4a87kqOo++ fEE= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 24 Apr 2024 01:00:08 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg Subject: [PATCH blktests v3 12/15] nvme/{021,022,025,026,027,028}: do not hard code target blkdev type Date: Wed, 24 Apr 2024 16:59:52 +0900 Message-ID: <20240424075955.3604997-13-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424075955.3604997-1-shinichiro.kawasaki@wdc.com> References: <20240424075955.3604997-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()] Reviewed-by: Chaitanya Kulkarni Acked-by: Nitesh Shetty 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 From patchwork Wed Apr 24 07:59:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13641456 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 2D7E2158D9F for ; Wed, 24 Apr 2024 08:00:13 +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=1713945614; cv=none; b=plnC8CDW+L6bpL9UYD+aObCUiN1eqxMXuHebtB4Fh6P5vcp1RFBrCrw3CNBiiMcoN+SlOMPgSwkhQs2GZzR/+3r4mVygkWJO8zud93ehETglBQgY340oSUwJLkpEZRGsUiUHV0nI0o6760xOf9nXkSLPlUun5ddCKnIwxFXv0ZM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713945614; c=relaxed/simple; bh=IIzLHZ0xDcoXvdTGBnbL9BdlXaLVUODqXivyreG6OI8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BU29whOMP3pmf6ouHWR18l00bCewEvcGY5ierM4XtGCdeudcG+XSfByK+ug3yrXemepUxw+tO5DjVMCUgOHxxauUfT6RT5iBxUMkF3q/reNufexFGEnivmlPsfyqh2t94KWNaxBBco0MJ+O0CtxTQDrRmhADXU0q/DeT1Xo2NtI= 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=mihci5OP; 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="mihci5OP" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713945612; x=1745481612; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IIzLHZ0xDcoXvdTGBnbL9BdlXaLVUODqXivyreG6OI8=; b=mihci5OPeyyDJKt7WoKDOfcjHqb1FzLVBDGAm8nfKz9PrZ1Vtab+KsnJ Dp0RDF0vyKtZ3xJjAhxJ09CazgFLceiCscB5smBzIwwmmAsWTRamEqiVf 4V7YcElSWi88m9QlNWUFQnrNK/uxM8TFFRTtZBCbtKESoDqB53fQ1x4X8 c5AlHQ7t29cRgJKBd08xA3nFcz9VCYmo6PJsDoyaJrQJAt3bHL4qulM2e P083baD+JKSqHb2TpKVyYslA1q66Yv6JmTbqAMQAEpkFIVARQFVgprsNE NENAVNEl92dBvVx2SwhqTqs3IfoONOrIf/MpICgCv78jtorwlEsW8UF/a w==; X-CSE-ConnectionGUID: I3nlnyBpTRKSKfHY7oXRlQ== X-CSE-MsgGUID: pqEzyPo1Q+S7e1MSoKcdNQ== X-IronPort-AV: E=Sophos;i="6.07,225,1708358400"; d="scan'208";a="14515728" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 24 Apr 2024 16:00:11 +0800 IronPort-SDR: +obAjQXrWwZGMB7TsdWSom/VQhEtc2CiB633t4Jfiq9zOjxvIam5UxBTMjwoCGGTvAYr8tnAC2 APfNNX3bilu7l/Z8rvmDM9lFvK9ogfz1KMlcrBRlZ1ASluwiiiZtjbqM8yL8t9kOi8wtCTYQue nm4pm6sC6H6GgkeaeT80PdcI8j010PDphL8AG9FriSrBrK/mJD2N+TprUDDmBwrqv3Tmmw1Sf9 CR7FsRj9Me7F0J8iFGLVxSR5fkNdPjlsQdsb70Ai3tutx79T0WPnPlqJfYYs3uR7ciwUKGeUA1 WpA= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 24 Apr 2024 00:08:21 -0700 IronPort-SDR: drLCxtdu3hJwEHv0XteFNIZlY1I6rN2e2b597kyjjIysvolujINHLNprofLK3WAJldGVKsP0BY ggrlJZWswyoMZwJNaySMCUxCHqDJygx7st0JWIZfzeLzoF5I9mqX4D/f7f5B/qYOG846fGd/5h wmIyJkgvmxXuL6ox8gpKnZzhHLd30N88bhB2i6fsH5NDb9EljUAOz+lJdtu8EPH/Z6BC5DHCd+ zPBK6l7xX6dfU+iDYBvwI4MQsR+lAGVv/QXeU1xIezc8jrIDtlJJuuAwajVnjru+ZYq7ukcp/M DAQ= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 24 Apr 2024 01:00:09 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg Subject: [PATCH blktests v3 13/15] nvme/{rc,010,017,031,034,035}: rename nvme_img_size to NVME_IMG_SIZE Date: Wed, 24 Apr 2024 16:59:53 +0900 Message-ID: <20240424075955.3604997-14-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424075955.3604997-1-shinichiro.kawasaki@wdc.com> References: <20240424075955.3604997-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 To follow uppercase letter guide of environment variables, rename nvme_img_size to NVME_IMG_SIZE. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Daniel Wagner --- Documentation/running-tests.md | 7 ++++--- tests/nvme/010 | 2 +- tests/nvme/017 | 2 +- tests/nvme/031 | 2 +- tests/nvme/034 | 2 +- tests/nvme/035 | 4 ++-- tests/nvme/rc | 8 ++++---- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Documentation/running-tests.md b/Documentation/running-tests.md index 64aff7c..736ab48 100644 --- a/Documentation/running-tests.md +++ b/Documentation/running-tests.md @@ -113,9 +113,10 @@ The NVMe tests can be additionally parameterized via environment variables. block device types can be listed with separating spaces. In this case, the tests are repeated to cover all of the block device types specified. 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. +- NVME_IMG_SIZE: '1G' (default) + Run the tests with given image size in bytes. 'm', 'M', 'g' and 'G' postfix + are supported. This parameter had an old name 'nvme_img_size'. The old name + is still usable, but not recommended. - nvme_num_iter: 1000 (default) The number of iterations a test should do. diff --git a/tests/nvme/010 b/tests/nvme/010 index 9ea2561..d99067a 100755 --- a/tests/nvme/010 +++ b/tests/nvme/010 @@ -32,7 +32,7 @@ test() { ns=$(_find_nvme_ns "${def_subsys_uuid}") - _run_fio_verify_io --size="${nvme_img_size}" \ + _run_fio_verify_io --size="${NVME_IMG_SIZE}" \ --filename="/dev/${ns}" _nvme_disconnect_subsys diff --git a/tests/nvme/017 b/tests/nvme/017 index 9410cdc..4f14471 100755 --- a/tests/nvme/017 +++ b/tests/nvme/017 @@ -25,7 +25,7 @@ test() { local port local iterations="${nvme_num_iter}" - truncate -s "${nvme_img_size}" "$(_nvme_def_file_path)" + truncate -s "${NVME_IMG_SIZE}" "$(_nvme_def_file_path)" local genctr=1 diff --git a/tests/nvme/031 b/tests/nvme/031 index b98630a..00d3d18 100755 --- a/tests/nvme/031 +++ b/tests/nvme/031 @@ -37,7 +37,7 @@ test() { local loop_dev local port - truncate -s "${nvme_img_size}" "$(_nvme_def_file_path)" + truncate -s "${NVME_IMG_SIZE}" "$(_nvme_def_file_path)" loop_dev="$(losetup -f --show "$(_nvme_def_file_path)")" diff --git a/tests/nvme/034 b/tests/nvme/034 index 522ffe3..239757c 100755 --- a/tests/nvme/034 +++ b/tests/nvme/034 @@ -29,7 +29,7 @@ test_device() { _nvmet_passthru_target_setup nsdev=$(_nvmet_passthru_target_connect) - _run_fio_verify_io --size="${nvme_img_size}" --filename="${nsdev}" + _run_fio_verify_io --size="${NVME_IMG_SIZE}" --filename="${nsdev}" _nvme_disconnect_subsys _nvmet_passthru_target_cleanup diff --git a/tests/nvme/035 b/tests/nvme/035 index cfca5fd..8286178 100755 --- a/tests/nvme/035 +++ b/tests/nvme/035 @@ -17,7 +17,7 @@ requires() { } device_requires() { - _require_test_dev_size "${nvme_img_size}" + _require_test_dev_size "${NVME_IMG_SIZE}" } set_conditions() { @@ -35,7 +35,7 @@ test_device() { _nvmet_passthru_target_setup nsdev=$(_nvmet_passthru_target_connect) - if ! _xfs_run_fio_verify_io "${nsdev}" "${nvme_img_size}"; then + if ! _xfs_run_fio_verify_io "${nsdev}" "${NVME_IMG_SIZE}"; then echo "FAIL: fio verify failed" fi diff --git a/tests/nvme/rc b/tests/nvme/rc index a31690d..c018f7f 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -19,7 +19,7 @@ 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" _check_conflict_and_set_default NVMET_TRTYPES nvme_trtype "loop" -nvme_img_size=${nvme_img_size:-"1G"} +_check_conflict_and_set_default NVME_IMG_SIZE nvme_img_size 1G nvme_num_iter=${nvme_num_iter:-"1000"} nvmet_blkdev_type=${nvmet_blkdev_type:-"device"} NVMET_BLKDEV_TYPES=${NVMET_BLKDEV_TYPES:-"device file"} @@ -165,10 +165,10 @@ _require_nvme_test_img_size() { local nvme_img_size_mb require_sz_mb="$(convert_to_mb "$1")" - nvme_img_size_mb="$(convert_to_mb "${nvme_img_size}")" + nvme_img_size_mb="$(convert_to_mb "${NVME_IMG_SIZE}")" if ((nvme_img_size_mb < require_sz_mb)); then - SKIP_REASONS+=("nvme_img_size must be at least ${require_sz_mb}m") + SKIP_REASONS+=("NVME_IMG_SIZE must be at least ${require_sz_mb}m") return 1 fi return 0 @@ -915,7 +915,7 @@ _nvmet_target_setup() { esac done - truncate -s "${nvme_img_size}" "$(_nvme_def_file_path)" + truncate -s "${NVME_IMG_SIZE}" "$(_nvme_def_file_path)" if [[ "${blkdev_type}" == "device" ]]; then blkdev="$(losetup -f --show "$(_nvme_def_file_path)")" else From patchwork Wed Apr 24 07:59:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13641458 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) (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 05531158DA4 for ; Wed, 24 Apr 2024 08:00:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.153.144 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713945615; cv=none; b=pvH8af5BDb0RWrKrBsVDQEYgz1frZUUjyffRwa/NvvWsSnshlfAUevi/Pw7H9ZqjcuEnvDxiFxpLdFG4zGBIxdFNVweasIQURlghh63Lu+zQ+6msmifMIpy1rwx6qmSSiNc8FBg6uec5aQtS6Z3YgJereFc2kqV6bR2srIOI+xU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713945615; c=relaxed/simple; bh=wEETruXenXXhFB3ZAUX4lMN5f17bmvYtqaqOJwjBWaU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YIJFlojsGhHIJfeAXYiXBwFt2PoWkbsM/pIROVCWEYkAqixFMh1kBnEpTZC5gB3LWHaZosExi1PN7/PJgI1KyO+HB6QPvJuywEBKid7AFpPr5xMHrTqvpWU+93QpIKUOPx3Y5Q22bdZpULQVwKFL3j3oPboOO/HdTvpZWvaZQ8Q= 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=IjdluCOy; arc=none smtp.client-ip=216.71.153.144 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="IjdluCOy" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713945613; x=1745481613; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wEETruXenXXhFB3ZAUX4lMN5f17bmvYtqaqOJwjBWaU=; b=IjdluCOyKdZ3+U0KzdcA1taN9y7D30xkwVnOtxSE03xFwhnAQv9hiQRN /JNio+sPeEVeWh3PIiRe+nXUUZA/doILijVBClfXbIezk/50jiAYXuWPe j7NBLc27jkzN6rljfvbpQyqFbc3wVCUSkZtOLoaXocN/jwOSk3fZz+O8j D9dx9fGLH5M7Y35ktKZcsdahTO37+IQHuOQKPAB5iAzOTjbYvMEykzR08 Gr7kWdHgPz+DZW+FqVRSOKr5YeKYyJGh6lURBgKyNcY2/lUBh/vnGGTQo IgtDo58LVrI9wsZjdYRUsnSIScXi0e887GO2aEOkLuy/7kbp0CBOHQdWI g==; X-CSE-ConnectionGUID: RjtxjSCZTuy7v0DKgxasCw== X-CSE-MsgGUID: LKzjQYnbRyuR9kFwOSANhA== X-IronPort-AV: E=Sophos;i="6.07,225,1708358400"; d="scan'208";a="15465320" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 24 Apr 2024 16:00:11 +0800 IronPort-SDR: 2Pn4QhDTn2NjbsLHGgavQV/4G3mslQ7Xb+HallPsLFdaxTc0WN1nmfJRs+een3r006LOrH1djp IU4UPIixYxltBrHWYFP1bxN2URhybgOeHjpiRIUfOgdpDSiReyR0HfPo8np7mDFJ3PYK1ZqWht c53DyRDBf8F9rXdJxrrchvLQzUb4qsgmLPRTuJIl7Wif/LBsmv0sQ+1a9hdM8xN6IhjmgTc9I5 /TVp+B8m3KhCYjuRiZIKV3uXlOIFCB7aM9g4J4ZDFGSwlg1mkNjo7s+7zpW1jY6s5SgVbxV7Ot NS0= 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; 24 Apr 2024 00:02:41 -0700 IronPort-SDR: GAVsd/wV3laXdCWYehhnAAsAtGEkkIXAGIRDibzbicOA019uihWuMZDXpGFqAk666VQLCvH6bf bImMlth5HdUwcWsvQynflBAwz5IORorxAS6K+ZVS3ep/wonY6WSgDGV3syf5XFLJBHynsCyxVP 8ibwMfL/VmQfJc/cW2ltEtBXxQ76nRhMEoc3QChCiTcmCFJNMdDnFJ5aAeBeeCfahLXvD28W9m KGkHl603Xr+ZMRyBp4wQ4dpe7pEnDl+1Z4tyUupuvu37P3ejOZH7zWIgnwihI2VUUC1EW7x+9Y 6WM= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 24 Apr 2024 01:00:11 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg Subject: [PATCH blktests v3 14/15] nvme/{rc,016,017}: rename nvme_num_iter to NVME_NUM_ITER Date: Wed, 24 Apr 2024 16:59:54 +0900 Message-ID: <20240424075955.3604997-15-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424075955.3604997-1-shinichiro.kawasaki@wdc.com> References: <20240424075955.3604997-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 To follow uppercase letter guide of environment variables, rename nvme_num_iter to NVME_NUM_ITER. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Daniel Wagner --- Documentation/running-tests.md | 5 +++-- tests/nvme/016 | 2 +- tests/nvme/017 | 2 +- tests/nvme/rc | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Documentation/running-tests.md b/Documentation/running-tests.md index 736ab48..7bd0885 100644 --- a/Documentation/running-tests.md +++ b/Documentation/running-tests.md @@ -117,8 +117,9 @@ The NVMe tests can be additionally parameterized via environment variables. Run the tests with given image size in bytes. 'm', 'M', 'g' and 'G' postfix are supported. This parameter had an old name 'nvme_img_size'. The old name is still usable, but not recommended. -- nvme_num_iter: 1000 (default) - The number of iterations a test should do. +- NVME_NUM_ITER: 1000 (default) + The number of iterations a test should do. This parameter had an old name + 'nvme_num_iter'. The old name is still usable, but not recommended. ### Running nvme-rdma and SRP tests diff --git a/tests/nvme/016 b/tests/nvme/016 index a65cffd..d1fdb35 100755 --- a/tests/nvme/016 +++ b/tests/nvme/016 @@ -23,7 +23,7 @@ test() { _setup_nvmet local port - local iterations="${nvme_num_iter}" + local iterations="${NVME_NUM_ITER}" local loop_dev loop_dev="$(losetup -f)" diff --git a/tests/nvme/017 b/tests/nvme/017 index 4f14471..114be60 100755 --- a/tests/nvme/017 +++ b/tests/nvme/017 @@ -23,7 +23,7 @@ test() { _setup_nvmet local port - local iterations="${nvme_num_iter}" + local iterations="${NVME_NUM_ITER}" truncate -s "${NVME_IMG_SIZE}" "$(_nvme_def_file_path)" diff --git a/tests/nvme/rc b/tests/nvme/rc index c018f7f..8762a56 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -20,7 +20,7 @@ export def_subsysnqn="blktests-subsystem-1" export def_subsys_uuid="91fdba0d-f87b-4c25-b80f-db7be1418b9e" _check_conflict_and_set_default NVMET_TRTYPES nvme_trtype "loop" _check_conflict_and_set_default NVME_IMG_SIZE nvme_img_size 1G -nvme_num_iter=${nvme_num_iter:-"1000"} +_check_conflict_and_set_default NVME_NUM_ITER nvme_num_iter 1000 nvmet_blkdev_type=${nvmet_blkdev_type:-"device"} NVMET_BLKDEV_TYPES=${NVMET_BLKDEV_TYPES:-"device file"} From patchwork Wed Apr 24 07:59:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13641457 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 001DB158DA2 for ; Wed, 24 Apr 2024 08:00:13 +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=1713945615; cv=none; b=LzJzItg/ed6aW0hy8/4FttfpJ8gvDDWtFT1fnUV9krjIj83H16+mS3fE6AklBtBV5aGYejvQevOOxrVV6nf/xB5+ucwlUHJYBcdAjyswYZfR2EM4sidK4ISpNzpj971nJA78uXD6LgVDB+/brXyrQhWgALGWHzAWoBt9tMAmJjQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713945615; c=relaxed/simple; bh=sSC9duX72FifCTm3ELiWm9Q8X/xeNDFYZA8WyilwbPA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aIBWrRhDJXDnvi1kRrYL0fHEaLkH/0aVgLRZZt5oWlehk7ExxZvLewVZLKwL2yHLDZp68xUAa5JRapQgDCQs8pQWf9lCu0OEcQFtFUyNVFTMnAZulcIlRLQKVRLEy3Omwf8Xu0hi1aihWP3IoKYya+VYJU7nyLY46uwBFJATPiI= 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=JJQN7GQs; 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="JJQN7GQs" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713945613; x=1745481613; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sSC9duX72FifCTm3ELiWm9Q8X/xeNDFYZA8WyilwbPA=; b=JJQN7GQs5uxiQZXRgiOPllUFw7PZVVZYK6QPSh9Jy9Q2g7z5+nICByGi 3zp0wFXkXFI1RD2PIg41Bjyf9vuXnZ5XfPRQOaJkik1p1iEsTO9POYMbs fUAjiPtiblyfs5FJsPZtkGHhOTaCODkpijEi5ZKkXzdLkE2UzC6hi4NuL eOTmkFFqFXP8Zkdykd1dKuiCdbwqLXiTIoUgiYiFrVDO9WUNHPpYg1dcV oPHrAln6W7zBGRVZ5lpZV2unyPuKXPe6wsi2cOgILJXPuEhc++FIW5Dk2 tN3lNkbaPVkJHM+FZwzSgsCgpJxxB1PWvC9b06e1A8xnQU2Jpvv/UNIyh w==; X-CSE-ConnectionGUID: 5Nfehy6+QgaMZ9CrMn4SqQ== X-CSE-MsgGUID: Hdr/MklGS1iGnf0rmubhrA== X-IronPort-AV: E=Sophos;i="6.07,225,1708358400"; d="scan'208";a="14515732" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 24 Apr 2024 16:00:12 +0800 IronPort-SDR: X/fAv3dqSlQrJ0HuUGAt6teCIFZQBNfgmtbvcT5uQNaITbzIFXFVXbbh0olqoUmBHEmgREO8cM 8rAQvhzKyVs+p1mQV+9ZNs7qMjin5psBmxCUBgd3SQXuVJLVF7rCjpMr7xUC+0Xzpt2wA6ns3D h1Z5JmCncvgkk7cuI6g6rtxG+sPxBJzjU9ng/uBpzlfD/AL+VDSKG6XiYmnPeAKOhJhO4zILyY RU3mno4t1mF2TJjdqCUZe7Rpo9/jZw66QJovgUzFzIKzfx1/KTX2ioZe1JImWou9OH6Zlt/VKk 9vA= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 24 Apr 2024 00:08:22 -0700 IronPort-SDR: MlOKba1Lp9hfmyqNfUobT2+/JTJBQNiAdMH4tJM+WV86fNGZqX2T0vMBObHYNN46iS1ZdaTs0t 9lAM/msyFXlje5E8D1IWkgHXjhyFUEs3fZIeWtoxuBJeEnLZqu/RMC8ij8YThpUz/Lm60cn+st dJUcb3ZdaKSF0+Gv2cYyVXovUJLK+EuKHR8sr0wOdy0vSE+u8iJ1NZH0Obv8ClXv5CxEVl7mfw GsIHV/OnCpQRyR6IUi97M9i8VwYDvNK+3Povc/hBPOildynX6Tx/TUGebQRigDIi3PfFGiQKsw zEk= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 24 Apr 2024 01:00:12 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg Subject: [PATCH blktests v3 15/15] nvme/rc,srp/rc,common/multipath-over-rdma: rename use_rxe to USE_RXE Date: Wed, 24 Apr 2024 16:59:55 +0900 Message-ID: <20240424075955.3604997-16-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424075955.3604997-1-shinichiro.kawasaki@wdc.com> References: <20240424075955.3604997-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 To follow uppercase letter guide of environment variables, rename use_rxe to USE_RXE. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Daniel Wagner --- Documentation/running-tests.md | 6 ++++-- common/multipath-over-rdma | 5 +++-- tests/nvme/rc | 2 +- tests/srp/rc | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Documentation/running-tests.md b/Documentation/running-tests.md index 7bd0885..968702e 100644 --- a/Documentation/running-tests.md +++ b/Documentation/running-tests.md @@ -132,9 +132,11 @@ NVMET_TRTYPES=rdma ./check nvme/ ./check srp/ To use the rdma_rxe driver: -use_rxe=1 NVMET_TRTYPES=rdma ./check nvme/ -use_rxe=1 ./check srp/ +USE_RXE=1 NVMET_TRTYPES=rdma ./check nvme/ +USE_RXE=1 ./check srp/ ``` +'USE_RXE' had the old name 'use_rxe'. The old name is still usable but not +recommended. ### Normal user diff --git a/common/multipath-over-rdma b/common/multipath-over-rdma index ee05100..d0f4d26 100644 --- a/common/multipath-over-rdma +++ b/common/multipath-over-rdma @@ -12,12 +12,13 @@ filesystem_type=ext4 fio_aux_path=/tmp/fio-state-files memtotal=$(sed -n 's/^MemTotal:[[:blank:]]*\([0-9]*\)[[:blank:]]*kB$/\1/p' /proc/meminfo) max_ramdisk_size=$((1<<25)) -use_rxe=${use_rxe:-""} ramdisk_size=$((memtotal*(1024/16))) # in bytes if [ $ramdisk_size -gt $max_ramdisk_size ]; then ramdisk_size=$max_ramdisk_size fi +_check_conflict_and_set_default USE_RXE use_rxe "" + _have_legacy_dm() { _have_kernel_config_file || return if ! _check_kernel_option DM_MQ_DEFAULT; then @@ -396,7 +397,7 @@ start_soft_rdma() { local type { - if [ -z "$use_rxe" ]; then + if [ -z "$USE_RXE" ]; then modprobe siw || return $? type=siw else diff --git a/tests/nvme/rc b/tests/nvme/rc index 8762a56..24eafd2 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -103,7 +103,7 @@ _nvme_requires() { _have_driver nvmet-rdma _have_configfs _have_program rdma - if [ -n "$use_rxe" ]; then + if [ -n "$USE_RXE" ]; then _have_driver rdma_rxe else _have_driver siw diff --git a/tests/srp/rc b/tests/srp/rc index c77ef6c..85bd1dd 100755 --- a/tests/srp/rc +++ b/tests/srp/rc @@ -51,7 +51,7 @@ group_requires() { _have_module ib_uverbs _have_module null_blk _have_module rdma_cm - if [ -n "$use_rxe" ]; then + if [ -n "$USE_RXE" ]; then _have_module rdma_rxe else _have_module siw