From patchwork Sat May 4 08:14:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13653813 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (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 C75DFD29E for ; Sat, 4 May 2024 08:14:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810500; cv=none; b=OtWzl7UiMook1CkQhBFeqCaQbKcnb6Z6WL+owkLmAcJnZNaYiISlmTtSahuENYveAtdIua06QVYsioTzQsbjmJR2Y8rREko/PNddG2Gz0q4iCOkR7Nj73TLfPtJ6gmfE9TneT3SzM3dzQfJjUI1vlbzRf9q/ZOjfADrK/SWWi5A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810500; c=relaxed/simple; bh=29N5U6N1y9BlM6ECK69L6XwHI/nK7ulbD7kVCqyaSx0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cwa6TQ07VWlcZJ0wdIp1RyVwYPVl+iGycaEf5KGkHq0UeYPsyo65P6Y8YnkiRc7p2h2MPE/jvDTDMDl85F3ukB4JQHPESEJj0YEsnU23uws3xCuv1C5Br/tJ0zruEigYj6n4rVs4x86te+z084/FG+cNue91ZyPhAqYg6HwvT/M= 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=eB/WlAFa; arc=none smtp.client-ip=216.71.154.45 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="eB/WlAFa" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1714810498; x=1746346498; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=29N5U6N1y9BlM6ECK69L6XwHI/nK7ulbD7kVCqyaSx0=; b=eB/WlAFaofb+SBrIO0n078ODZRGxd6TDvlTz4WhTj/VdJYeUQVfNZx0i nmSKe5pcDGeylIkP0nLtNovR/iDy43XYu3svJ9zLdVVwehp70wJuhZgfd vCM1Sur532Jm4KdO40ZJ9hDOv9rQPErivJXAdQGlitP5clmr6ziTpI1Xi HHxqmv+GxqdV7A/89TQ7HydNJnt9zHm8kUCLaq8tDtx8IgdqU7OMlQm95 4tMExQdc2DBzwWPIjDwRD0CS6c+4OPzz6iX71q7GfzLmxhC/2+n3yMsvq mV1Kc6TOW3b+9sZs5Ud7LKz5ew7y3Dpl1FSRVMejs1jfv+LSOx2BxzHoT A==; X-CSE-ConnectionGUID: P5Hsh9VySuu4eturjY+TqA== X-CSE-MsgGUID: 767+Q1weSACETvv0kkAH4A== X-IronPort-AV: E=Sophos;i="6.07,253,1708358400"; d="scan'208";a="15540292" 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; 04 May 2024 16:14:51 +0800 IronPort-SDR: 9j81RalhNNQURYpt8EzRmr0CPs6i1mMKmAJ1AiBVB4TeoClYRwD4rug87iWDowoLsf2Nwslvh3 iJ60OhiVH77EseOzXrorQjWh3l6sFILmjuzEoAgNefEEUsAAyDoKhT61yhUwEvO9e/mDjiTH94 kYsf8XD/UjxKoeF8USD8UVxHyIW/cU5dGVRYyiMzj4YmEX18xVJCbh2pjX+wdKXA8BoE0Ygql7 dgo9Ql4Ubv6axp6ix82MsBrRa7bJlNlfNZ7KfxqQWenRgDJ/23seZzUirfnM7d6H9+nxogZFbd n14= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 May 2024 00:22:49 -0700 IronPort-SDR: /r2o56pQMmpWDEcNJHGtuzhL8Mvi8YGgsUKZu21Ry/EzigCQypNhuLqdIe6WUVVmGeXsR5EqKc /f8E1+02sFb9HqsGvNJUzY7Zvh95BlcvnUaFvn5l7TbCUwB+YbZSpo17DK+d5UZUxrpIZOKNWY p4XdU5SE1aTPdIrJ6Uk26BykldZZHbGrJTgM9moOcyM8FEe3Z1H77imvJ1+lUKsx+BWz2LxiMA l4FuvZpYdilw6mBvOzrs5W6+/tUIldqIgktHpfNLPI/xAhquJGKNn71WDQZz/twQ8AdOWGEUOz H/0= WDCIronportException: Internal Received: from unknown (HELO shinhome.flets-east.jp) ([10.225.163.38]) by uls-op-cesaip01.wdc.com with ESMTP; 04 May 2024 01:14:50 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg , Shin'ichiro Kawasaki Subject: [PATCH blktests v4 01/17] check: factor out _run_test() Date: Sat, 4 May 2024 17:14:32 +0900 Message-ID: <20240504081448.1107562-2-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240504081448.1107562-1-shinichiro.kawasaki@wdc.com> References: <20240504081448.1107562-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 Sat May 4 08:14:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13653814 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (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 8B393FBF0 for ; Sat, 4 May 2024 08:14:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810501; cv=none; b=OkTEJNndiA4pKI6FEdmdkyLGhl1t76VnDAC0TFFg7kmcnCoBZFlCEAmahSbIXeSE9ZVzYXcZwOENua+akLPAzCsT6pTHiHpKQ8DFqxnY4OMCevfyxVP8SuvOn4zrQx/QJKOyeobN36xObu2vVikjcn+eRXAE7kwnP248FHcq3p0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810501; c=relaxed/simple; bh=eJKXXTmmutvILsJm/2yBesDZIUjxWUBFtkZckYioXbo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IBoUiS9P1qFYRtsGEGXoqSmWoDWAUJ48RXQFEM4DU9uxhzluwjH2y2ZIe8lWDDj2hGgFXaS0FUDMAuPb40Fci6QoYo7smBVk9c2tB6qINZQXsjXDDmuhrCKGMpIgerdqhjOmWxVJV8K+lxUviQj0eOWLqi9MkL9xn7AVijzANLU= 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=P9hebJdp; arc=none smtp.client-ip=216.71.154.45 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="P9hebJdp" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1714810499; x=1746346499; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eJKXXTmmutvILsJm/2yBesDZIUjxWUBFtkZckYioXbo=; b=P9hebJdpmC/WO/PiNdeE9Evrp5kZe70FWUZOWoskHsggc3HDGmw9BjIv CFAAqxwXuJNL00p6WbmozZ2+qSYN5xZMMpl2Zi/2FpKAEORXfGSsLx7/s I7UH0Gp3A8RTSbvoRQLg3KMDwdE3ce3XlcZLqi7+8kS72SQ6l+Yz11p4i 8Sqx6gkF7bN1vYvChmkhXNIl1p/GX39iWNF5ys6+5asPjwBTQjLtnCEcn YAnGvSqsOneWWbIg3WvUrtqQaZvDqzxRFGnG/6fhPJmeK1/EqUDB6RHQj g6LjoydsxcPeUM8es0mTxUkhO2y6wCKSs5sw6BuNCZpOpRjEdYg3Y8Fno g==; X-CSE-ConnectionGUID: 9zTRmP4LSUq3QohK9+a4HQ== X-CSE-MsgGUID: 0gWRgdYQT/iGrhZS1Nz6fA== X-IronPort-AV: E=Sophos;i="6.07,253,1708358400"; d="scan'208";a="15540296" 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; 04 May 2024 16:14:52 +0800 IronPort-SDR: bKeqy23lvB8whJJRsd+SzQgO+WWV7bAQLgvdUH7wfN/lYUp46ABAqgT6T2/v/WVMsMMjPkxWYO xLXHhTgfrhCjhg3vkrDNbX1odtWRH1Wuk38Q9x9vqrN4V2/xrZr9aAutJIfYz0r3UFUqkkXbK1 AXe4jjXTD84U7/RqeFadpNLzyK9bfV8Z4kOuUtGYF1EtsvLfrjesT38PTcmSWi2+Y0JiN0QCE3 8Tn+iGJCorsIv+gn8nBYjy6XaRZpeqOxGjNI9luD6pRTWtxpWbSBwUF+YEBuCYYHRrosYg+Vi9 tfY= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 May 2024 00:22:50 -0700 IronPort-SDR: /9Fo3YiPgAPrZ5iB4p7vAbI0p2npSot9JCaMuZWmmgl2KTZZGMlccEoVn04aMwbc60n6+7Quet BIWMfD6CaRRA8dt1/nC7MPjNLvpwnP2UcNmAVGVub3H9KptzSvl9Iw9Y8dZsj75mbrOmxN8uwu St3S6NFTb27Ff+o2uI2fYubSv5ll/NMaHupVQznklDjspjbQgLxG9YOjyaEI/JWAkLFWGwkM/h qDBrf52etE4ZGLr7PKYPNaNuLf5uVjLj2ZLq/0NdufxYF00QBFjc6F6co4YmtRuvI2aAuuYdqj InQ= WDCIronportException: Internal Received: from unknown (HELO shinhome.flets-east.jp) ([10.225.163.38]) by uls-op-cesaip01.wdc.com with ESMTP; 04 May 2024 01:14:51 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg , Shin'ichiro Kawasaki Subject: [PATCH blktests v4 02/17] check: support test case repeat by different conditions Date: Sat, 4 May 2024 17:14:33 +0900 Message-ID: <20240504081448.1107562-3-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240504081448.1107562-1-shinichiro.kawasaki@wdc.com> References: <20240504081448.1107562-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..9cbba3c 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_conditions". 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_conditions() 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 Sat May 4 08:14:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13653815 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (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 F17EF10A26 for ; Sat, 4 May 2024 08:14:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810501; cv=none; b=H2ZtQlXQ/tMXKGGcTfRXqQUAVABc/NTtA1pI5vaWqivF1GnhgSXgHqWSeMXBxZsll8fkkh0HDHue7yO92J/RHRZVbf1eCCxq12ZELdf9gEv8o604Mh9/ngHgwRfhtGVAJRLCMAT1cf/izUcef7qKb5KPVy+rBFx7u7MQMm+Ok1I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810501; c=relaxed/simple; bh=lG5GYMuyEZNZtr3PgzkOH8KI6EYXvgXm7PdLubwRkjs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UwoBdBAA0z49rdm5lZsIpvr6UmdYNuwHMa8r4cLNXTJm9WNgfr7KzrpcB9KfDMSQpXwUg8M4Eh4nDAQXJKFhItfT37td6Jvr6RMrx0xt5SkshJDqoNF7byo9eA3OwkEjYk0I6DWNsG+7OcmQr7sXjAPduefd9bngc6+QPpK/U+w= 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=i8McxMok; arc=none smtp.client-ip=216.71.154.45 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="i8McxMok" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1714810499; x=1746346499; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lG5GYMuyEZNZtr3PgzkOH8KI6EYXvgXm7PdLubwRkjs=; b=i8McxMok9Cucqbx+otxi9KyPol+Yxk0sIApRIuW0enyRiy1xxBUMiAr5 l+8xhfahbg3l9pBtyEO6LkoKrqWaz3i23FpSR9iBPPtUJT6teCJz/XShD yb5WveEv0OtrVyUEgF29gbQQ5s9ft6rBcnEiYfnWp192xr23+jlmE3ze1 SdVp4u8mCLdq4qlqE4DPIzhSYH35nfINurxMSiJS4olFBTolFC1yvO2Sa mPa5MmldloI9+TKzrRJ59DX2tqx+y35GZ0BqY0dEI6cTQjk4VRqSYl6Ir waELV7ysUNOy3d5px8ChPIkpGy56UK2UnXQbn5sFjig8/qOOH5ELhA3t/ w==; X-CSE-ConnectionGUID: OqgIuhN7ToaQVWzJeMJI2Q== X-CSE-MsgGUID: JPhyIj16Qeu8PnsyV+LM5w== X-IronPort-AV: E=Sophos;i="6.07,253,1708358400"; d="scan'208";a="15540300" 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; 04 May 2024 16:14:53 +0800 IronPort-SDR: kTn4mV+kbZFNDWCZu+ameKggMm+zO0a29LVtMaNcG8a3rB9Ixj2gBnHgBdVUthsNcEB0gQMEcE GeMZniv9Gy+gJI9x3EYGXj2zZqf2xl7GRvTKQCm307nyH3uvVuqcitLlHrDMdoPhjTGztnmiS6 NcaZyrcgOxfqKKGtWnP/8rkpIiY3le7UfXHgzCTNv+15AUNg3SuIjOguPCTWhzd1Wu76o9y5XA 0LOPIgA9rDNDg7ogBAo98PIVK35zffvepI9buXxnxNZHDwwWCEgX7mrwg+oMFXBID1AvmijdgY 0pY= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 May 2024 00:22:51 -0700 IronPort-SDR: TnZsY5mQEhAvgfttTqVAfxDhETXfdWQBYyxSQ/pwzJPRDRWZp5yd3M99pw9qyt3ZFFYcY6Zx2e UVdjXON1gOVQzCueEqhl80cHxAbgtMTh8mVI/UOkIVN/yTKDY79PIGYkgdre69xARSuxWuqTy3 j0vNy2mFqnSS/jPDqxgbkUELqaX+sKTI8K4ZDmxcnz5cS/qRuzrSyLtb2JERVyzkJS70UjvKQn /2M1rlBV6RmmdzdGrYvo16T1Z5gWvhkQad2OAiS5maazgEYLe81vTFtdwrLmiX1txwPpPWfP7m LeI= WDCIronportException: Internal Received: from unknown (HELO shinhome.flets-east.jp) ([10.225.163.38]) by uls-op-cesaip01.wdc.com with ESMTP; 04 May 2024 01:14:53 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg , Shin'ichiro Kawasaki Subject: [PATCH blktests v4 03/17] check: use set_conditions() for the CAN_BE_ZONED test cases Date: Sat, 4 May 2024 17:14:34 +0900 Message-ID: <20240504081448.1107562-4-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240504081448.1107562-1-shinichiro.kawasaki@wdc.com> References: <20240504081448.1107562-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 Sat May 4 08:14:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13653816 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (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 D7A7B11182 for ; Sat, 4 May 2024 08:15:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810502; cv=none; b=uvdY7JmD16TocVgi9/WvcH9Jm+crHJ9L00wQ9X6a9gqjCvLA30EQcXSSGoEG4H09Gn4fAmicWKYFAXOU9C593+aBctn0gqFcSkTmr+0LKP6zb0lRlJkkMHD8qzUUgNIOtPHR16sKdnfcuSzJ40q5rd9K5gglAwrCCKXbgYY3lHk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810502; 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=b//mT3GHYwsydcMeiC5uJQuzoii4kzlTTt52TrSHY75op5GF4gwoeYv8BIxau2kK8vmtbo3iHuHJ9Jn3pUExlZ0LR7NnybGcB9Uh1Xt6CFakf67IGruqcUteDepStvOZkWSZfkG5Wnt7+dtTTk5AtDKxxpAMvyaYwzrBSo2CtkY= 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=i8N4IUCg; arc=none smtp.client-ip=216.71.154.45 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="i8N4IUCg" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1714810500; x=1746346500; 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=i8N4IUCg4LuD9dhl+EatA1JqMdsEjHPkFfAPCxa3SNAlqTdkzmQdxF6r glzaYyZ0ZWpOq4dWo5DrcWF+ldti2bRoctVNEJE94QgJaHJbQfLTJX7Sz aKMxl5p2hVXDd92XhT8VyXQK/G0y6EqtYzXQYKHFxGzd00JR2xudKXtuK vgg9MoGvFwwnjly4SHcbrqRtxDUziiD/76f7FfkcKamCxjS94Sj18OoLm oLuI8Pc7SagF7QLk8HTb1Mz/YQR0wnFtcjYV3XKsuNY3EJs/bFTB+dRvg V4VwNo+eVSCnaw7Z7l4svAOuuhYGFk1mNmg4zcZdyG9eC3uv9diy6G3Kw Q==; X-CSE-ConnectionGUID: bbhQeZbXTJ+Ol9dwIn2+Dg== X-CSE-MsgGUID: JZCDeBHdSTK3wLUPUYYtfw== X-IronPort-AV: E=Sophos;i="6.07,253,1708358400"; d="scan'208";a="15540301" 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; 04 May 2024 16:14:55 +0800 IronPort-SDR: /8pPZjO5rl/bvPNDu2+qv7p2tv9WW9FDnyrYsnL3nnswDW4CRxF47bgB0Rw2Q+rBHaFNp2c2EK pq4OcP0BdPMbng7ipFlLPyiX6r9ndnMj9bv5MQ3FZLmRxtBSz0r7+fJaFOMCLLmwEqN0FQPiEg 8iQq4GKagLAC6exdg8VMkOJFZsR6vdAJE426IcSY5KLurvGGExT6czAnuX7ffncWVdcbOD0C5p oti9KrzRoFWe1vuNavYz48CJlX4BI4VBQ5L64vKe5tFH1g+Qh9zGmpVTDH7tCY7mZHJ81sVz0p haM= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 May 2024 00:22:53 -0700 IronPort-SDR: RMXPPeVNTWfKYFpWcZbwf4Grcr0pwykG/6Buw98+qScc/vTanYcj+uhpgrg0fankKuBP2qa7ao DTfYsOnK7FTVCLXWVP9CNJdI7EAWdu0X91Evr94BkNg4yINe2OonRejotts/tMsZkF57WUl1Id UTORGJWWHMlk5H0aGWtaPDbtEoTYlWZzzbGvRUDrzFFUg731ElOE1+3yQJV9qhcrwRr9tQSAeU CSHScQTRXdq95p3SGH7+L2r0RdXyi7CS27hJIoAAF/QUGEwlGH878pZbOzVmKO/mJASJDvRUGY gnE= WDCIronportException: Internal Received: from unknown (HELO shinhome.flets-east.jp) ([10.225.163.38]) by uls-op-cesaip01.wdc.com with ESMTP; 04 May 2024 01:14:54 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg , Shin'ichiro Kawasaki Subject: [PATCH blktests v4 04/17] meta/{016,017}: add test cases to check repeated test case runs Date: Sat, 4 May 2024 17:14:35 +0900 Message-ID: <20240504081448.1107562-5-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240504081448.1107562-1-shinichiro.kawasaki@wdc.com> References: <20240504081448.1107562-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 Sat May 4 08:14:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13653817 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (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 9BF6610A0A for ; Sat, 4 May 2024 08:15:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810503; cv=none; b=nfntMaGZXGoJS+00HCRUiz3gJK/mp843TRzBe+LT3KGmPRHmK8KHfcXE4EZcEgFBB2jYdyV2cW/q7y/zUEJOUxLYQgAPUCubcnqs54FIIojEHmKUlUXml+JFUkDzQs6Y050cjJ4YepDyKI13M7ghp7DKCtHG/vsLsoAH5/cPFXk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810503; c=relaxed/simple; bh=+K+jDy7e3gF1AgCoCIbrLB/6EUv1Sobcxjxoms8/AuA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cMH9vcvDrQJgRQp1GMUttRmBK0l1Y02n6jjXijAZxEghhaC+fzCmi38nq0Vx0DQg/eiWOCqXKSLIkSDyrpaYwdlxB6meVwA8kY0ntLm/++q70t5Lajt7HcIxbhB+BqwDGLz68S8sVRX0R5HDr1xLhm0160tqLodjmKEbIaWwTHo= 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=UyrZb12v; arc=none smtp.client-ip=216.71.154.45 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="UyrZb12v" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1714810501; x=1746346501; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+K+jDy7e3gF1AgCoCIbrLB/6EUv1Sobcxjxoms8/AuA=; b=UyrZb12v1g1iOEc6sPY8k/QJYGJwWRNvxE1XJX5wAMpVihcUQNvdG6G3 DN7niH6fhW8qvnr3TEZT6Dckz4nMoz0qD+8uQQZJDX++aCZdqJ8+ianWd Y46xlAHTIcF7mWTl5FsDbp/jSfUV3VrorihlsU7raxidQbl5W++Ey5Ake M+OAcVlvsPhhLHqzSobhd2IVfDZioC0HHhG86QYi0vpE9W9mPEPGQoAoG XZAz7s/SQQggu8fCIK1vOdFv7h1tgEd4l+NX4QFUso1lmhw//m7g5m0J+ 9xN/VWTaphXM8DupDIoIAdISUV/WL4JecJl+Gl0H2Hfjld2xTp1hlSnL7 Q==; X-CSE-ConnectionGUID: i9aDZioJSIud8eop/eGogA== X-CSE-MsgGUID: 5ToEw/cMTbqVCzZS91SZUw== X-IronPort-AV: E=Sophos;i="6.07,253,1708358400"; d="scan'208";a="15540305" 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; 04 May 2024 16:14:56 +0800 IronPort-SDR: oIrIXPEcMw71dONEQwYZvLUgg4TNQuLhzXHzlP3Zdu2SQqey3NThJL7ttegMY6q9Wf/TWaTWjZ A+5SCOJ6PmUWQNw9HnJkPLDwGbA6CYrUl8/H1KQuBL+7VnTJTiKSltGIk199vhVWr33z24T91z +Rg04z3wyGeBjSW9myy8/GqI35na8Ck4QkKt4mhNd+8KiBwtxbbfFA7Cnnao2R7MqgxGkpeKn4 UmoHYWkc3e+JpLsi0GlBb00a+EGb923NSI/0/PlHW1v5uwcdTS9WnCuKTG1788J4gZDh9hJKGF Olk= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 May 2024 00:22:54 -0700 IronPort-SDR: kFkhNGbrLKQFZuFDITcNasFNoVHPWDonHevw2gVnSHOpEl4rxwW2c8WZMnAP/cZRsW6ik3SEIG a5E0zCEoxWCmLjRZD/e24ofIWt6ZCkoPxTmJubX3yQuHEm7tRJtVSviGLekURPg6bmOQptUrYv jNC8ghZZdePVBGpdp8pksXjFUm/ozUBNa6OsQs/T/OnAgCVo3Zph9qQZ2l2olDh/EGxy1zIDeq Dny6HOzR/byvJA6j6xjWckXXT3KbNkSZiZcQOHFfpCI/fO7sVzE8vgqXz+f6tnr88n2bPCJgkZ Bmc= WDCIronportException: Internal Received: from unknown (HELO shinhome.flets-east.jp) ([10.225.163.38]) by uls-op-cesaip01.wdc.com with ESMTP; 04 May 2024 01:14:55 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg , Shin'ichiro Kawasaki Subject: [PATCH blktests v4 05/17] common/rc: introduce _set_combined_conditions Date: Sat, 4 May 2024 17:14:36 +0900 Message-ID: <20240504081448.1107562-6-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240504081448.1107562-1-shinichiro.kawasaki@wdc.com> References: <20240504081448.1107562-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 has the "set_conditions" hook, blktests repeats the test case multiple times. This allows repeating the test changing one condition parameter. However, it is often desired to run the test for multiple condition parameters. For example, some test cases in the nvme test group are required to run for different "transport types" as well as different "backend block device types". In this case, it is required to iterate over all combinations of the two condition parameters "transport types" and "backend block device types". To cover such iteration for the multiple condition parameters, introduce the helper function _set_combined_conditions. It takes multiple _set_conditions hooks as its arguments, combines them and works as the set_conditions() hook. When the hook x iterates x1 and x2, and the other hook y iterates y1 and y2, the function iterates (x1, y1), (x2, y1), (x1, y2) and (x2, y2). In other words, it iterates over the Cartesian product of the given condition sets. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Daniel Wagner --- common/rc | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/common/rc b/common/rc index c3680f5..fa61cc6 100644 --- a/common/rc +++ b/common/rc @@ -470,3 +470,48 @@ convert_to_mb() echo "$((res * 1024))" fi } + +# Combine multiple _set_conditions() hooks to iterate all combinations of them. +# When one hook x has conditions x1 and x2, and the other hook y has y1 and y2, +# iterate (x1, y1), (x2, y1), (x1, y2) and (x2, y2). In other words, it iterates +# the Cartesian product of the given condiition sets. +_set_combined_conditions() +{ + local -i index + local -a hooks + local -a nr_conds + local total_nr_conds=1 + local i nr_cond _cond_desc + local -a last_arg + + last_arg=("${@: -1}") + if [[ ${last_arg[*]} =~ ^[0-9]+$ ]]; then + index=$((${last_arg[*]})) + fi + read -r -a hooks <<< "${@/$index}" + + nr_hooks=${#hooks[@]} + + # Check how many conditions each hook has. Multiply them all to get + # the total number of the combined conditions. + for ((i = 0; i < nr_hooks; i++)); do + nr_cond=$(eval "${hooks[i]}") + nr_conds+=("$nr_cond") + total_nr_conds=$((total_nr_conds * nr_cond)) + done + + if [[ -z $index ]]; then + echo $((total_nr_conds)) + return + fi + + # Calculate the index of the each hook and call them. Concatenate the + # COND_DESC of the all hooks return. + for ((i = 0; i < nr_hooks; i++)); do + eval "${hooks[i]}" $((index % nr_conds[i])) + index=$((index / nr_conds[i])) + [[ -n $_cond_desc ]] && _cond_desc="${_cond_desc} " + _cond_desc="${_cond_desc}${COND_DESC}" + done + COND_DESC="$_cond_desc" +} From patchwork Sat May 4 08:14:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13653818 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (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 BC4D311C83 for ; Sat, 4 May 2024 08:15:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810503; cv=none; b=TUxP3lfRgGJPwDRXzl8I2bf/llkFGGfWvxecjP8JhGj26zLiybVI9i4uYBDO8dTZSArVDo/JtBhCG5nWKK6Rj64+hLZZPyixefKmFt2HbugTBLGTp5WUO4WX7tEiKQIKui0g6gm+9+2HXaDXQVX0Qgfrr+8YyHFchI30U7jnGH8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810503; c=relaxed/simple; bh=scNjPLcz5U6Sk7MLBNiJnev4lHFJRKq4VGZH2fiaUaE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WUC/0CWuUUaAwCuuOSX+m3RWJE9oKTZuyeXzuKen3byDeSjf9+wqmR4A7JaYb+ieAlrbsOc0YyPeIpqNxIBoUqDaLmkpmEyaXATYPZycgZb0TL52kQEkkGhpItwj/VwC5/sdRUtWvUg5mpF2KHnvazKZvp5gSHrRey36WQGWZng= 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=aa5xQARN; arc=none smtp.client-ip=216.71.154.45 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="aa5xQARN" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1714810501; x=1746346501; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=scNjPLcz5U6Sk7MLBNiJnev4lHFJRKq4VGZH2fiaUaE=; b=aa5xQARN3okUzst4wtuCiXUj3RdvPNBDr61jSqKF2Ybp4tJq4pW+Arlq E8MHPCFBNjun5MkxlNzID3443DAN9Pyx+RFfATpQTAm5YEOBjyt8oSZFl VhGeofSGf7fmNLE4vxbcWJx73PTV89cQ9/l11j3kYW2Qxo9svA7uGMtl9 liIZSoL9TUW2FwbBqTKmX0ncVH48MEDpBnqm/U0felVwCEIRj1IzBhYsy imXYvTZwYEU0IQpW06rGM+9qjYTgIUOLjI4Di2nbO73zYtbc+FYn/RIyp LcG2/On5oTNNMJh7Xde9vcaZaYiZ9nZkhhAnRPep9dWoUaFUnIaXLX2xy A==; X-CSE-ConnectionGUID: Up2H6C/1Rm2VwNoxtJBCEw== X-CSE-MsgGUID: YLL05JNGTXSApznFWkR1yw== X-IronPort-AV: E=Sophos;i="6.07,253,1708358400"; d="scan'208";a="15540309" 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; 04 May 2024 16:14:57 +0800 IronPort-SDR: TZ35dP5LW1XsDl8ykYF5zjENKFyAzAc/HMajB0rnk6j4ZLtbe5SbXXX/T3XjEo41XRrl5Z9GxJ aRVWtsoguKdCw/XIr6Qop5vsddfOCNY8CnR5SVeFNyZqgzxiDERC8RWWS47QUnptWoYdUe2RS3 c9o32Y7yUBxoHCyqml6mkAGLvvExjFccq7Vpusl8W10cP6P9mhlDMFidaAvacAUyAqJ6bEkqqE B7CrqZst72AN24afzQQcaRIABBdWG0AzHL1i92rscj7n1JoM+rjA78QlQc8zvyQ5zfluMAEm6S 2YQ= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 May 2024 00:22:55 -0700 IronPort-SDR: SzDKZTS73O5IilMQMl5Z5uonEhDgwVnsGdwYRVSSmYGpF6PSLg0zS2t+Z3W1bUlGyFFeDlSGyi ITiww7CqspRfSKPebtDuYtjpjgjL6oAml7ZIpj2uEqa7lxjTY/vy8XfWfTcYRQidVJEIL7Cg2W 8fHptq7jwd4pLX6aQUHA1UveKLEP7cWIBQ8E9ueKhy9J01YnY/RZBSIq7hjZklpkZNEXIw89zZ 2uIx1LlE/tx2ClKSZdco/+0tP4OJatBA2PCmXZT267eYC/QShJpXKoiIY6Ppv+dj0OeI+WtHtS P/U= WDCIronportException: Internal Received: from unknown (HELO shinhome.flets-east.jp) ([10.225.163.38]) by uls-op-cesaip01.wdc.com with ESMTP; 04 May 2024 01:14:56 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg , Shin'ichiro Kawasaki Subject: [PATCH blktests v4 06/17] meta/{018,019}: add test cases to check _set_combined_conditions Date: Sat, 4 May 2024 17:14:37 +0900 Message-ID: <20240504081448.1107562-7-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240504081448.1107562-1-shinichiro.kawasaki@wdc.com> References: <20240504081448.1107562-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 that the helper _set_combined_conditions is working. meta/018 combines two hooks, and meta/019 combines three hooks. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Daniel Wagner --- tests/meta/018 | 43 ++++++++++++++++++++++++++++++++++++ tests/meta/018.out | 2 ++ tests/meta/019 | 55 ++++++++++++++++++++++++++++++++++++++++++++++ tests/meta/019.out | 2 ++ tests/meta/rc | 5 +++++ 5 files changed, 107 insertions(+) create mode 100755 tests/meta/018 create mode 100644 tests/meta/018.out create mode 100755 tests/meta/019 create mode 100644 tests/meta/019.out diff --git a/tests/meta/018 b/tests/meta/018 new file mode 100755 index 0000000..4b62d82 --- /dev/null +++ b/tests/meta/018 @@ -0,0 +1,43 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2024 Western Digital Corporation or its affiliates. +# +# Test _set_combined_conditions() helper + +. tests/meta/rc + +DESCRIPTION="combine two set_conditions() hooks" + +conditions_x() { + local index=$1 + + if [[ -z $index ]]; then + echo 2 + return + fi + + meta_x_index=$index + COND_DESC="x=$index" +} + +conditions_y() { + local index=$1 + + if [[ -z $index ]]; then + echo 2 + return + fi + + meta_y_index=$index + COND_DESC="y=$index" +} + +set_conditions() { + _set_combined_conditions conditions_x conditions_y "$@" +} + +test() { + echo "Running ${TEST_NAME}" + echo "(x,y)=(${meta_x_index},${meta_y_index})" >> "$FULL" + echo "Test complete" +} diff --git a/tests/meta/018.out b/tests/meta/018.out new file mode 100644 index 0000000..e1af26b --- /dev/null +++ b/tests/meta/018.out @@ -0,0 +1,2 @@ +Running meta/018 +Test complete diff --git a/tests/meta/019 b/tests/meta/019 new file mode 100755 index 0000000..2ec1ed9 --- /dev/null +++ b/tests/meta/019 @@ -0,0 +1,55 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2024 Western Digital Corporation or its affiliates. +# +# Test _set_combined_conditions() helper + +. tests/meta/rc + +DESCRIPTION="combine three set_conditions() hooks" + +conditions_x() { + local index=$1 + + if [[ -z $index ]]; then + echo 2 + return + fi + + meta_x_index=$index + COND_DESC="x=$index" +} + +conditions_y() { + local index=$1 + + if [[ -z $index ]]; then + echo 2 + return + fi + + meta_y_index=$index + COND_DESC="y=$index" +} + +conditions_z() { + local index=$1 + + if [[ -z $index ]]; then + echo 2 + return + fi + + meta_z_index=$index + COND_DESC="z=$index" +} + +set_conditions() { + _set_combined_conditions conditions_x conditions_y conditions_z "$@" +} + +test() { + echo "Running ${TEST_NAME}" + echo "(x,y,z)=(${meta_x_index},${meta_y_index},${meta_z_index})" >> "$FULL" + echo "Test complete" +} diff --git a/tests/meta/019.out b/tests/meta/019.out new file mode 100644 index 0000000..d8828ab --- /dev/null +++ b/tests/meta/019.out @@ -0,0 +1,2 @@ +Running meta/019 +Test complete diff --git a/tests/meta/rc b/tests/meta/rc index 3a472be..a2f556e 100644 --- a/tests/meta/rc +++ b/tests/meta/rc @@ -57,3 +57,8 @@ EOF echo "$line" >> /dev/kmsg done < "$TMPDIR/dmesg" } + +# Global variables shared between set_conditions() and test() +export meta_x_index= +export meta_y_index= +export meta_z_index= From patchwork Sat May 4 08:14:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13653819 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (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 8123D10A26 for ; Sat, 4 May 2024 08:15:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810503; cv=none; b=n3/6I3a+ZBwELGIDayPOhMt7C0J1nMIph527ZmOy2BlLVkdBShJIV+SnPopIYuZrUJe2kw5huxGm+Gvn22hTTCnMQwV9tu6MW1OVQGvHVOEdq1vNmQIeYEJzY7qd/73WFQ0Qegl3MXK5IzpZrMlFgnF3ki04mGlm5920A8+hGlc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810503; c=relaxed/simple; bh=G793cZjy30aPyEIQAxowL1pADYTgaWu/BBcCwUB0WJM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kwMu6uH6GsORXYzEkcZjz8b/caukjZsCVAKc0L1PyppFL/J3EwUP7bXpdGsibxwod5PSFQJRLO/dMUVgTmRSOrXWkqjRkYx70Ro6koumVENzPL0vcdbVU3OaM8sbls4hM9GGvOD3eUEM/j4C3Pz5cjj7L83tQxNHGAqKMWVy4ds= 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=e+HxsF0U; arc=none smtp.client-ip=216.71.154.45 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="e+HxsF0U" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1714810502; x=1746346502; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=G793cZjy30aPyEIQAxowL1pADYTgaWu/BBcCwUB0WJM=; b=e+HxsF0UXHzaW/NeXjxjicfA89ETWbfG2Snvte6O6UzYMz8PFjLms7CY qvwRxkIZdJHbQTs/dWuKTmoxotO3yep9Zphy/bDLvhA/MdtWOWCg1VKQX lBmid6V0+EMrBChlE+BxsPr2c2NAi88vLdicBkFsbbcvPBm1xsLK+j/eJ yiW5mjAqEuXhrY8F+Cx9NSeJdCrSo6BnVKZ5iFFkSEpqTmD9E0LNX5ZDv YebdXHVpGKDLn7ZAqNNnNZM4fua1a348iP0jswRXep+zb8PcXgbgW0v4P pWqrjUNM5DsKBtddVV1yobygjDDr0EmeMIyEJvyHr8ZqRqco9sCJ9nvHC g==; X-CSE-ConnectionGUID: Do0WTMLlStOPhOO1/JGnDg== X-CSE-MsgGUID: gVbwaIzIQ6y6Ya0zbklNsQ== X-IronPort-AV: E=Sophos;i="6.07,253,1708358400"; d="scan'208";a="15540312" 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; 04 May 2024 16:14:58 +0800 IronPort-SDR: c9fiiWfgNWJ41pvMQkirPq0nTVbJeFrcd3oax4iov2UJkFcE5ej3+BkLRgE09qf9ViJarX29vZ WUwIA3/GXIwd7U5dMFA3VOD48VwXhCG6MFvSGLnT9n2Ru8WkrFLI2+YrhOF5YfETKFmDuXkZ2W DGdc5Z6KuzCKHfAAVrhFWzxa5AKo47M/OtqKJf8aAGSuPyaVuRg9HRbKpeAfcaW7caRDOOU6uu 7J1XlIv7Dj1SIIfcBy8fWjRPmtcPmpHZCX2Pc01R1ED9xxzjBLe8eolHJrQ4PaZZ8C5w1NdsFw HzE= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 May 2024 00:22:56 -0700 IronPort-SDR: P7GfbLtTu24m7gpnxSapn/L5po3BYbCYSeE/0Q5th/LckOpYOa66mmwL5kmQpgDyiAKhZ6g1+M nxFAOTB5Ei4sWWOYRNuYT4Tf8VfCHgGvdm+cyTypf03jenrARpu7qjLYNn58oZchjeEiO+Ra3+ BvcvUzE1Di8jWCMfGLh40zSwUmwF/0iDWuvKqmeNgXNxk2pOrxv5Ga3O2v2jw+ieNYObcNW3Ff hA8ZFXU8tXVWregtVOPfqafUdbBa8fEJ5m4c9f/17vy7XmGViXC6uQOQqOindnzil9HDdjGo8W BnE= WDCIronportException: Internal Received: from unknown (HELO shinhome.flets-east.jp) ([10.225.163.38]) by uls-op-cesaip01.wdc.com with ESMTP; 04 May 2024 01:14:58 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg , Shin'ichiro Kawasaki Subject: [PATCH blktests v4 07/17] common/rc: introduce _check_conflict_and_set_default() Date: Sat, 4 May 2024 17:14:38 +0900 Message-ID: <20240504081448.1107562-8-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240504081448.1107562-1-shinichiro.kawasaki@wdc.com> References: <20240504081448.1107562-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. Reviewed-by: Daniel Wagner Signed-off-by: Shin'ichiro Kawasaki --- common/rc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/common/rc b/common/rc index fa61cc6..6a9a26c 100644 --- a/common/rc +++ b/common/rc @@ -515,3 +515,30 @@ _set_combined_conditions() done COND_DESC="$_cond_desc" } + +# 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 Sat May 4 08:14:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13653820 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (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 3D7FC134AB for ; Sat, 4 May 2024 08:15:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810504; cv=none; b=EVKDvhX3RY7jP62ZjMc/6wvoVs8YVMaHibcnoW40BrDQO2hs6iCw8keK27RWOcjuTyUmvUu+beAgBBO7L+i9DcYAON/AMrwbxniTOKl4BVI8Wj1FucxLMxHAU2V5bye56KEtZpzt0O9s3dk6ODhDyoEi6cIoNDBEdij3Nu3shCk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810504; c=relaxed/simple; bh=c/S5dT+MmOcmngKIjal3kSxx82g8KSdp+1ofILTNgUo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A2NARubv/UuDRH0pau/0JIOZ8CnZ9e68VtHrzpugEsEyeGGxzRhftm4ItYtBLWr25fkEuIoZ21alKFCJJznoiN2dXbw7osNwTkrKGLSVzlNLHSyOOQyvXDc5BUR3PnzS2vba0B0chyglb8tbxzaHYN+w60Bv/pS7s1hNrF7PaVU= 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=TlBKsZVF; arc=none smtp.client-ip=216.71.154.45 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="TlBKsZVF" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1714810503; x=1746346503; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=c/S5dT+MmOcmngKIjal3kSxx82g8KSdp+1ofILTNgUo=; b=TlBKsZVF2NgzHOX74SxvoFVEETAgBShLoXmwWKtC3coI7wH4t9JqEIyx ck69M43Pgis9vmYdwMvaWOEXirPZ2m0hzvfE/mgyWH3IdV9z/fivi3J/E MImacSQln3w+ZYHyQdYPNVF6YtR8rLfFqmZoSx/pG6kxApS3Wi9mcDaAB 1NuSQ20F0gKlNN6rnZydvYTvnmb6YJyPiqTUQ3aI9o7x0NSbN/PbldZzI +91bbKstG40SVI5InTb2EoHbz1TlUtyy/QbwPlnRh1fttu0Z5CyInHW3e 2ehHvQNxFnQEwaj9P0dzwO5HblFgox3YfcLY5C79zw3Jji3CRu50+i2Eb g==; X-CSE-ConnectionGUID: JXLAk1SBRsuD0oV1JxuPAA== X-CSE-MsgGUID: /4bYcyqiQnKt1k5hr76qGQ== X-IronPort-AV: E=Sophos;i="6.07,253,1708358400"; d="scan'208";a="15540317" 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; 04 May 2024 16:15:00 +0800 IronPort-SDR: L1Oelgo87Jr7TwK/cu1qUKlWP+o59K0G/T+oPtLgAhK8Sppo0v1ZLUvZdNaaatmZKssN/RzzDk NxqWPBN7W/BeNnkFbHY3KlX/eiSokPObiz+CAfCd+W+HAvIkTJ1252Xs1ZfET20c8DWCVEPjCK WnzQbZW/NcaAJWyuNxGt2lCW//fLEjDkfwsGRWDdPyl7lnH/203p/t7AzNght9pNRvUANaYh8a Dt0ohbNsFOHmdqeaTlMR8CCZrQCKkQRUTqKaCV3Td1pE2cJl1yDIsqwvIA6b2bNoqzUadtWmgu QZA= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 May 2024 00:22:58 -0700 IronPort-SDR: uuJPZ7b7RDTfsZyUkbBq8OQ/RXajTUQ6eKuSamn3sOblFhkwB0kgEOs6dgVABsdYMAorLsr/42 IqzbRFHnFlC8SnesGTEhjAwPkDejHiWk0Mft5BiGZ0DbiyoXAVNAc1ZLm9JvghOsDi3RZ82sfZ E5BtFrFP9XQbAAQJ9dGVjZsIuf/Ku8DssoZh/wbYREjpJcr0XV7i5fpyDrzftO9gRwPjPkmJRr 8W6vH4FgsKKpgAPHSPolqEhF9/lhTN6cQaa04UNJwH102zObQrdylhpOl2mprn8sIq3KGaaxKi oew= WDCIronportException: Internal Received: from unknown (HELO shinhome.flets-east.jp) ([10.225.163.38]) by uls-op-cesaip01.wdc.com with ESMTP; 04 May 2024 01:14:59 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg , Shin'ichiro Kawasaki Subject: [PATCH blktests v4 08/17] nvme/rc: introduce NVMET_TRTYPES Date: Sat, 4 May 2024 17:14:39 +0900 Message-ID: <20240504081448.1107562-9-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240504081448.1107562-1-shinichiro.kawasaki@wdc.com> References: <20240504081448.1107562-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. Reviewed-by: Daniel Wagner Signed-off-by: Shin'ichiro Kawasaki --- 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 Sat May 4 08:14:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13653821 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (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 8A8C01429E for ; Sat, 4 May 2024 08:15:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810505; cv=none; b=eggrFnADDe+vceGl9aTm4ftxdnrlUHYVlXEr8iTUMMgrH2epj1cnToMSP2ASsER3KVW7O6k2CPi8GfTGAiRcDomxGEpGTD9AADPN+06ZjBcFe0CFxAPU6VkoFnJINsz8a5l+/aw98sIbToWiDBeN1KgNHir3UINVS8SFZe3k2IU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810505; c=relaxed/simple; bh=nqz9/msx15KbB+BgGwlvy/0PKz1/iD3nOvV9RFRZu68=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fhKEmL0UyJl6wPCi2vWGuvvj4tIxJCSKUmZPmtmmaStKlp7R2qC03THJkR1EN/XukTf4ivcVV6Xamz4yzFdLF7vU+6ofo/42mMlkosQQ+Vv0Z1IGSuqoNa6gOVnmfdRPvSbHdWJNzPY4A/0bvs9D01Ol5lW7VjNVrX6RGD92AS4= 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=oZNE1/LD; arc=none smtp.client-ip=216.71.154.45 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="oZNE1/LD" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1714810503; x=1746346503; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nqz9/msx15KbB+BgGwlvy/0PKz1/iD3nOvV9RFRZu68=; b=oZNE1/LDqk4EmEg3syKtE0LQFqC2Q6ebNxRalNPGpR1ZwlLP7rlJXY4W mYFnib7+nve52jN0kRJSi9VLxtrsEgV0ehtqpwCXY5WGTCvVQCH7rDczG HTOrXRO5Ndq4duG+lek6J5k1OBj38hJgsIND3Xlqu3rOUzRjsHQkZlkIi Qm0XyS57Ex1tc1+iyu7vxiHhXlp2PpJqVuNKK+On3NzJmkeiZY79HektS p/cq1MyUP1/ilaiTARXprjDRnHn2RhqXpt9rSn8eWbMsNHY4DqRvqoU3K C+o8B4Ur/xylJZh4LQM4Iw8O3GgabVu+OCZGB+C8w0gUDwY0o3cS/ZnV1 A==; X-CSE-ConnectionGUID: uPTb+5O7TxSgGzAac7mVQA== X-CSE-MsgGUID: k4KyxGHkTDm8MVFZ97D+cA== X-IronPort-AV: E=Sophos;i="6.07,253,1708358400"; d="scan'208";a="15540320" 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; 04 May 2024 16:15:01 +0800 IronPort-SDR: APEvm6zVk6z/6QP0eHnfdcGh+28GXK0Ubvt2in+upID8Sx1M+KshR+Lvn2FcLDhzF+6WKlXJLH +CjrhR5LHxkRhvbJSme1KB6WuyPZP3hMNEnnDycqR4NjA/h6V7qude2nbLpL1mTZbns5KhE9XX nqfJcMi+TgkFVE3B6GUcAscF+0XO2qQyetzvMZ9g6gJ2q7t0dTmHlcK60wLBT1OrP5k70LvIzt ZfVBVLFSBmH7aKWonvJAj2Zm/TwwWgREXLauqgtYi2arE9FZKHyp9fzplKCGf5BIDR95bOYcxu 1PY= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 May 2024 00:22:59 -0700 IronPort-SDR: e0d9yRP8e6xPux5jz6oc+Osm4Llx8Us6D1K4ZhCX1cEoEpcbVTT8D53OgijBAdVwNDo2nA9O7P Y+e/zlCp7EuS/ArYeJODVKl71N/2/AO7xZvXaf7MgrmIgWYEnhhXxD9jkisBEI1JHLded7mXU3 OBR7uJZNiAz7Y+9w6DrKusYu7+TfgMVcDd2s+Op/56MO03JywwCXrC5MqfAjW1EIyCsj5ftdZm v9pt3nddhB2YptQieLrl/niyjRrm3Fy3VzHJGAnahtOXp6bsTgnE2OD/BCwWeln4sMsg2Sw1ZJ xgk= WDCIronportException: Internal Received: from unknown (HELO shinhome.flets-east.jp) ([10.225.163.38]) by uls-op-cesaip01.wdc.com with ESMTP; 04 May 2024 01:15:00 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg , Shin'ichiro Kawasaki Subject: [PATCH blktests v4 09/17] nvme/rc: add blkdev type environment variable Date: Sat, 4 May 2024 17:14:40 +0900 Message-ID: <20240504081448.1107562-10-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240504081448.1107562-1-shinichiro.kawasaki@wdc.com> References: <20240504081448.1107562-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 Sat May 4 08:14:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13653822 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (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 2177B11C83 for ; Sat, 4 May 2024 08:15:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810505; cv=none; b=QZMINVxFRaQZPlZM8AQLOkD8qpJ6cOIF1Der5hOKt08PPrk2aQOrmkeI/UT5ccdcL7FZ58s3MZWjYFUAKlIa7J08SjzolJy7yPFgNdI6Q2q7yRmMUJtoztX96ryzF8Cz+6NTxqweAQU8VjdtuxOYXhQGfnl6AHHpYL2yQlTlIdk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810505; c=relaxed/simple; bh=MPBXHvjYsktcEJAin3E7drsL+wdn5WXd98VqCO/B/8Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sMidawMhW+tyaheIZ0B20/3jLSVgNZ8stvTzepJRRuykpwgwjzbddJFNN/ZjVDx66Scrpl4duE2znk9W7QH5TXylj3rZsTqdwOUU3Q4Azl1ley6wo+9DL0Lz/Bu2OTNxDsD64rz0+0rhLtNrT9/rIb2RG+CCvnIE98TIjedeaow= 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=MqqiIFq0; arc=none smtp.client-ip=216.71.154.45 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="MqqiIFq0" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1714810503; x=1746346503; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MPBXHvjYsktcEJAin3E7drsL+wdn5WXd98VqCO/B/8Y=; b=MqqiIFq0m9sAD+wMNhAuU7cj3eh6NARZvM0FL9uAaOZhH5NnSZz0mReK u9ivnQwqCsgyJvaHYUORPv8aydwD5F5IUkroYwws5yzAZ9FCsVfQ/JqxG rKq2ULTg3CcwKaj1JE4KbYPzggByJ8NjTGxOsO2x/+chgOlA80eFGHL1k apL6tnHlrDxGc2M9cVtY9AX6+Z0gGUZaB9nFCj+JqN/lTBFFGSDJLsa/H sX4dER0nIEPbEh7Xhd0jfWgvHV4dWexHi9rtYXtUscLdC8hOvBhMH5jd0 XbqHVHCYWe3REAYOl1LJwpuxvd6FITH3hPX/0xUY1U0bYwi4PcPf6VH+9 A==; X-CSE-ConnectionGUID: v4lZ7NwxSdWehKTXjXy97w== X-CSE-MsgGUID: fGPJ6SqmQlm+K/uoRiGXrA== X-IronPort-AV: E=Sophos;i="6.07,253,1708358400"; d="scan'208";a="15540322" 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; 04 May 2024 16:15:02 +0800 IronPort-SDR: TuAOsabyeKnXp2zRIMSaOyOU55lFTVxFcCpZ89LbJHe6RKJYIlcJzR7oNmpV2248pB6BPYxOQf kaDZBbk9jNGN6eo8TLv5GiEz7RvhJGNguCLt0fF1ovncgzz8tTI8EkiwqqtT27yxJsi1rrT1K/ SqXvsMwnKkkUB6SINLPHELf8j3AaFBjThNqsC5kHyvLbLc9Ge+H/3sQfcczWQbVrqstHmldEy7 NXB5DqzyqJSlJ+ihtcqd23lDoHmJu3GUggrpTdGet03jhqTuyNPskWrHAUgFy0b6llULUZEfeO 8Nk= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 May 2024 00:23:00 -0700 IronPort-SDR: Lt8Abm8RaM8kghAclX4IO3o1TbXo/mNXltdINu6ndonA/DnTn2eIzAfTsU5tZ5GYX+HDYqtkBQ n+SxtizaBtl0PoY/t/MjT0WsVigpxVr4IfJDxeaCqnPZRXsSIpNxB1SpWAe+1dEFjMIAhmZi+M UdkAhpy4QkC6pv4inC1/0u6znLqKvbw5U6Dfy4ApRlp3ufLphU+QvjwHEEAroXBjxqemsAY4JL SYWWq6uKA87BNQCXL8Jbn7KVUxmOD1V8CkfcWdF61BFbbZLUTRc9Nox2Nn5iv6dYdRWJDHaZ2D GGg= WDCIronportException: Internal Received: from unknown (HELO shinhome.flets-east.jp) ([10.225.163.38]) by uls-op-cesaip01.wdc.com with ESMTP; 04 May 2024 01:15:01 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg , Shin'ichiro Kawasaki Subject: [PATCH blktests v4 10/17] nvme/rc: introduce NVMET_BLKDEV_TYPES Date: Sat, 4 May 2024 17:14:41 +0900 Message-ID: <20240504081448.1107562-11-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240504081448.1107562-1-shinichiro.kawasaki@wdc.com> References: <20240504081448.1107562-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_nvmet_blkdev_type(). It sets up nvmet_blkdev_type variable for each test case run from NVMET_BLKDEV_TYPES. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Daniel Wagner --- Documentation/running-tests.md | 5 +++++ tests/nvme/rc | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) 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..27d35e9 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 @@ -51,7 +52,22 @@ _set_nvme_trtype() { fi nvme_trtype=${types[index]} - COND_DESC="nvmet tr=${nvme_trtype}" + COND_DESC="tr=${nvme_trtype}" +} + +_set_nvmet_blkdev_type() { + local index=$1 + local -a types + + read -r -a types <<< "$NVMET_BLKDEV_TYPES" + + if [[ -z $index ]]; then + echo ${#types[@]} + return + fi + + nvmet_blkdev_type=${types[index]} + COND_DESC="bd=${nvmet_blkdev_type}" } # TMPDIR can not be referred out of test() or test_device() context. Instead of From patchwork Sat May 4 08:14: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: 13653824 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (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 1044A171CC for ; Sat, 4 May 2024 08:15:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810506; cv=none; b=jbKq1EBzNfPwR6qpPNdVlHfV6KFvB0RMYyOUrxtvPauu0FaVmQyv1VtBxSSaW3wfOH0eflY3pwZ9nO3vIX+KZ94qXAqQ2JTYEQdk9CDMuDrV+UX2QqYFguEpGGYpamN7GSlh7aI9VQ5gYDoHFCIsoDKlX6+eZJYS1AOq55k9Egg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810506; c=relaxed/simple; bh=sLUU92HlqI7uQ9oXxDhbvXA5yCtDZlU1fVCBorHb+ik=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r3UUJPfJd62QF33BSAy/uTnouL0dwviWtX/IEpBKm5OwqvbglI1BY1/a/4zcGv3UEsEcOEuk4UJSxg+3MgDEd+nVbXdbC4Ez2/0NELoHRz/wwqax3yYJTACvr8pzU25//77wEzfWUsge+UGsl49VCt3WJpOnh1nBuld7g3QGIW0= 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=lgTbMuQO; arc=none smtp.client-ip=216.71.154.45 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="lgTbMuQO" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1714810504; x=1746346504; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sLUU92HlqI7uQ9oXxDhbvXA5yCtDZlU1fVCBorHb+ik=; b=lgTbMuQOKE0T3/9Cd8kB+n8aaaHqzbYR4l6HmaoDubjrFNJiDd8vY/YZ jOVV/H2Z4v9EG6fJfgBiCNZYPYCx4glC7qkOMhrTWAen37XNNt4m7FQdZ eipzAdUVH9uHldzHZURwhZKcHPsdbOeKCpXBpxfTA4W7a7pV431GijaqW 6qCOd7XRE4YZdxknqY5+ggX0SZP65UKHgNOuWUqETnE4RZuWBtEK3I0n+ GKE0+sdTTjcLZVjPg0k6K2KOEOvqyGTIEADo9S1yCOCa+W8VslM0TVCti aSoeLgVLDsYEWs3CIbmvKc7244+1IObRbOXv8hZpm3DfqrbtiE454FOhb A==; X-CSE-ConnectionGUID: h+JGqVOhQb+V7bbNMWtz2g== X-CSE-MsgGUID: ZGY8XXOcS2OmVak/Ec6o0Q== X-IronPort-AV: E=Sophos;i="6.07,253,1708358400"; d="scan'208";a="15540326" 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; 04 May 2024 16:15:03 +0800 IronPort-SDR: HcEBP54ZA2FyRcAoHxKkkmifusZpIS7wDcxFnGrD2Li9/NV4qgL8OL7krk0Xtp70thPIY2NdTO txGvtfi5BfUUssAvz873dvORw+wjU9p/hAWD0wlPtAkAksiY9z122TvxyL8CqrybMPdUBgQlF9 vyFVPxwD4cFZMGMzbYyS4ix3YNEa23ek/vP+8Fm4Zjx+0dv45dcO90ciFDwQEgxVS8LlMTIJyV ES3YPfeZFrK5+3DbbR2Lc6OG/B2cdk8e6pOg6vPQ1yX+piFNBd1sSezsJKKawBUnFJ/vk7vcSe 6ss= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 May 2024 00:23:01 -0700 IronPort-SDR: 9sW6vw7z19eWa6DlnzZJqTeSMOfGkP4W/b5GKw4MhDVcdXUjdomeC2o1Fcjs3cVGac7RPWGy8n cxbZKOXFoW9p5E+7qvndkDLZ3fCkeczVfceHusoTGuE8eg08/hrWC/pieVJuCnWIjDVieS7iI7 0GhK/6irt8mD6Ogb22sCGAeZlGDHlAB5XWkLSacM7LNWp60EWG2//7tkuwk1aseWSuAg4AlIIK Std6EXE5KewQXArRigyvfQQY77pq0m6AEsOaGG6YZW2LNGaUBtSd1D8bvziFgIJP3S8m+9Vkga YNI= WDCIronportException: Internal Received: from unknown (HELO shinhome.flets-east.jp) ([10.225.163.38]) by uls-op-cesaip01.wdc.com with ESMTP; 04 May 2024 01:15:02 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg , Shin'ichiro Kawasaki Subject: [PATCH blktests v4 11/17] nvme/{002-031,033-038,040-045,047,048}: support NMVET_TRTYPES Date: Sat, 4 May 2024 17:14:42 +0900 Message-ID: <20240504081448.1107562-12-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240504081448.1107562-1-shinichiro.kawasaki@wdc.com> References: <20240504081448.1107562-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 Sat May 4 08:14: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: 13653823 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (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 479C31755C for ; Sat, 4 May 2024 08:15:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810506; cv=none; b=BAmGg6QxYifAqW6kRV66ivm9TkEv6q2pWz9B/+WwcHlcbKIpCmNGljtVUGXluNUpI/3qgcTyb47g3ISbTg8FkfLVf0Ks0efIOV5ewoHDJahbSnr0fwtU6ETmgJll+w0agcBlvxRKNK4X9+EE5uUcNfJKPpV78FU+PGDEDD2QFvo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810506; c=relaxed/simple; bh=BFfaOX5p2iOl7nNSAnVbtqrbQDtOYPAQ2VME6QGOMfk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SuzL7E5kelO1eFSwUzl/oEYWsK5UF5b5UBmAt5oC7JGiQYru1q5PbPzV6tkFaub/mQII8vKXdgDvDv/P2gGsy0Siy8ZINvhWnVyNqcd1DrknJtm3Omi3SDwFHW//75iEgo2OPOcTdxu2mVQIbgOw5oLR5RHszsjURWAzZAdpI0Y= 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=Pk74viun; arc=none smtp.client-ip=216.71.154.45 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="Pk74viun" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1714810505; x=1746346505; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BFfaOX5p2iOl7nNSAnVbtqrbQDtOYPAQ2VME6QGOMfk=; b=Pk74viunu7SQtE2ypOmyfSpmorZ2Udz/fr+tcvsFs8wjmFPqZby41Vcn SmQUdxT3URqSLQ7pntDPZS+uq3L7uV1AeQeHAmfvO8RCAvKT4deNDd/VI s3WTjJ6WaCo52Gdu9LuJWX7/FNvWCif/e0c3mpa/Zi9fk2nlvodnR6emR 2/U1TNBXvXaZQQDHdi2nBoegg77PO6q5qSU7wThGNtq6AjzWcwv2OYStN FHnRNRJNv3ehijLFD3qFd64uEk9dwKyMzSXaFAZakIhmQcEb+NFCCdfI3 VOkyMVt81rYrEp1VpfWwk8iBx4FIoU+U9fUB7sLchgX2P3OkAfuruDSDN g==; X-CSE-ConnectionGUID: Ze1Xh9mHRoOcghztZWQHsA== X-CSE-MsgGUID: 50CyiIq1R9iutc/ry4DzKw== X-IronPort-AV: E=Sophos;i="6.07,253,1708358400"; d="scan'208";a="15540331" 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; 04 May 2024 16:15:04 +0800 IronPort-SDR: gtuCrCm/i6fj7KT2c11oYtZYJcm4rso6TxTuasIEpnHU54gHWNEmPF7naNtV8broWpvTlJXAtG lOMkQscR2iHxCcvq2hCFAVqUzLPetE3+snJ3KlaH/sU/fAzfwoJYc4J0tzjsTkIy3mBVLq03KY npWp9SwKEqyDnDL78TnP4w26CDhYL0ZfyH2D2XuCjSeifWvfy2/GlKqzVdilciuMNl7nWNPqqU ySb7iiVH6wAHHeBa+/7vJBFxWP3UrMai6/cS/wfWcrhVXw6Miv8PSXJX/5kC9BsBjJdQNosHwp K8M= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 May 2024 00:23:02 -0700 IronPort-SDR: SystkBEVl0eprf0RMbP5jdCF2A0SuSsHlQSZlZUlGyfT7qUPEwXMOxzF9ZZr2a6u+hB6k4YHt6 BBvdtXp+84Wuzi4dg7IQ6QR8QiRqk/s3OjU5VIfbfozbMRFd3LlX1Qc9q1BQtVmJwwOMUXTZlD +Lv4ePv2Mj8Oc+NCH+T6xhtmnU5mhExcZMmLqTu7ARzKzPSXE8fwSmPetQQHUCaL6raV17XFBY NcZSK31Id8Wqo7KfOXXDJ+KuQcBQc3oowNBNKCREM8iXlQ872EXmSNJ7H4E1dAPRmpS9P+RqCE B+w= WDCIronportException: Internal Received: from unknown (HELO shinhome.flets-east.jp) ([10.225.163.38]) by uls-op-cesaip01.wdc.com with ESMTP; 04 May 2024 01:15:04 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg , Shin'ichiro Kawasaki Subject: [PATCH blktests v4 12/17] nvme/{006,008,010,012,014,019,023}: support NVMET_BLKDEV_TYPES Date: Sat, 4 May 2024 17:14:43 +0900 Message-ID: <20240504081448.1107562-13-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240504081448.1107562-1-shinichiro.kawasaki@wdc.com> References: <20240504081448.1107562-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. 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. The test cases already support the repetition for NVMET_TRTYPES. Modify the set_conditions() hooks to call both NVMET_BLKDEV_TYPES and NVMET_TRTYPES using _set_combined_conditions(). When NVMET_BLKDEV_TYPES and NVMET_TRTYPES are set as follows, the test cases are repeated 2 x 3 = 6 times each. NVMET_BLKDEV_TYPES="device file" NVMET_TRTYPES="loop rdma tcp" Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Daniel Wagner --- 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..3f9d209 100755 --- a/tests/nvme/006 +++ b/tests/nvme/006 @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_combined_conditions _set_nvme_trtype _set_nvmet_blkdev_type "$@" } test() { diff --git a/tests/nvme/008 b/tests/nvme/008 index 1877d8a..247850c 100755 --- a/tests/nvme/008 +++ b/tests/nvme/008 @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_combined_conditions _set_nvme_trtype _set_nvmet_blkdev_type "$@" } test() { diff --git a/tests/nvme/010 b/tests/nvme/010 index 34914a7..c16587f 100755 --- a/tests/nvme/010 +++ b/tests/nvme/010 @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_combined_conditions _set_nvme_trtype _set_nvmet_blkdev_type "$@" } test() { diff --git a/tests/nvme/012 b/tests/nvme/012 index e06bf8d..e6674e2 100755 --- a/tests/nvme/012 +++ b/tests/nvme/012 @@ -20,7 +20,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_combined_conditions _set_nvme_trtype _set_nvmet_blkdev_type "$@" } test() { diff --git a/tests/nvme/014 b/tests/nvme/014 index ff0ebfb..571c6f4 100755 --- a/tests/nvme/014 +++ b/tests/nvme/014 @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_combined_conditions _set_nvme_trtype _set_nvmet_blkdev_type "$@" } test() { diff --git a/tests/nvme/019 b/tests/nvme/019 index 31020d9..501256c 100755 --- a/tests/nvme/019 +++ b/tests/nvme/019 @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_combined_conditions _set_nvme_trtype _set_nvmet_blkdev_type "$@" } test() { diff --git a/tests/nvme/023 b/tests/nvme/023 index da99406..3c43c55 100755 --- a/tests/nvme/023 +++ b/tests/nvme/023 @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_combined_conditions _set_nvme_trtype _set_nvmet_blkdev_type "$@" } test() { From patchwork Sat May 4 08:14: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: 13653825 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (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 5C8D717BD2 for ; Sat, 4 May 2024 08:15:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810509; cv=none; b=kuc1m2+qqhllB7tDoP5NP2cKt2FW/uGXAfU/wjyuQ+OHw0ZqpRU33lgPd/HODhL8R4ZeEC8F+DAd+zEKSj8wWREDATpWnIAinn9q7jiN6Okb2dWm3WD+5wUTDvPC0hKfThdYJaFwTA0WMp8HTnu5UFjrsNYj/wwBgLxAPaYNjJk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810509; c=relaxed/simple; bh=XYvDNN1Sux58Wm3P/1FIy8hcWCk38ZaWmhT5eJfDlFE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CK7HYSaw7XquOSuxk/UUbAVuIo1EcglJ8HQRm3nCYnfO+oAWxrzhgM8FsnqXxm3wwoqcbNYHoZVGit0dOx1QgnG77Q2+EXqYuhjUN9ehkrnMITXG4iTD39UZ1vup2iHIwipVntD/AmPS6UbVwozEiW0ffYzlpSn4QkteaaQ4X88= 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=mYT2m5Xl; arc=none smtp.client-ip=216.71.154.45 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="mYT2m5Xl" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1714810507; x=1746346507; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XYvDNN1Sux58Wm3P/1FIy8hcWCk38ZaWmhT5eJfDlFE=; b=mYT2m5Xl2QuakQ2zA9wZXDS9MlqffkefhJ35cGh4ptlX2rDWSyAGR5SV T5wPEibjS9PV8bFtb/zvwZ3aoMCQ3DXxgLfo49czNgvoLpohvM4PaEnaa lx9FeCWkZ53AyQFeBZS1HGis/OQm9FFrx2nhFy9t7SqKZtH4OUvCLHZSO K8oWuV1veVmzQ4uJVDWFptzsLg+cQyZXn+3HYBn9R5/jQ+6fmo0+ieZCr MmzsX8rIlUmpvt+C/7+mCh6WdxzXfV0FwFCGI5ULDf9vik/YOCNKo/QQI Aklty0CkYM1vdOYkiTZxvFQ2KIqDfy4BHLOrXk3DjB+Nx4cJjTyygKvZr Q==; X-CSE-ConnectionGUID: ljg5VibbRwqKRmQvHJvS7Q== X-CSE-MsgGUID: 8w9sCv88Tgmp6P4l+q1SFQ== X-IronPort-AV: E=Sophos;i="6.07,253,1708358400"; d="scan'208";a="15540336" 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; 04 May 2024 16:15:06 +0800 IronPort-SDR: Kuth18AwXRizdpcl+M9MtF8KxYZo4y3kFafARENaUSzSboRzc5jbVTmCKoRn/1p/EqTCp9fE7k +lTt78TfVOeZfuKfSjWZQUzgoiXTMzxhEBrB43zipQxKwNDugLxCT7X2gU2V9ei86fr7h+GNqb 4zBvwO+DDzPrt+c+17fbId4KkZ84ej1dV1tzX36pBTKkSbV4uvq84H06CjIGWjCo3HQdyKonQM XKwT6TMXlDGtUVEp2bh3jjYzv/rqHZ1ViOUG1WWQxjX8O/faZwPSR4H7EZ1+FEupf8dBBrWqOQ C+E= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 May 2024 00:23:04 -0700 IronPort-SDR: sami3499jSAOGC3HyzwU+OB6oEsrO5ZzT/w1xgXYGkUS6IcLFv4gisqMFizlBHcNiluN3twwdU /QhJxndRAZgnDC+btgIPpZ5sqBjLTn4iAqlYMDrBP6ZwdqOsn4awipXzyH5o+8sfAeuVWIWJu7 mdX1NaIihQ2qxnNdA8dm7YaRijdsfvuJqMHyudKxsTDfAeuP4iROVhGLt6U11aZ8GsitYBYGMd t8PgKPZv0Q/akxdETYL1U49ZulB5FwgEwCmbZAbgG95YlFFce/IxvDSM337eW2MId/A9Jsz8of sXA= WDCIronportException: Internal Received: from unknown (HELO shinhome.flets-east.jp) ([10.225.163.38]) by uls-op-cesaip01.wdc.com with ESMTP; 04 May 2024 01:15:05 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg , Shin'ichiro Kawasaki Subject: [PATCH blktests v4 13/17] nvme/{007,009,011,013,015,020,024}: drop duplicate nvmet blkdev type tests Date: Sat, 4 May 2024 17:14:44 +0900 Message-ID: <20240504081448.1107562-14-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240504081448.1107562-1-shinichiro.kawasaki@wdc.com> References: <20240504081448.1107562-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 3f9d209..2b5b2e6 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 247850c..702c576 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 c16587f..524203d 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 e6674e2..f9bbdca 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 571c6f4..48d7408 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 501256c..9eff03d 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 3c43c55..a232246 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 Sat May 4 08:14: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: 13653826 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (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 84609F513 for ; Sat, 4 May 2024 08:15:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810510; cv=none; b=NLQ2lJ+ASy0Nf//JbbDf1f7fmbEYHBuJoXZxARTYDds7VwqtcFmH/Guze/QZUu6Esk+9prgBrItG8t2FkFB6l2SqupplY2bP3+Cs1ziqRuJMV/fC6k9ZK5HNMfLrk5SjIgE/w5OPJMRUXB3y8xBAm8ZtNG66AbdOiakgFVHRASg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810510; c=relaxed/simple; bh=uXIK6imN9fYvo8/acUzILbanjCM3PXn0aD3YzOkwU5Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AdYaGt2pNdrAELa4YBRxNP9plIoqjkXD8GQsvFSs4J2ywtGB04vNVdYZA0q+ZWYynVsVKtMeQZG8YSKoazZr6BdnC6IihKti2XWHFwY5qHr/W1Z49sAdNH/iRcpNqgcf1rH/LUmvAiVciYXTSMxSNxqAHE2WZRmK+es6YJZZbf8= 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=V/bDBZqw; arc=none smtp.client-ip=216.71.154.45 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="V/bDBZqw" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1714810508; x=1746346508; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uXIK6imN9fYvo8/acUzILbanjCM3PXn0aD3YzOkwU5Q=; b=V/bDBZqwjFsOxsFIiurgEp2NrvPQx8vlN+Vl8ZmduuLDjMchOaRzxByt Ctn1btrN78/KBpUE9EZgwjPwGIQLqH0bck/ZVZr9k0HkKvAzQwcQClpaV RxrFIWxH0Z5tKC6sbJIPxeJE9opPfPzoKAGmEWsOlrzz6mNYm7F/sSmwo 9AuBzOzZyffvC7wIhx72LmXZG5/SIT4Wiev8xS3r30OBmCNFKAn4niSut AjkfnKva1jS5dIZJasEboy6Mhr5rmqP3kDg3vfUBMbuNK62QBuuiRB4H5 FFfGbC+85w4veBOQorbw7RYXRcmmQ8PQ3xcNi6J9rXiKhZO/J2eQDMxPk Q==; X-CSE-ConnectionGUID: gnMBVSSASV+dhq1/y37Qng== X-CSE-MsgGUID: wWt6GKMESEaGho8bPtpqdQ== X-IronPort-AV: E=Sophos;i="6.07,253,1708358400"; d="scan'208";a="15540340" 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; 04 May 2024 16:15:07 +0800 IronPort-SDR: Tmkuh435yhPHvXizQE7v584hVOy6rQIE586VriQZVLDHiMHe+MC2ttgbv5aeN4HRCZJprsgLEd cH4LKWtGGG+WpdvEhow56YcL8q2QPV1q5WrXieExX+z7xcErOqN5CFqdu5L3jK7D3pKl/xw297 bPAH+QvRzdReVpyDpZbql01VbkgoyAR7xWTefQzkui7N6V14fCqFTTuCsAxjOoG0U2l8JGtlNv YUGoMDP11SWhG5lkVuajCZjGLoXHQ/IzgaDNWmvP1bjpxvky28eQ+15qnqAqrtemldcrTZ6Vcj FNE= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 May 2024 00:23:05 -0700 IronPort-SDR: 8qgFDOK6lyoEOeYv/lnaBhVIU7h7x/kfpdZGHdOOL49y8UlZGoZbgpOHN24t3QpPps9I/aXbvO R+5lMeGd+N5TCrrQdiywHOSvTFGhkMvtHVaeMQdgY4/cKT+O8tX9sGbgmDWk+AhIwFZe8GhKJc tlBqKsWOxpxn81tw6UFMrkL7c3xEI84jN2VXjHqTT2TDUeV42OURmR/Mv5TKzLZI58EZZSkrJb PyI4AOiSuczfmnFkVTMgVwISoJeX71dSJkRK7DbiMsKPJeiLR7gKGxyxa9yMLfhiXOYbqQNctK LNk= WDCIronportException: Internal Received: from unknown (HELO shinhome.flets-east.jp) ([10.225.163.38]) by uls-op-cesaip01.wdc.com with ESMTP; 04 May 2024 01:15:06 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg , Shin'ichiro Kawasaki Subject: [PATCH blktests v4 14/17] nvme/{021,022,025,026,027,028}: do not hard code target blkdev type Date: Sat, 4 May 2024 17:14:45 +0900 Message-ID: <20240504081448.1107562-15-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240504081448.1107562-1-shinichiro.kawasaki@wdc.com> References: <20240504081448.1107562-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 cover combinations of NVMET_TRTYPES and NVMET_BLKDEV_TYPES. Signed-off-by: Daniel Wagner [Shin'ichiro: modified set_conditions()] Signed-off-by: Shin'ichiro Kawasaki --- tests/nvme/021 | 8 ++++---- tests/nvme/022 | 8 ++++---- tests/nvme/025 | 8 ++++---- tests/nvme/026 | 8 ++++---- tests/nvme/027 | 8 ++++---- tests/nvme/028 | 8 ++++---- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/tests/nvme/021 b/tests/nvme/021 index 270d90e..43d85e6 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_combined_conditions _set_nvme_trtype _set_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..6b3a8fb 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_combined_conditions _set_nvme_trtype _set_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..529fd0b 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_combined_conditions _set_nvme_trtype _set_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..6dfb9e5 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_combined_conditions _set_nvme_trtype _set_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..06fccab 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_combined_conditions _set_nvme_trtype _set_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..c35d0ac 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_combined_conditions _set_nvme_trtype _set_nvmet_blkdev_type "$@" } test() { @@ -24,7 +24,7 @@ test() { _setup_nvmet - _nvmet_target_setup --blkdev file + _nvmet_target_setup _nvme_connect_subsys From patchwork Sat May 4 08:14: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: 13653827 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (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 5FA5E111AD for ; Sat, 4 May 2024 08:15:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810510; cv=none; b=l8nLURNGPwd99UEHZuz9WbaazE/16vNuX/fDmOc/6DDgcAMGCGOtpe76N9y7e2rL6YAm6n1FnUvKkEqtr6rS+8Qyc1br1Zmn8phkdyQww81CwIIt3JfDDwmsu0AhEiQv2ZeupN8WO6Lo7VR8KfGj2tpEijFO3zdI7s+G1xQKYu4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810510; c=relaxed/simple; bh=EBxB2u8I9uSgVGqcMH+SW7wn7JCDKLBEg8W9tT3Kgug=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S6rAvywhxOFkY5BxRibKyCF8LQBDlIpN69fTZlJc0quQR6ao3YOZ1jkKJIy9OI7mUpAqUAZaxOO23JvrYYZM3ED+evrxBU0bYKRC1FBk6BzKKUGETHnshR36F/v07cPf+MjuK2e5DFE9GI6iniRpZddG8tPfr5GNmKmets98BUU= 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=S/m6xBZQ; arc=none smtp.client-ip=216.71.154.45 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="S/m6xBZQ" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1714810509; x=1746346509; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EBxB2u8I9uSgVGqcMH+SW7wn7JCDKLBEg8W9tT3Kgug=; b=S/m6xBZQVbz9DHOOhgl9yUIMUaShje1+9/wZWrUzWUh8Wt5F4Fnd86LR BXhIo0UYeQoq5x7U4TzgAAIRyZxubSTmnARyZB3hERWBMANB02eY89/ev PV3iqk668Uojs1cgxWH0oRzJnO1Ci2MXq8KD6jJ6aU+IqyZYmX+dgCL3S o5J4mAoVSDIvH/0JrTWiQyf93Xk5aXWNN/OjI0aSmkDkGgdBOP0zujiD8 hdIndX3DG7j38ieYmIcphpxUbGoHTikFD1PWwAlsFeccJHZVzctNPxoGy vpB/qGbX0l+rXMoFwkm2xP7j/nSOH/xbUW+akmT+5xMVoCO7wh0VilM2b w==; X-CSE-ConnectionGUID: 4SBaEhbzSvyDHAICHZwKpQ== X-CSE-MsgGUID: Mg9OHEYwS2eH2k8zh+bfuA== X-IronPort-AV: E=Sophos;i="6.07,253,1708358400"; d="scan'208";a="15540346" 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; 04 May 2024 16:15:08 +0800 IronPort-SDR: F2OJA0AayXzSJN+EcMbKTNLoefdrwe9YWCzqBLZd5wjYMc9H8izhu50EVdwXyFD5mA6P3gI6C7 ImI+ZXH7UsQMzS0uQiMuClVWB4GTFEpXlKCZixwyIVNKeImB2jgtkKOYhDm8ZGkfIMA5iORUNo U+E0UWtSckGw+qfqASe+lUeHTcdRhFCCB4T2UdeYIo5E3a4dCIfKqCUgp3tFzBXJGeLhiPUeIX UYVdGjxM4nfffKihWsW2laIlZdW8DQ3zA/rNXWRssA9KLR9FJjNngYsqrYGHLQ3hfy6gnyiO5Z WGc= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 May 2024 00:23:06 -0700 IronPort-SDR: ec7prmIlsYq5kcBekGgHVjgX3G/c/dEQ6xla3xleylc3RoKVfsmWDvEmc5tAZIbhV5/BoznX1z MExqYkSQxWioOiwXMGbdJiW5LGDthWF5EIc4Q9rfoGK+yaiJ50axtR3oodrueCsxqZDzLeeSvn pyTA4R8PacM/ncvSgfqOpL+bGMhgxFsE1CWyk1A3u1bGKJarvgL7IZkZ3Ekry9vJ5q+C7Vazc1 JTZarzQmuXfKdic9ANImy1mttMot55OFCt3xR9OAFFmz/eadRJzwlkBOuIYbWyW/JEu4h8w0p9 /u4= WDCIronportException: Internal Received: from unknown (HELO shinhome.flets-east.jp) ([10.225.163.38]) by uls-op-cesaip01.wdc.com with ESMTP; 04 May 2024 01:15:07 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg , Shin'ichiro Kawasaki Subject: [PATCH blktests v4 15/17] nvme/{rc,010,017,031,034,035}: rename nvme_img_size to NVME_IMG_SIZE Date: Sat, 4 May 2024 17:14:46 +0900 Message-ID: <20240504081448.1107562-16-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240504081448.1107562-1-shinichiro.kawasaki@wdc.com> References: <20240504081448.1107562-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. Reviewed-by: Daniel Wagner Signed-off-by: Shin'ichiro Kawasaki --- 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 524203d..a5ddf58 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 27d35e9..ef7b966 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"} @@ -159,10 +159,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 @@ -909,7 +909,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 Sat May 4 08:14: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: 13653828 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (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 273E01755C for ; Sat, 4 May 2024 08:15:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810511; cv=none; b=SjXBReVMYaCM5jbdUm+BN2O1NdTK2FyvqYmZYXpBasyN5EsDjgMxgjUcVKDLAqMjB7a7wZGrE6Ew6U7ZAAkmI2HPAv+yNkhhRiueJ9FwRjRa6Y3VE5XfsAfbiE7jaQXIU6udZt/WPmQNiHwT4bhaAJ+nBXeAqYBz1yLOdcDRNgo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810511; c=relaxed/simple; bh=P5q9gL3DmOdRu3GNWoTEQhagzOV4QzL8Rtx94737wF0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W7UW1AIJbxPGH4GvTHi9yjYEgdwgDWi+EU5NVy5nJS+8gNh40RA1xW98IWcYmkIU/uhc67YfRPr6vRU4hzoMoREUUTDuwVSIa2XXdmC2O9rD/uDGKF2ATW2FwyCqaAf0ORk1cy2ZtTE4f9OtPkkKBF4iQkSoSeYw6/xtABxfuUY= 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=fZftGRPz; arc=none smtp.client-ip=216.71.154.45 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="fZftGRPz" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1714810509; x=1746346509; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=P5q9gL3DmOdRu3GNWoTEQhagzOV4QzL8Rtx94737wF0=; b=fZftGRPzU5roLuKA/dIIEKcqTE8LRQakN3TpYPNw+l6lXUbP8W7aujKv 8/uErO96/4IBWmLshtvwqA1vAm71LPKjvoU5Jpy0ouEUxZd/vCOLecjVO A1o6meoVuMcEXK1XpMAk50ujdv4ctc0HyL3jwqi30NekG0tIzTytahS4+ X8Ag5uNw3AU9QKAkJ+gfZ1Kb58okN3ZHfhINCbGaJyqBycuwZiWUpk4i7 2rHNZlCXA/x1h0J1kzw4AhjRfWsl9CPA2e8pOmJkq2TkoTwtNfnXHsAFX jmafBN8F8WeQ4SNW+hkWeTPAyCOXBv5E7bAWAPB8G9hT6ozC9dtgDdSl4 A==; X-CSE-ConnectionGUID: 60egoB/DRfy36qjNMVjUdw== X-CSE-MsgGUID: w04omRyaTduPb97jvwULQg== X-IronPort-AV: E=Sophos;i="6.07,253,1708358400"; d="scan'208";a="15540348" 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; 04 May 2024 16:15:09 +0800 IronPort-SDR: JFqTnlfifxP//rgUIaYo66Iiuu97Cp3psZ//LWM6aVmN/+P3uPoVxS17XlI+HmjGyLTC/pSCBc ZNtj5v2C5nJlfGyq/FP2x3j/KuuYE+fW472EnalEZjYiMUBMQ62+uri8nODlMCIgLmFJ4sYdgq oIvtZOtB8ZV23+NXZt5Ky5P15jmx1LeCqehl27baccaoGP5emVw1wmxZbOZc5kX8YOFwEluWij olBdGuW3/kcIqOWhDuVm9+TXGOnOlO0kGe061ES+gqD2FAGLcjj7eomZ9pyle5wOFioxi035hk Ih4= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 May 2024 00:23:07 -0700 IronPort-SDR: K+FpRuSxzQ8RzKwVSAclukCTJYrI0z4fPzXf4jwEtUhChsaPqMqqN8h7Sinkg6eHUfNX8qnYLc OtlIH7g9gXMd7G2798ifjf6PhCMpqzkzAZAkJLPJSjixuRN1+sszHmCcqOadMm0Seij2n60qZr zrTFpRFGcEwmNy080yGkrffv6v7ZSNb4RFoAjdr1gscxvvgewSg1QofUo3je/i2brsoq6QPNL+ Vxz+MSSHabNXRRFFFvktVUGYTWEoGnT9CmRsMeYy8JGUjHJTIM3Aox87QxX0OqFwl9i7eqU5EU dqk= WDCIronportException: Internal Received: from unknown (HELO shinhome.flets-east.jp) ([10.225.163.38]) by uls-op-cesaip01.wdc.com with ESMTP; 04 May 2024 01:15:09 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg , Shin'ichiro Kawasaki Subject: [PATCH blktests v4 16/17] nvme/{rc,016,017}: rename nvme_num_iter to NVME_NUM_ITER Date: Sat, 4 May 2024 17:14:47 +0900 Message-ID: <20240504081448.1107562-17-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240504081448.1107562-1-shinichiro.kawasaki@wdc.com> References: <20240504081448.1107562-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. Reviewed-by: Daniel Wagner Signed-off-by: Shin'ichiro Kawasaki --- 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 ef7b966..6fc0020 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 Sat May 4 08:14:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13653829 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (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 14CCD12B7D for ; Sat, 4 May 2024 08:15:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810514; cv=none; b=et8PfQAngPGtPCZpQcANSLPyn4WnEWEzEOrEpm+KqhRcmntvVMFmVqOE5OKirvviO3uTHpS9SWs57AHmUiRHPNWY7AmfYt1MR9Ngiajl3fdaiF61R8G0vW7UpQmeJIZ399ybZ4MlW/fP+ldWradR5yB2UpejY+wp5kEZ2uaSMAw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714810514; c=relaxed/simple; bh=t7G2Ho5WPgwkt3ZFuraW47O0HRzd+FaFO+yo28FOtDU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dJu2iGT8u/IYdfihItUPHMe8MlH2UVevxaeGMbriGUN6Pty+dzwDUV6YudFChwynn48STJwxZOonJM+NOKMmOSbU/cCbquRBI1yhuvH1qujpHxyR9j/1GIJ62gWJW7Pm1BGE95kVyfJwpqJwB6/92aFgBOvnG4feYRpiURxtPe8= 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=M2xFXMiw; arc=none smtp.client-ip=216.71.154.45 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="M2xFXMiw" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1714810512; x=1746346512; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t7G2Ho5WPgwkt3ZFuraW47O0HRzd+FaFO+yo28FOtDU=; b=M2xFXMiwIEsTcRgxg6uaz952VUOD0l0jB8Ej3kBrYAJEV/bNvd8n2BMM l6x9XaUtwWManRoLJRf+YBHLWU0RShuhMl41jfUtTb+hADOW/QZyfZ5oD qk8der7Dizw5W3z72zjXaEa6yVE8Gc3pP2FOp8q34d+8eigVuEVvdycGE HUHUn3c72CkQTcBCG9tm9tcIkJ4YFZ9OSo1G4tCeQtcyPnZITjWY9Nuy/ llWzvT8K1+LysjrQV37DXQ+93ZzOmJ79VilLDf7uZk2gWFV671QolJJTp kHByH1T+TBd2TS+wiaTgemnjnr2EOVO7DH6hMc6acfWPOMwkYfJSkNtNZ A==; X-CSE-ConnectionGUID: 6ZLNBTP+SNSsFK/uzc+abw== X-CSE-MsgGUID: 96UXMnAoT9qW+4o1WwMybw== X-IronPort-AV: E=Sophos;i="6.07,253,1708358400"; d="scan'208";a="15540358" 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; 04 May 2024 16:15:12 +0800 IronPort-SDR: VrXKfzrk8cD8/NTLMxlvfP/pdoe+5/2i49WxCxbGATrYsLgGKtBH/Bj1v714fMtMAHMWAEWGTJ JbHYPVWr7KbDpyCEmYCQeGhYs4Kb5Jymazh4p0EmN54gp9zxT5GRjBZ5WJfLe6BxT4xmLTcoFW 1eSsmUK3AUxLh5lzZ9/UxvWa7LOgIuGd3pbJHbZgPJ/nuxEhADz/g7UCD/ZBV7ZD8K4LuphthT eH0YL7ae3kH81qaE7cpIWth7/aoNagdERRTelctm7f3OeLG7XSISmjrxVz6Yqi1eSIiBUBiLht yQw= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 May 2024 00:23:10 -0700 IronPort-SDR: +VsxZNyaEtyXC2FUTDXm5TSjW5TLuz8wCYTv7CUL+KZNduTEprAmYkX/VO7HR2rylv44ElWF0Z eBxqn5/2yhb+ahLhY4we4IulCddX0WCaA/UASNwKJhxrZBaKU9IKpPvW5a1p8AAcXC1I+QLzJg J5I4grPWLBdmuzJ8GQcqQCEslrZ+jfdPa2breAqXcY4UYPbKMonUq3LMJCGPLsB6wpDCmZPiQF WKp0RdGXoMUYjzj6IBdxL0Fg0OOcNg2MIPOersX0mbTt4jIaogmc75RIi6MTUaCwXFEuJPtKmC wyw= WDCIronportException: Internal Received: from unknown (HELO shinhome.flets-east.jp) ([10.225.163.38]) by uls-op-cesaip01.wdc.com with ESMTP; 04 May 2024 01:15:10 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni , Sagi Grimberg , Shin'ichiro Kawasaki Subject: [PATCH blktests v4 17/17] nvme/rc,srp/rc,common/multipath-over-rdma: rename use_rxe to USE_RXE Date: Sat, 4 May 2024 17:14:48 +0900 Message-ID: <20240504081448.1107562-18-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240504081448.1107562-1-shinichiro.kawasaki@wdc.com> References: <20240504081448.1107562-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. Reviewed-by: Daniel Wagner Signed-off-by: Shin'ichiro Kawasaki --- 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 6fc0020..c1ddf41 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -97,7 +97,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