From patchwork Tue Apr 16 10:31:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13631663 Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) (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 8EE66763F1 for ; Tue, 16 Apr 2024 10:32:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.141.245 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263533; cv=none; b=kXc6FtWXYzMbqkLt5nkfMQ+Ta3idcT+hC0foH+GqPzxumvDKUyT3f/5LVwiSP3B0p3a3mSWL3Y6gyVus3zkXSjPB8pD9XOc8cueOT8h4M3nCsHiGFoNLJtsCUCdDqQhU8QxkGfSTNnJIOG2PnU9h6efU2jZs2agLB4LBM9wzpdU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263533; c=relaxed/simple; bh=OvgikZMeVjQImGamzRSuQl9g9/GvBeWvN5ptIDlf9UU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Oi7QAYF8DMy8gOJC+qzkC4cwns6nKx6bzWHiPsNzhlzZ1WgQJd5WET06CNl1dO1AQtyL7ALLfMO3OCt6Ci8K2ankJBqq6JRFhVqLAfZr6j+ZxX/r1MADWdRZib10T3SDIr1xA2GbKZs+UjVRjp9f3bwgo6hxgnabhU9AUNDSYaU= 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=Y4GYrv2l; arc=none smtp.client-ip=68.232.141.245 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="Y4GYrv2l" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713263531; x=1744799531; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OvgikZMeVjQImGamzRSuQl9g9/GvBeWvN5ptIDlf9UU=; b=Y4GYrv2lpJQf43x9/zFJ5Y9QC2slQemycOehVZqMDQIek55QWEnwvxbw M6KjjKc2C3xNyhZ1MWhiPICr8y95lAG7BgYgcCGZ0IC2YxFkArAQe2puP 6MkSgbeUHhEMQeUjK/JaL9ZfVdtXmRJo4AGChe0QnBfLYKqxH0w7j8JO6 BuMpqPxHZBxJwXEahgxlmmsUFcdHFEHnp+y6TdZ/4CnwopIbaJkR4W29C ddeugScsLr6ZX+S/gUiDF70qZAuap3y1NtFB14Lrq7meFYMdDGD+EVdCD LiGZWDPCi4lbXlrvvQ66o0Q3KjtXlMaYERSTrphqQxDDJ4qsNm3E7itGt w==; X-CSE-ConnectionGUID: 5FOfmW+GTdOc+TdH2OzcIw== X-CSE-MsgGUID: MWE37c/QTb+eSDH2/akkvQ== X-IronPort-AV: E=Sophos;i="6.07,205,1708358400"; d="scan'208";a="14322607" 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; 16 Apr 2024 18:32:09 +0800 IronPort-SDR: Z9+Hr43s3ZfsVWj8UeOeJ7a0IFAXOsYG1VxXthgkPIU5qbwJZBOj8XNX1a/1BLommC/p0gKvB8 eD72xT1jfK/dBFIjJSFLFmanEevLZTbKENADYwb8/yvvEfj+Uecwbe51YtEHBs6LSWUX2KC0+S DbRyTyT/1BsfiTtKOOpB9O71VdaYMYBE5OYBxhs1GUF8c6UQTbmFhLWImSoZLLp4WxkvgF/qEJ Ac3Qn+Z2altS39ORv0+jQFgX1Ii7lABHpMyHzGqvcqW6MBnnilG9gUqZMHYEdfliXz3E5P6YK6 ZjU= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 16 Apr 2024 02:40:30 -0700 IronPort-SDR: LZSI8JEanNsG3//X4HaccHNrCOh6BKGs1PjUho+9IXMZXa9AfI7oVgskBI4IJE7XuNd6WhdsNf 8FAHL6pibhjp6VkQHFmjgqfKMzBb/FbST9aADYx3AghUnZE8nDlvoSk6rHJygpJnJidMO3TMks FZMmjJ9xIjTFwbmDq6hcFjZtfMmczOnR0mJUSsLd1dr0UZ9KuwI8JlbMldqepeTAYbevlp6epI 5OTqp75x+8En0AxCzRPmIAKtQe1EqPhsMMPi7sQzK8wfp7W6hGlVpLYzomwm7TnxpbtVy08p9w DmM= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 16 Apr 2024 03:32:09 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests v2 01/11] check: factor out _run_test() Date: Tue, 16 Apr 2024 19:31:57 +0900 Message-ID: <20240416103207.2754778-2-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> References: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The function _run_test() is rather complex and has deep nests. Before modifying it for repeated test case runs, simplify it. Factor out some part of the function to the new functions _check_and_call_test() and _check_and_call_test_device(). Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Nitesh Shetty --- check | 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 Tue Apr 16 10:31:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13631664 Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) (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 19F6184FA0 for ; Tue, 16 Apr 2024 10:32:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.141.245 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263533; cv=none; b=aTgvpWpwZDBSGcPgHeFrUVVj2WCQBMPbR76SvJxpb67R5BjAveCP9bFjsZJfK1VnLeXapaQO3LHHqCbUufqDBGyMw2OjfesrUbEd39+//k8ovdZSOMIfIc75AUVxlxJMwxz+WcH3BuWFKQyJAqwg2xKPpjwyAcSAb8ApLDSGvN8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263533; c=relaxed/simple; bh=x1t5cJ0U34rWyUveaYYeySXe5tKD91DdltABqEfaEmc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aEBXv/NJ7vY14J7OJpwhe/sWxhisoCCCSPrqT+vVyWsQy3HgaMB6GQFbwcUZHxMECve+thckD4/Qehw9p049rSJ1Sb0gr4xfwjv2OEyzgVGd632nUFeGOtgTdy3MishDyBXSzUuByIIEvRDIVfxQl2KoahuYNKj715zgQtiGMno= 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=ooyBZdFW; arc=none smtp.client-ip=68.232.141.245 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="ooyBZdFW" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713263531; x=1744799531; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=x1t5cJ0U34rWyUveaYYeySXe5tKD91DdltABqEfaEmc=; b=ooyBZdFWMOohtkr5vimRVM0A9LbVPmWd2rKXmN09GOMcksnDNFEQoGaL 8HCEezVghxHaJbPkrWsBTHr6SHlLvFcWIwW8Z0c5TB+kcElURNaLooDz7 N9RC/YRQSFt92I1ar69WFQvoGPqlQzv+27DIsbyCwyWdr40BvcxdvIJBb P/l3fatxJLOQVU87VS6mUdrHZgfd/8c8yjq9NPvSwIfDdm0dMcEFGU8Dd 1PCtLtlkDB6wkyYyIDkGCQCK8IShfJH6nLDlXd7RXAhJeN3XLmdNf5jlF d79eFoOthIyplQU3XTTW02+XrXwBXByBiebnh96Id2zyu7C4OR1/D0gV0 A==; X-CSE-ConnectionGUID: YfIfjqfvQPunEHYkppsW+g== X-CSE-MsgGUID: QB614n4wTSWpXfEDFEPOSw== X-IronPort-AV: E=Sophos;i="6.07,205,1708358400"; d="scan'208";a="14322611" 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; 16 Apr 2024 18:32:10 +0800 IronPort-SDR: THIAe7myd1N/1aAs/S/syhf1htcbevjz6rWknQgxAEzs21eRuilrpnjisW/LkuFmoj2ci1t5T3 zdhHP5QGt/vH28YpXTd2lVuSvqHHc1yrs7EMtugXLH9s60D7cpxsz+bRpLg9b42tVlV6WWb8+S M6Afe4/kvNbhKN9U/W08m+D0YCR6wazAQbIeUmLSifnIEd0l98zcRzg/on0bPSBcngLntAxlmt G1RupXd2meG2OzjGS2xsFBun+2FtkZoQE9QLzYgJ2PahskpxsQCTB/QMoUWND5KoZ78HM/fUmm 1ak= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 16 Apr 2024 02:40:31 -0700 IronPort-SDR: q0fFnyGc4WdfTFVH5g5+yXoz3XBPtyHtxU1T1O1Mob1grXkwCuJUqXlpPnj1/qz428cxkfpmZV 6RwuMvAMPheBVVF9ilIs9cVFsZM1UcX3YJoXMF3z3fMi0YNN0CYwgy2EgKzQteFwzy2Tg6T/B4 m0YY/Dsturcnrf/SxaCIAhNsiBx1ifA85v90cKLEYoxrS1C0PnPGHZzX4jPiA0G3FNHJfpMYDp bVUL7/mDOhlOi1VRaNthKEa1xsnJNbeu5Fm14FWuH/iOrWNMSC+w8pkvev2C1n5rOyzQvv6h6Z iNE= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 16 Apr 2024 03:32:10 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests v2 02/11] check: support test case repeat by different conditions Date: Tue, 16 Apr 2024 19:31:58 +0900 Message-ID: <20240416103207.2754778-3-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> References: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 It is often required to run the same test with slightly different test conditions. If we create each test case for each test condition, those test cases are almost same and have code duplication. Such duplication is seen in many of the nvme test cases that set up nvme transport. To avoid the code duplication, introduce a new feature to support test case repetition with different conditions. When a test case implements the function set_conditions(), blktests repeat the test case. When set_conditions() is called without an argument, it returns how many times the test case is to be repeated. Before each test case run, blktests calls set_conditions() with an argument number from 0 to the number of repetitions minus 1. set_conditions() sets up the condition for each test run referring to the argument as the index of the condition to set up. set_conditions() also sets up a short string in the COND_DESC variable. This string is printed to stdout to identify the condition of each run. It is also used as the directory path name to hold result files. Document the usage of set_conditions() in the new script. Separate out shellcheck command line for the new script to avoid a false-positive warning unique to the file. Signed-off-by: Shin'ichiro Kawasaki --- Makefile | 3 ++- check | 57 ++++++++++++++++++++++++++++++++++------------- common/shellcheck | 2 +- new | 21 +++++++++++++++++ 4 files changed, 65 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 43f2ab0..1c685fe 100644 --- a/Makefile +++ b/Makefile @@ -18,8 +18,9 @@ install: SHELLCHECK_EXCLUDE := SC2119 check: - shellcheck -x -e $(SHELLCHECK_EXCLUDE) -f gcc check new common/* \ + shellcheck -x -e $(SHELLCHECK_EXCLUDE) -f gcc check common/* \ tests/*/rc tests/*/[0-9]*[0-9] src/*.sh + shellcheck --exclude=$(SHELLCHECK_EXCLUDE),SC2154 --format=gcc new ! grep TODO tests/*/rc tests/*/[0-9]*[0-9] ! find -name '*.out' -perm /u=x+g=x+o=x -printf '%p is executable\n' | grep . diff --git a/check b/check index 7d09ec0..edc421d 100755 --- a/check +++ b/check @@ -17,7 +17,9 @@ _found_test() { local test_name="$1" local explicit="$2" - unset CAN_BE_ZONED DESCRIPTION QUICK TIMED requires device_requires test test_device fallback_device cleanup_fallback_device + unset CAN_BE_ZONED DESCRIPTION QUICK TIMED requires device_requires \ + test test_device fallback_device cleanup_fallback_device \ + set_conditions # shellcheck disable=SC1090 if ! . "tests/${test_name}"; then @@ -190,15 +192,12 @@ _write_test_run() { _output_status() { local test="$1" local status="$2" - local zoned=" " + local str="${test} " - if (( RUN_FOR_ZONED )); then zoned=" (zoned) "; fi - - if [[ "${DESCRIPTION:-}" ]]; then - printf '%-60s' "${test}${zoned}($DESCRIPTION)" - else - printf '%-60s' "${test}${zoned}" - fi + (( RUN_FOR_ZONED )) && str="$str(zoned) " + [[ ${COND_DESC:-} ]] && str="$str(${COND_DESC}) " + [[ ${DESCRIPTION:-} ]] && str="$str(${DESCRIPTION})" + printf '%-60s' "${str}" if [[ -z $status ]]; then echo return @@ -464,17 +463,19 @@ _unload_modules() { } _check_and_call_test() { + local postfix local ret if declare -fF requires >/dev/null; then requires fi - RESULTS_DIR="$OUTPUT/nodev" + [[ -n $COND_DESC ]] && postfix=_${COND_DESC//[ =]/_} + RESULTS_DIR="$OUTPUT/nodev${postfix}" _call_test test ret=$? if (( RUN_ZONED_TESTS && CAN_BE_ZONED )); then - RESULTS_DIR="$OUTPUT/nodev_zoned" + RESULTS_DIR="$OUTPUT/nodev_zoned${postfix}" RUN_FOR_ZONED=1 _call_test test ret=$(( ret || $? )) @@ -484,6 +485,7 @@ _check_and_call_test() { } _check_and_call_test_device() { + local postfix local unset_skip_reason local ret @@ -491,6 +493,7 @@ _check_and_call_test_device() { requires fi + [[ -n $COND_DESC ]] && postfix=_${COND_DESC//[ =]/_} for TEST_DEV in "${TEST_DEVS[@]}"; do TEST_DEV_SYSFS="${TEST_DEV_SYSFS_DIRS["$TEST_DEV"]}" TEST_DEV_PART_SYSFS="${TEST_DEV_PART_SYSFS_DIRS["$TEST_DEV"]}" @@ -504,7 +507,7 @@ _check_and_call_test_device() { device_requires fi fi - RESULTS_DIR="$OUTPUT/$(basename "$TEST_DEV")" + RESULTS_DIR="$OUTPUT/$(basename "$TEST_DEV")""$postfix" if ! _call_test test_device; then ret=1 fi @@ -522,9 +525,11 @@ _run_test() { CHECK_DMESG=1 DMESG_FILTER="cat" RUN_FOR_ZONED=0 + COND_DESC="" FALLBACK_DEVICE=0 MODULES_TO_UNLOAD=() + local nr_conds cond_i local ret=0 # Ensure job control monitor mode is off in the sub-shell for test case @@ -535,8 +540,18 @@ _run_test() { . "tests/${TEST_NAME}" if declare -fF test >/dev/null; then - _check_and_call_test - ret=$? + if declare -fF set_conditions >/dev/null; then + nr_conds=$(set_conditions) + for ((cond_i = 0; cond_i < nr_conds; cond_i++)); do + set_conditions $cond_i + _check_and_call_test + ret=$(( ret || $? )) + unset SKIP_REASONS + done + else + _check_and_call_test + ret=$? + fi else if [[ ${#TEST_DEVS[@]} -eq 0 ]] && \ declare -fF fallback_device >/dev/null; then @@ -558,8 +573,18 @@ _run_test() { return 0 fi - _check_and_call_test_device - ret=$? + if declare -fF set_conditions >/dev/null; then + nr_conds=$(set_conditions) + for ((cond_i = 0; cond_i < nr_conds; cond_i++)); do + set_conditions $cond_i + _check_and_call_test_device + ret=$(( ret || $? )) + unset SKIP_REASONS + done + else + _check_and_call_test_device + ret=$? + fi if (( FALLBACK_DEVICE )); then cleanup_fallback_device diff --git a/common/shellcheck b/common/shellcheck index 8c324bd..ac0a51e 100644 --- a/common/shellcheck +++ b/common/shellcheck @@ -6,5 +6,5 @@ # Suppress unused global variable warnings. _silence_sc2034() { - echo "$CAN_BE_ZONED $CGROUP2_DIR $CHECK_DMESG $DESCRIPTION $DMESG_FILTER $FIO_PERF_FIELDS $FIO_PERF_PREFIX $QUICK $SKIP_REASONS ${TEST_RUN[*]} $TIMED" > /dev/null + echo "$CAN_BE_ZONED $CGROUP2_DIR $CHECK_DMESG $COND_DESC $DESCRIPTION $DMESG_FILTER $FIO_PERF_FIELDS $FIO_PERF_PREFIX $QUICK $SKIP_REASONS ${TEST_RUN[*]} $TIMED" > /dev/null } diff --git a/new b/new index 574d8b4..cb5fab2 100755 --- a/new +++ b/new @@ -180,6 +180,27 @@ DESCRIPTION="" # _require_test_dev_is_foo && _require_test_dev_supports_bar # } +# TODO: if the test case can run the same test for different conditions, define +# the helper function "set_condition". When no argument is specified, return the +# number of condition variations. Blktests repeats the test case as many times +# as the returned number. When its argument is specified, refer to it as the +# condition variation index and set up the conditions for it. Also set the +# global variable COND_DESC which is printed at the test case run and used for +# the result directory name. Blktests calls set_condition() before each run of +# the test case incrementing the argument index from 0. +# set_conditions() { +# local index=\$1 +# +# if [[ -z \$index ]]; then +# echo 2 # return number of condition variations +# return +# fi +# +# # Set test conditions based on the $index +# ... +# COND_DESC="Describe the conditions shortly" +# } + # TODO: define the test. The output of this function (stdout and stderr) will # be compared to tests/\${TEST_NAME}.out. If it does not match, the test is # considered a failure. If the test runs a command which has unnecessary From patchwork Tue Apr 16 10:31:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13631665 Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) (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 33F62127B7D for ; Tue, 16 Apr 2024 10:32:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.141.245 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263534; cv=none; b=trBD8wlz7dc41H5XqmGzMR2gS+DAS0/LnyhVcsUnb8E73NbUrBhhuoIYIdV5Gq3JK/7O9BFHgh4dxMkQPcf+5aVPhcvONn4PubiQ7fW79iBhUpYI5x08GmP34/LmB2KXJcneVZyCMc1C27SDw/jg627xrmyvr9y7q5TTaEkcdUM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263534; c=relaxed/simple; bh=OULd77odMzihZqoRtAKAJByG8IrF0EFlmFWrGigNWSg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ad4fkhjWNyJPUf0a1MTCK5Mo2P6mY6/ipWVOEYPxXbviNDC1DPdceTjU/IaaTqTo++YdtAHaHInZuRU9Mg5TdYtRtaTs2T3pkkUX2UwfhkTHPlYKKKzgtvpRNBAgC1Km5X0x4uMWf1LkcfYu4U8FMkSzQ2o9LuTSs+KWNpvhoOI= 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=NWM64oZ9; arc=none smtp.client-ip=68.232.141.245 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="NWM64oZ9" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713263532; x=1744799532; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OULd77odMzihZqoRtAKAJByG8IrF0EFlmFWrGigNWSg=; b=NWM64oZ9I+RDu5mzcDOiIMEKBgeHblw4n7yV9j8rZugQinLCWh9/Tygu zf7sCugnh5rfGs0J6caRDoLz35eU+iNM+EmFtpCOzPBtlQ5/tE0YiI4hn TSuOCRenWTvQh8wQSLvvPGTCI+1bootfhUFuZb2N/++bkJlMwx9SWs2th 2QmhLVX8ZVU+bt2VQW2JSbSa5aN9+KhUY5V8SZOsC+4ixwB5613eTmYww ouBR/FFCzn4BxU33+sAs1NkInqbALcgd1UR9KVVxvi//F0z/cFSZr21tF RSC57Yi80uCj7Wk6e+5IFlGSVuIyWLjc+LaM3/LbJ/k0s8zim0lu346MA A==; X-CSE-ConnectionGUID: C8UuPGZqRpuVHha1b3BZzw== X-CSE-MsgGUID: jBq0kIapRVOkViUP99Mh6Q== X-IronPort-AV: E=Sophos;i="6.07,205,1708358400"; d="scan'208";a="14322612" 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; 16 Apr 2024 18:32:11 +0800 IronPort-SDR: HGFr86W74vaiT0TDhLB6PLyDn1w6VeXWeKV19jiLydGFzUngq4I1FrvxTOFnq1yiFE86pGkoQi Skv/B1h6YNyYE1zAax36F4OZVG6Q1xmeXhHXGgoN7SppnoZm7oeDCr/LsmQDPHX/MHglPmlirK y7sh+905RiyM5IgoZjsGPf2Y+ucmimoaXTezL5SSpLBdjSXA7Jq9tZkdXs48+QcLNAy2Eat0k1 pdzuhqarkk7Nzgv41AmVQA5ZFNttMXmx5LhuiMdAAPECCxEkNuApX6lbjdPNOsjK/hCdNzTBU9 u+8= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 16 Apr 2024 02:40:32 -0700 IronPort-SDR: OG1vlJXPg0nZfzFnr5t+P0MJNu7zY0MN9sHkwwcmMhvsjurQ6nF0hZKU8OxwH0yG8KrY8TzM9i whTBqJuB44od0II4cRIdAuvgBtTK138HWVC5lznWmOMor08QF1M1K1p0RdcoIH0W8lrltLrlL9 ZchcUuPSbAiG1BLc7KzXCZI2hSNsia7wR2v9+/6PdlmkynMN8HtnMN/ZzMSLsB1Q4U+OXXEcaN 2Pc3SeIjVXP5krRKcdlLIh5oGG0Za33bKQw4IaEXfTeyO/tIeUr+9nPZLY6S6pVXeJrZX5Ujdd 5fs= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 16 Apr 2024 03:32:11 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests v2 03/11] check: use set_conditions() for the CAN_BE_ZONED test cases Date: Tue, 16 Apr 2024 19:31:59 +0900 Message-ID: <20240416103207.2754778-4-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> References: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When the test case with test() function is marked as CAN_BE_ZONED, blktests runs the test case twice: once for non-zoned device, and the second for zoned device. This is now implemented as a special logic in the check script. To simplify the implementation, use the feature to repeat test cases with different conditions. Use set_conditions() and move out the special logic from the check script to the common/zoned script file. Signed-off-by: Shin'ichiro Kawasaki --- check | 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 Tue Apr 16 10:32:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13631667 Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) (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 2545A127E23 for ; Tue, 16 Apr 2024 10:32:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.141.245 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263535; cv=none; b=HZ2JtzxaC3Iz4Ufd0WXbf/Wflai4UsmeH5nQ9V2w5EvcW6VYYNYidE1bOqJORYpHfBWkfv2FiGHov6/tp7V7uPo//LvyQ8ZTewf7rh/mwZwhQjG6Q7ZVMFNYVrZBXlPKyQ6+QWTqaaO2A4+fYCpVQEIRYPZKoDGN8CtJUWUBFq8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263535; c=relaxed/simple; bh=SBK3Pk2xC4hSF2vaKeplEtIivVa/MUAt4a7KOe5+oVQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DQGmlP4fqBRlkhfvc90/Lwnrzctp9GB/5Yu2bNsnYM7RL/a+dDdCc0tnFiGAsFvtbNudHyB6Ij0FUcvWFlUxarPnSUaKO8GBWZNzfsP36j3yv/zgeDQuHO8pIxXNg33/TdAnxd9+Kxp70ML8qA8b6LwIZZiQgnkWVt5f0V1+ZTA= 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=ZSD7MQuZ; arc=none smtp.client-ip=68.232.141.245 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="ZSD7MQuZ" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713263533; x=1744799533; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SBK3Pk2xC4hSF2vaKeplEtIivVa/MUAt4a7KOe5+oVQ=; b=ZSD7MQuZRhmWsqTQhOm0D4Yl0s7WTRlAMw6pM6u92TAzBXYSHZ26GG7W B7XmdNmqbMk6p5k4idAURyeI/+0mygquiuf4FMpB+e1TggkblqiplyLHR iOjQjPbvPXDGMiUfrdqbF7vqvrKI9afl0rI29cbB7c8G5sOlydzK2ZI7M /5OB/dX0xme7xmca9M1JvWgCMtXr9QEA5m6MaDVZo0eCGm/H+O5w4qIyV jPQ7AABPK+13MjqDWBRN6I/XbHbYfUPWOuWOyKiDPQC5qqRfLNag54zEy 60tz3MXixqJMbFpI2iryJJYbpyeWqbNnEWqFr3JLdubsOXRFCrRAuF7uB g==; X-CSE-ConnectionGUID: H1z4N5aYTPCseXnu+PQuxw== X-CSE-MsgGUID: zwd/wuJyQeqiL27fFt3RAQ== X-IronPort-AV: E=Sophos;i="6.07,205,1708358400"; d="scan'208";a="14322614" 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; 16 Apr 2024 18:32:12 +0800 IronPort-SDR: dXCnut5dyEnJrgul75GYXII/2vhrgrIrgcrUpvSqHaiFBht9ZHh8/x19hRaxG4T9KCPrY7BSst WRpLrv65NOqWTHq2A8uz7s9oJ2v3us0Utr49YXdY9fYN8JxzZWLId0vsXh8B0pO8oz3NnE81v6 K1u6Hcc3Pix5z0oOaMYnhrTuL4QcS7ZIxwz93yvTt+4vjAQpfax27ejdO8iabB7sZ8S0GB3frT 2ZOrc/m4IL6yYaD3Q6bZpqzdfUQUbsAtSDZyvsrzKl5XP+y6w2yH92xEvJw3fR/xAxcB1vHNdc hIE= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 16 Apr 2024 02:40:32 -0700 IronPort-SDR: L5ID6y2Q1evLzQ/zMTOCtLSa3e1X2AwMG+baz6+K+5WsER991wuHNF63C47ggf+WQN2VZj6J8t jDyGKHiqD4ocCL8CyQiDxO0CUrJt1sbJdossf4m5BU43T47WvKdlxwsSIj2HoxjRTokz8kjZIK +E4uAvyUJv+nqu+4i0IA997HHtFFRLgUg3OiUtV1XNq8NreVS6L7IOHJi+kMlZvsfX0GtGplvs JguOLi2+bcrvrsx0hgQ4qFvKCOl/4YBcZROhlDIWxGuqSULjCw5Xlh82IkRvWv4l7oyvvCHC6I EOc= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 16 Apr 2024 03:32:12 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests v2 04/11] meta/{016,017}: add test cases to check repeated test case runs Date: Tue, 16 Apr 2024 19:32:00 +0900 Message-ID: <20240416103207.2754778-5-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> References: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add test cases to confirm the feature to repeat test case runs with different conditions is working. Signed-off-by: Shin'ichiro Kawasaki --- tests/meta/016 | 29 +++++++++++++++++++++++++++++ tests/meta/016.out | 2 ++ tests/meta/017 | 29 +++++++++++++++++++++++++++++ tests/meta/017.out | 2 ++ 4 files changed, 62 insertions(+) create mode 100755 tests/meta/016 create mode 100644 tests/meta/016.out create mode 100755 tests/meta/017 create mode 100644 tests/meta/017.out diff --git a/tests/meta/016 b/tests/meta/016 new file mode 100755 index 0000000..caf876d --- /dev/null +++ b/tests/meta/016 @@ -0,0 +1,29 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2024 Western Digital Corporation or its affiliates. +# +# Test repeated test() run with set_conditions() + +. tests/meta/rc + +DESCRIPTION="repeat test()" + +declare cond_set_index + +set_conditions() { + local index=$1 + + if [[ -z $index ]]; then + echo 2 + return + fi + + cond_set_index=$index + COND_DESC="condition set $index" +} + +test() { + echo "Running ${TEST_NAME}" + echo "condition set $cond_set_index" >> "$FULL" + echo "Test complete" +} diff --git a/tests/meta/016.out b/tests/meta/016.out new file mode 100644 index 0000000..cccfec4 --- /dev/null +++ b/tests/meta/016.out @@ -0,0 +1,2 @@ +Running meta/016 +Test complete diff --git a/tests/meta/017 b/tests/meta/017 new file mode 100755 index 0000000..03f92d6 --- /dev/null +++ b/tests/meta/017 @@ -0,0 +1,29 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2024 Western Digital Corporation or its affiliates. +# +# Test repeated test_device() run with set_conditions() + +. tests/meta/rc + +DESCRIPTION="repeat test_device()" + +declare cond_set_index + +set_conditions() { + local index=$1 + + if [[ -z $index ]]; then + echo 2 + return + fi + + cond_set_index=$index + COND_DESC="condition set $index" +} + +test_device() { + echo "Running ${TEST_NAME}" + echo "condition set $cond_set_index" >> "$FULL" + echo "Test complete" +} diff --git a/tests/meta/017.out b/tests/meta/017.out new file mode 100644 index 0000000..7fc55ff --- /dev/null +++ b/tests/meta/017.out @@ -0,0 +1,2 @@ +Running meta/017 +Test complete From patchwork Tue Apr 16 10:32:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13631666 Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) (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 0CE98127E20 for ; Tue, 16 Apr 2024 10:32:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.141.245 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263535; cv=none; b=cVdj3LNlb+dao7hpKKxW4YS7f8/AmrbAkWZyAinv5buMsdUywAp4754QoaM8NlHPiSyS2w25/SkoiZE4ZvhSyfa5fXrP8cSwPtqSPYF2kQN+AazKvz6K1GJpYpNaCHBEJpQbShTqA3ttp9P8w8Po7SoXhGGwSxqgxc5tw6yXx7M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263535; c=relaxed/simple; bh=HncKKmC+QVZ0Aq+UWgdlyuRlINtlt7Qu9LbWVThxhGE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K3J2hEyhHeK2JMgeM9U5ZcTu7MKXXWmttZrT7iS/Y2H57b8ik3+oWal4b/tWs+iiSUQ9G2ADgQein5meiyn/dPsOeP8b2UkL5yxxGvy2CfEFTVDs+B5/+Z7vtJsbtcwT8Gut4WjC4Ghsq1ki8F7LuTKGIKOjG8YaIXbEC19o9Nc= 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=AcOc0yXW; arc=none smtp.client-ip=68.232.141.245 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="AcOc0yXW" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713263533; x=1744799533; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HncKKmC+QVZ0Aq+UWgdlyuRlINtlt7Qu9LbWVThxhGE=; b=AcOc0yXWlz+fkhWIw+YsqcObwFjauU3qbDneqCsDCIwqy1LahE9Icrq4 sHZzvu8FUs67Lne6kM8pnGI7cpN1LPkFnLN1xO5UUf7W1CPoHfHJ0b6Ke y/Aq9Cr4tV9g2teYZBlsOjwzZ2YEav+peGLKDk7xQiWMEyEPFnHYDyNs6 xRU76T8ob81SpD4pW36ChPRqP02nVLTOJyoqLRi4yVbK4GQ3AMwoa4spK qimr7kbj1qSH5mgBiqivcQemEgnb68w8Z+z05sRb/bzRBMM5nghk6nXFE ALQ/P55rA3cEeAepM4IzpfY/Pt/ttS5wLqQ5swQiX1hxo6CkLKP1EfoBj A==; X-CSE-ConnectionGUID: uJuc4bWIRluTdy+oXsI8LQ== X-CSE-MsgGUID: dK14PW2hTnOv7W5ynMbvCA== X-IronPort-AV: E=Sophos;i="6.07,205,1708358400"; d="scan'208";a="14322615" 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; 16 Apr 2024 18:32:13 +0800 IronPort-SDR: rTUoevyEJTM63QYF+xt1Gwa3At16xwM+PrEXJrldok1XAshudk0TdHmP2hSO4VIBaUZCbiWmex FD7b2hDFUOl0vUXtanaYWNUzIVsyLjOhlUOVjEEiqLOMxT0wfId8PyyNVM5ZjpkdjtmOnEBwn5 7nIdylGrM3TmojTzozwxlRbB4jhN7uWb9MPC7k0pWH4yKAyVOoQ6LbLO+OLUsvHMfYbh5eqoMy YERSz8V5It7BJCLEzghowY8mkwI2h9xrgKL89uxSZPS3hbdUsjlTdaXj1Xfbyjw34XPFruLU5l t2Q= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 16 Apr 2024 02:40:33 -0700 IronPort-SDR: TWn9qJPK8wwIoU3pfmqgYjZgyT2caZ0FA+Uu97wqqnlxYe6AAb9VFPpzeequb7v3j8cnKcrCDB QT5GPF7sCcc4y6DkZ2NhXYrpYgGoZ0X7sjgZRdzF3Hu59XoshxpJcum4qvJKPia/HR+eDqs2eR tzLrpRQW+gdgudTtnP0WwLiEuDWNA6RcY4M1StY+khtk6QQSOjkmJIZ+oV2RsSu1poep/+fNUn VdpY2OpgafU7KhgNSLumFkDvHKJUivjDwyaRPD4Aw9ivVoaYA2uHzblH1AANIEzCagqbE3S396 G44= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 16 Apr 2024 03:32:13 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests v2 05/11] nvme/rc: introduce NVMET_TRTYPES Date: Tue, 16 Apr 2024 19:32:01 +0900 Message-ID: <20240416103207.2754778-6-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> References: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Some of the test cases in nvme test group can be run under various nvme target transport types. The configuration parameter nvme_trtype specifies the transport to use. But this configuration method has two drawbacks. Firstly, the blktests check script needs to be invoked multiple times to cover multiple transport types. Secondly, the test cases irrelevant to the transport types are executed exactly same conditions in the multiple blktests runs. To avoid the drawbacks, introduce the new configuration parameter NVMET_TRTYPES. This parameter can take multiple transport types like: NVMET_TRTYPES="loop tcp" Also introduce _nvmet_set_nvme_trtype() which can be called from the set_conditions() hook of the transport type dependent test cases. Blktests will repeat the test case as many as the number of elements in NVMET_TRTYPES, and set nvme_trtype for each test case run. Signed-off-by: Shin'ichiro Kawasaki --- Documentation/running-tests.md | 11 ++++++++--- tests/nvme/rc | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/Documentation/running-tests.md b/Documentation/running-tests.md index ae80860..144acd1 100644 --- a/Documentation/running-tests.md +++ b/Documentation/running-tests.md @@ -102,8 +102,13 @@ RUN_ZONED_TESTS=1 The NVMe tests can be additionally parameterized via environment variables. +- 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. - nvme_trtype: 'loop' (default), 'tcp', 'rdma' and 'fc' - Run the tests with the given transport. + Run the tests with the given transport. This parameter is still usable but + replaced with NVMET_TRTYPES. Use NVMET_TRTYPES instead. - nvme_img_size: '1G' (default) Run the tests with given image size in bytes. 'm', 'M', 'g' and 'G' postfix are supported. @@ -117,11 +122,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..34ecdde 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"} nvme_img_size=${nvme_img_size:-"1G"} nvme_num_iter=${nvme_num_iter:-"1000"} +# Check consistency of NVMET_TRTYPES and nvme_trtype configurations. +# If neither is configured, set the default value. +first_call=${first_call:-1} +if ((first_call)); then + if [[ -n $nvme_trtype ]]; then + if [[ -n $NVMET_TRTYPES ]]; then + echo "Both nvme_trtype and NVMET_TRTYPES are specified" + exit 1 + fi + NVMET_TRTYPES="$nvme_trtype" + elif [[ -z $NVMET_TRTYPES ]]; then + nvme_trtype="loop" + NVMET_TRTYPES="$nvme_trtype" + fi + first_call=0 +fi + +_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() { From patchwork Tue Apr 16 10:32:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13631668 Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) (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 D39D8127E30 for ; Tue, 16 Apr 2024 10:32:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.141.245 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263536; cv=none; b=Xo0TM3q4dXLfMyGTEXXav5uTYnO4R2gCIAGzHmTFDDkDNncGinw8XXgOAXd/akp9wbuEnNcpUyokjbm8q2kSKe32fGt/YjaGqAOxIfHMp8j3vsMaz/QZ0kuCrDPdBbva5sSLnV18Wegw32zl8JY46JUJU9cK4BrCu7zNO55xkcM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263536; c=relaxed/simple; bh=PK8HMoLK5lKrHF0QhzaiuDc58LfZxl3I3zaL5rrdk/8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qLPedLFjU1Nk3hiJaQgzoIV/wlnzRBraI0erbsoxJnM9ViBGYqY8f8qJ8IMBST3Hj127Ixn2ce69vxxpS5WRCUuHagogUPTfZzK6nkLZcxCCk1pGtwsgxpboVKHDb1j0wX9NHeJU+MhDjfw8g5lvJwxigieYQHaUolxyiIgcqmY= 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=JFQyn3XC; arc=none smtp.client-ip=68.232.141.245 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="JFQyn3XC" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713263534; x=1744799534; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PK8HMoLK5lKrHF0QhzaiuDc58LfZxl3I3zaL5rrdk/8=; b=JFQyn3XCnHk9xyzDdE8iAWoNFHrJL5EYW9/3NDnbfDkgGB+63O3v8T6t QBeUxi8CTjhcBzFAOTfcGD3O18ar1hlVjsw4eIwnN9eYZyPtlJi89nejc 9WFWKegHsPIZ+sRZzG/z47+r95mc66zzIlG9yHcV4SybmhmuNpGofVna0 s3iBvgGCAY1TwDvpVNmzbnHw/1VL2nxx8rt6pTvtUabYEnrsus+ozFemk /BdybhzE2ERmd8A6CNT3xPIWSq3033oDdOUUACyeqjWmiISjYr0DtTsb2 GbMCFBiwjofYKDzP6gmF6nfz/uYZfJbzkymJtKE1GTZKu7AZgN+wJ+May w==; X-CSE-ConnectionGUID: ALMQ2XxrQFqMz99b6eQOVw== X-CSE-MsgGUID: Rfi+SVYwQHWc2s9kYwF2iQ== X-IronPort-AV: E=Sophos;i="6.07,205,1708358400"; d="scan'208";a="14322616" 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; 16 Apr 2024 18:32:14 +0800 IronPort-SDR: fd8NRSiL6GIu1zE26RFieoLZSYxO4L7Fr+YgRi2pCpwpnsaiF9fXTd9zlbYiQkKHL+iSyr5Ki/ xTi4A8kCJigPKgmxfzFyFsP95/zDkGlZ6pRfHu/7PyTczdXuAlVLkPYUiLqQLVFnd7VkjGP3L3 +eyZY2cWQSOuo5RNUXO9Yo4J8mLH/eTFwLSwkH3+VwxftQSvpgewpnxlLthtmbhfp6RpIpDJEo 87YlU1rZjKcE0NTJWnPkNhd4m/Qf7RiOFrPatFhkTPSx2xHK6Sb558jC3tg9g+TLovNs3+6O/Y rww= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 16 Apr 2024 02:40:34 -0700 IronPort-SDR: NI9R/y1ONCsU82sincs6OnWmVgMiRXG5IMvnQKIxNffG6Qah2Kbp9ZjxQLZfkHspYa7h3vc6Pw KFFo9yyCDEj11iXQn/C8tEUGJuTjjXAEh67LmXICXuZsOwuy3BHknE0XVQZqwAn4ZkVbobihKN eAIBmNb31eCHvTeL2A03+ftjWBudC2qh8O2kzBxJv0STnIG6iKUxRGqXZLLRovnuNw0BExjVeY gJIL3JZdxusamzJivowezRrR1sVxUpqcaj95azqJcjR9IxfXqdk8owMbd6sftRClYA3zcdptgy 7s8= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 16 Apr 2024 03:32:14 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests v2 06/11] nvme/rc: add blkdev type environment variable Date: Tue, 16 Apr 2024 19:32:02 +0900 Message-ID: <20240416103207.2754778-7-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> References: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Daniel Wagner Introduce nvmet_blkdev_type environment variable which allows to control the target setup. This allows us to drop duplicate tests which just differ how the target is setup. Signed-off-by: Daniel Wagner [Shin'ichiro: dropped description in Documentation/running-tests.md] Signed-off-by: Shin'ichiro Kawasaki --- tests/nvme/rc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/nvme/rc b/tests/nvme/rc index 34ecdde..d44a1c1 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -20,6 +20,7 @@ export def_subsysnqn="blktests-subsystem-1" export def_subsys_uuid="91fdba0d-f87b-4c25-b80f-db7be1418b9e" nvme_img_size=${nvme_img_size:-"1G"} nvme_num_iter=${nvme_num_iter:-"1000"} +nvmet_blkdev_type=${nvmet_blkdev_type:-"device"} # Check consistency of NVMET_TRTYPES and nvme_trtype configurations. # If neither is configured, set the default value. @@ -857,7 +858,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 Tue Apr 16 10:32:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13631669 Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) (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 B1751127E38 for ; Tue, 16 Apr 2024 10:32:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.141.245 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263537; cv=none; b=H7pKX2pDmlahbUGYB7iN1sbsg5o/YcilhIR6t+kpSWYWvALAelkpxQFkwidm5uCVUnnprnU4khDiBlHX1LlXzQ+q/nvHTb/OGAanGkDoW247u1z93OE0xCgT30LXyR8pOd/sS/QGynV+c/gAkMXA+m3Ce+IWNWTRUKVldTpZJzE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263537; c=relaxed/simple; bh=iSWpKJYKZ6ojughWXi5bAnIYQCqtRZAVPjo0ZXW3z2c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rwhSo2U3vnBAHoP22BVoxgJBhJvd4gT7Iy5OkWZa9vWhs8FSNu7F/2Mgk3liutxgI3R2rq/kJu0FwxMJjRSnGyAnNp7sPnAL0tKKzO33lCWK2tCG62CetCXFfTMDT0sHYk0NzCYFs+HsPYS3KStKDGjrz3HgvUVZY4O8hR+WlLM= 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=qjKyczNN; arc=none smtp.client-ip=68.232.141.245 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="qjKyczNN" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713263535; x=1744799535; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iSWpKJYKZ6ojughWXi5bAnIYQCqtRZAVPjo0ZXW3z2c=; b=qjKyczNN+sdIZwgpGqp2e/1KiE95z6yXMiLmhRuSJb/W8eDDVN7A1goP v1XING4ILbXrXSauSwaE2a6FRiSNQ93KLOYRE+VYFq1xJBX3Io3vUc+uI WGnWM07GvFsR9sil5HX08qzHcoC4gHaEIEncihhy/hsojDWlGkvu5Ffks 6jO28YUzAjtvydpaolJIEu9ETKbvUuXue+c6YWAzerB9hxAmDiKWj967w LEpV11SU6Jw4xYb5fMML5tZWRt0GVqqp/nbZ20bJ638Y2gQ6jmsOukZC7 BTU79AQKmnFqsKHKXKcttd10XIw+VWfA/3frVm6cTJNio0zyAO6xQ6Npo Q==; X-CSE-ConnectionGUID: PrJjitjqT/eMjhsOt5RC7g== X-CSE-MsgGUID: EZqoW8ItTemEjMeObRV1QQ== X-IronPort-AV: E=Sophos;i="6.07,205,1708358400"; d="scan'208";a="14322618" 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; 16 Apr 2024 18:32:15 +0800 IronPort-SDR: h/8Nb5esDIuOoE8pg4cv3RubntOeot2TuSmpIYW9juP2jieFYEZRWhrkjinlakvY5DBIv+HKUw 8Un7HM15gT+tZ5VWqeAxRuzLvMA+kg7psNYGRTlJY5ILkmzEIVRXIEEZ4XH9UTFaoQpEusNIHu iaCGWltBIMqwVWz4vkhFlq8auU3b2v4hWC1VzYKjyWLF1TPxPYiV5NveOCWH5ulhf4iR7ahne9 bsHFEoYfvzt7pJylajfOVcmDk35VLHkdmLgwnHGPab5V1GgYh4H+XxBSEn+43tTCM6Qm8ujdrn Pz0= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 16 Apr 2024 02:40:35 -0700 IronPort-SDR: gdDVjzw5yeREpsJsPl6S4V0Vd7JglNw+93JGKMAg6SjK8W7fbPpuTnhIFLlZSCpYEDThY/x1tY Jw5Lff2+HtTmmK75DlYezQGRLhpoDmdVBRK5KOevrLuO8EIH2BMhUUy4CvdpBC2jlbP+LomfAc 4GjKFbA58P9XjyxFAbQRnAogXsxA3vzv9jhP2lQG7rdJwxi+/LEVFH21ydb1l/lxJH8L7a6/6p 3ogW5YKOGiELbtw7ICuzMG8Q/7VS0KZPhtdYAfmK3OD7+bMZh8SF5F5GFvv2Jnv+f4ltf9ZT2v cZE= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 16 Apr 2024 03:32:14 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests v2 07/11] nvme/rc: introduce NVMET_BLKDEV_TYPES Date: Tue, 16 Apr 2024 19:32:03 +0900 Message-ID: <20240416103207.2754778-8-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> References: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Some of the test cases in nvme test group do the exact same test for two blkdev types: device type and file type. Except for this difference, the test cases are pure duplication. It is desired to avoid the duplication. When the duplication is avoided, it is required to control which condition to run the test.      To avoid the duplication and also to allow the blkdev type control, introduce a new configuration parameter NVMET_BLKDEV_TYPES. This parameter specifies which blkdev type to setup for the tests. It can take one of the blkdev types. Or it can take both types, which is the default. When both types are specified, the test cases are repeated twice to cover the types.      Also add the helper function _set_nvme_trtype_and_nvmet_blkdev_type(). It sets up nvmet_blkdev_type variable for each test case run from NVMET_BLKDEV_TYPES. It also sets nvme_trtype from NVMET_TRTYPES. When NVMET_BLKDEV_TYPES and NVMET_TRTYPES are set as follows, the test case with _set_nvme_trtype_and_nvmet_blkdev_type in set_condition() hook is called 2 x 3 = 6 times. NVMET_BLKDEV_TYPES="device file" NVMET_TRTYPES="loop rdma tcp" Signed-off-by: Shin'ichiro Kawasaki --- Documentation/running-tests.md | 5 +++++ tests/nvme/rc | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/Documentation/running-tests.md b/Documentation/running-tests.md index 144acd1..6d2f8ae 100644 --- a/Documentation/running-tests.md +++ b/Documentation/running-tests.md @@ -109,6 +109,11 @@ The NVMe tests can be additionally parameterized via environment variables. - nvme_trtype: 'loop' (default), 'tcp', 'rdma' and 'fc' Run the tests with the given transport. This parameter is still usable but replaced with NVMET_TRTYPES. Use NVMET_TRTYPES instead. +- 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 d44a1c1..f678128 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -21,6 +21,7 @@ export def_subsys_uuid="91fdba0d-f87b-4c25-b80f-db7be1418b9e" nvme_img_size=${nvme_img_size:-"1G"} nvme_num_iter=${nvme_num_iter:-"1000"} nvmet_blkdev_type=${nvmet_blkdev_type:-"device"} +NVMET_BLKDEV_TYPES=${NVMET_BLKDEV_TYPES:-"device file"} # Check consistency of NVMET_TRTYPES and nvme_trtype configurations. # If neither is configured, set the default value. @@ -54,6 +55,27 @@ _set_nvme_trtype() { COND_DESC="nvmet tr=${nvme_trtype}" } +_set_nvme_trtype_and_nvmet_blkdev_type() { + local index=$1 + local bd_index tr_index + local -a blkdev_types + local -a trtypes + + read -r -a blkdev_types <<< "$NVMET_BLKDEV_TYPES" + read -r -a trtypes <<< "$NVMET_TRTYPES" + + if [[ -z $index ]]; then + echo $(( ${#trtypes[@]} * ${#blkdev_types[@]} )) + return + fi + + bd_index=$((index / ${#trtypes[@]})) + tr_index=$((index % ${#trtypes[@]})) + nvmet_blkdev_type=${blkdev_types[bd_index]} + nvme_trtype=${trtypes[tr_index]} + COND_DESC="nvmet bd=${nvmet_blkdev_type} tr=${nvme_trtype}" +} + # TMPDIR can not be referred out of test() or test_device() context. Instead of # global variable def_flie_path, use this getter function. _nvme_def_file_path() { From patchwork Tue Apr 16 10:32:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13631671 Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) (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 87CD67E785 for ; Tue, 16 Apr 2024 10:32:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.141.245 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263540; cv=none; b=RxmZczJWuma9lXY8DgySBRCz4D7rhfnvV7SSi9UJn2CDyqlr3L8xIgWfdWLYDzEtAcmdjludVygJn/mVRiCeMDGB5JQNY9Aq3CEa5EL5eY0kwa7H/gl2KFJZoyDvovstXXR6sKW4NgY0o4QSJxu3Tld2NUV5q6COkcJVAyX3eiA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263540; c=relaxed/simple; bh=3DXVTwlDhnXXpoB5Mea5D01bfoG7Mlp5mindfoz4meE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KSPYgHHjnuTSExnaqLFzbpTFqmD41YTKIUyGFfWYp4pPp2aGzE9XNHDBoRbSaZEcpwJzB/DCXJHBHmNbHaRCazUlFP9N1liBvogpiv+dhyd/g7HHVWmrcNSkYdbawTQI+TBlL3TxX8PZoEuTYyKJdOu/JszN0kGgGsqs8Tlf/h4= 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=NZEaH6rp; arc=none smtp.client-ip=68.232.141.245 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="NZEaH6rp" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713263538; x=1744799538; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3DXVTwlDhnXXpoB5Mea5D01bfoG7Mlp5mindfoz4meE=; b=NZEaH6rpCQV8Pa6yCtPZb24koc45/79J/E0pH/qiAPkk5UBbkXw5s+90 8jqna+systzcrFw/uUsKX69JX+XN7GR1Ii9gJCbik/sKVRFNG1B/l6DIZ 1DCJpsj50aMoNyrTO40nGoSEjZrHGfP1v9ZRwJg5swa/Pi1YW3BOEauvN snABjxe7l1MJE8ehWLz0P0Y+c1mK5PXl1BevX68Y+wrZ9mRm7/gNe4UrJ rHrHImOHiQyXr99CKqO5RhNNXcJ53X9w6OrCOHr/l+w5licHqF0kSWwCe HE3LawFR1XYPbcpkhY5CqcJsjh801FKyQexeb7pctPsHa3g1Qr67dvPTi Q==; X-CSE-ConnectionGUID: Wu2EyYZlRXuEKOFJ2gbSnw== X-CSE-MsgGUID: /sBtP63OSBGrLMbiCKCnFA== X-IronPort-AV: E=Sophos;i="6.07,205,1708358400"; d="scan'208";a="14322627" 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; 16 Apr 2024 18:32:17 +0800 IronPort-SDR: uBSXwZ5twqRsBZeL3oiS85kNA9bJCJpCqM+utmFpAP5s3Xz2ike2fle9XNBb7BpbJV9GwFpMF7 KNyxKjg7S75yRBOC1oiD6mszOQOBBTz00gUbXoF2bUNMJGjNRLlLbm1lq1CHGtyVDFvK8ohcsS etaKv5zo1hjxSVJdBOS+SJyhcrtbwzO9KLmdQ/A8ddfMQFZYojp5tORE7VeBJWWBl5bxMRcXNf IzLvCIYHBtG5GAipVd+DDspHDSoECdxlLpjSp5yqwYY3nqXedL7TbOd0tnPAWK4i9qWXSQMKVW JNY= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 16 Apr 2024 02:40:37 -0700 IronPort-SDR: eAofvt7EZLH4+xXMD6uB1riEnH4+2VHVM628uHbo8a/3Q2oiRe1GQPoeBSJR6q4V5tmJdguYg0 jNzFbSV6aindpMcJTdEaeAv5YW1TrCIFBu0V41qqXaqw9M3VmA72dSiEzOwcxDMr3rc4Oytmo5 WGyyDuBxVA/3+x+i40cjWlXpL3xMicHHeSrPOf7u2r/AcuqKZUqSsS2glNQRRH8al0v+Z0FvCE Bmanao/QsMU7cpa3HRGD00nTEo7+Q6ltSoOWUc5ZWHq6/5wLY4K/s+0/rU/mtTBV4vsjwxKYRU GtY= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 16 Apr 2024 03:32:15 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests v2 08/11] nvme/{002-031,033-038,040-045,047,048}: support NMVET_TRTYPES Date: Tue, 16 Apr 2024 19:32:04 +0900 Message-ID: <20240416103207.2754778-9-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> References: <20240416103207.2754778-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. Signed-off-by: Shin'ichiro Kawasaki --- tests/nvme/002 | 4 ++++ tests/nvme/003 | 4 ++++ tests/nvme/004 | 4 ++++ tests/nvme/005 | 4 ++++ tests/nvme/006 | 4 ++++ tests/nvme/007 | 4 ++++ tests/nvme/008 | 4 ++++ tests/nvme/009 | 4 ++++ tests/nvme/010 | 4 ++++ tests/nvme/011 | 4 ++++ tests/nvme/012 | 4 ++++ tests/nvme/013 | 4 ++++ tests/nvme/014 | 4 ++++ tests/nvme/015 | 4 ++++ tests/nvme/016 | 4 ++++ tests/nvme/017 | 4 ++++ tests/nvme/018 | 4 ++++ tests/nvme/019 | 4 ++++ tests/nvme/020 | 4 ++++ tests/nvme/021 | 4 ++++ tests/nvme/022 | 4 ++++ tests/nvme/023 | 4 ++++ tests/nvme/024 | 4 ++++ tests/nvme/025 | 4 ++++ tests/nvme/026 | 4 ++++ tests/nvme/027 | 4 ++++ tests/nvme/028 | 4 ++++ tests/nvme/029 | 4 ++++ tests/nvme/030 | 4 ++++ tests/nvme/031 | 4 ++++ tests/nvme/033 | 4 ++++ tests/nvme/034 | 4 ++++ tests/nvme/035 | 4 ++++ tests/nvme/036 | 4 ++++ tests/nvme/037 | 4 ++++ tests/nvme/038 | 4 ++++ tests/nvme/040 | 4 ++++ tests/nvme/041 | 3 +++ tests/nvme/042 | 3 +++ tests/nvme/043 | 3 +++ tests/nvme/044 | 3 +++ tests/nvme/045 | 3 +++ tests/nvme/047 | 4 ++++ tests/nvme/048 | 4 ++++ 44 files changed, 171 insertions(+) diff --git a/tests/nvme/002 b/tests/nvme/002 index 6b84848..f613c78 100755 --- a/tests/nvme/002 +++ b/tests/nvme/002 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_loop } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/003 b/tests/nvme/003 index be6b4e1..b70f46a 100755 --- a/tests/nvme/003 +++ b/tests/nvme/003 @@ -17,6 +17,10 @@ requires() { _have_writeable_kmsg } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/004 b/tests/nvme/004 index b751746..a6b4949 100755 --- a/tests/nvme/004 +++ b/tests/nvme/004 @@ -17,6 +17,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/005 b/tests/nvme/005 index f17174d..66c12fd 100755 --- a/tests/nvme/005 +++ b/tests/nvme/005 @@ -16,6 +16,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/006 b/tests/nvme/006 index d85f64b..a0c4096 100755 --- a/tests/nvme/006 +++ b/tests/nvme/006 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/007 b/tests/nvme/007 index b142435..3b16d5f 100755 --- a/tests/nvme/007 +++ b/tests/nvme/007 @@ -14,6 +14,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/008 b/tests/nvme/008 index a5d0681..1877d8a 100755 --- a/tests/nvme/008 +++ b/tests/nvme/008 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/009 b/tests/nvme/009 index a1655d4..d7b1307 100755 --- a/tests/nvme/009 +++ b/tests/nvme/009 @@ -14,6 +14,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/010 b/tests/nvme/010 index 6feb391..34914a7 100755 --- a/tests/nvme/010 +++ b/tests/nvme/010 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/011 b/tests/nvme/011 index 4810459..bd29129 100755 --- a/tests/nvme/011 +++ b/tests/nvme/011 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/012 b/tests/nvme/012 index 64cb6ec..e06bf8d 100755 --- a/tests/nvme/012 +++ b/tests/nvme/012 @@ -19,6 +19,10 @@ requires() { _require_nvme_test_img_size 350m } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/013 b/tests/nvme/013 index 24fc910..91da498 100755 --- a/tests/nvme/013 +++ b/tests/nvme/013 @@ -18,6 +18,10 @@ requires() { _require_nvme_test_img_size 350m } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/014 b/tests/nvme/014 index 839b91f..ff0ebfb 100755 --- a/tests/nvme/014 +++ b/tests/nvme/014 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/015 b/tests/nvme/015 index f0621da..b5ec10c 100755 --- a/tests/nvme/015 +++ b/tests/nvme/015 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/016 b/tests/nvme/016 index 908abbd..a65cffd 100755 --- a/tests/nvme/016 +++ b/tests/nvme/016 @@ -13,6 +13,10 @@ requires() { _require_nvme_trtype_is_loop } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/017 b/tests/nvme/017 index c8d9b32..9410cdc 100755 --- a/tests/nvme/017 +++ b/tests/nvme/017 @@ -13,6 +13,10 @@ requires() { _require_nvme_trtype_is_loop } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/018 b/tests/nvme/018 index b8c1635..5b0f57b 100755 --- a/tests/nvme/018 +++ b/tests/nvme/018 @@ -16,6 +16,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/019 b/tests/nvme/019 index 1cd5378..31020d9 100755 --- a/tests/nvme/019 +++ b/tests/nvme/019 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/020 b/tests/nvme/020 index 0364c4e..4993e36 100755 --- a/tests/nvme/020 +++ b/tests/nvme/020 @@ -14,6 +14,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/021 b/tests/nvme/021 index 7ee1f07..270d90e 100755 --- a/tests/nvme/021 +++ b/tests/nvme/021 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/022 b/tests/nvme/022 index 7ce33dd..adaa765 100755 --- a/tests/nvme/022 +++ b/tests/nvme/022 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/023 b/tests/nvme/023 index d8f17ae..da99406 100755 --- a/tests/nvme/023 +++ b/tests/nvme/023 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/024 b/tests/nvme/024 index a512194..cab1818 100755 --- a/tests/nvme/024 +++ b/tests/nvme/024 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/025 b/tests/nvme/025 index 3f9a615..224492b 100755 --- a/tests/nvme/025 +++ b/tests/nvme/025 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/026 b/tests/nvme/026 index 28fd151..6ee6a51 100755 --- a/tests/nvme/026 +++ b/tests/nvme/026 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/027 b/tests/nvme/027 index 053fd58..a63e42b 100755 --- a/tests/nvme/027 +++ b/tests/nvme/027 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/028 b/tests/nvme/028 index 9f4a905..65c52a9 100755 --- a/tests/nvme/028 +++ b/tests/nvme/028 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/029 b/tests/nvme/029 index 559c0b4..10acc58 100755 --- a/tests/nvme/029 +++ b/tests/nvme/029 @@ -16,6 +16,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test_user_io() { local disk="$1" diff --git a/tests/nvme/030 b/tests/nvme/030 index 9251e17..b1ed8bc 100755 --- a/tests/nvme/030 +++ b/tests/nvme/030 @@ -15,6 +15,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/031 b/tests/nvme/031 index 0bf823d..b98630a 100755 --- a/tests/nvme/031 +++ b/tests/nvme/031 @@ -23,6 +23,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/033 b/tests/nvme/033 index 70a73b8..7a69b94 100755 --- a/tests/nvme/033 +++ b/tests/nvme/033 @@ -13,6 +13,10 @@ requires() { _have_kernel_option NVME_TARGET_PASSTHRU } +set_conditions() { + _set_nvme_trtype "$@" +} + nvme_info() { local ns=$1 diff --git a/tests/nvme/034 b/tests/nvme/034 index 409324a..522ffe3 100755 --- a/tests/nvme/034 +++ b/tests/nvme/034 @@ -14,6 +14,10 @@ requires() { _have_fio } +set_conditions() { + _set_nvme_trtype "$@" +} + test_device() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/035 b/tests/nvme/035 index ecf6b72..cfca5fd 100755 --- a/tests/nvme/035 +++ b/tests/nvme/035 @@ -20,6 +20,10 @@ device_requires() { _require_test_dev_size "${nvme_img_size}" } +set_conditions() { + _set_nvme_trtype "$@" +} + test_device() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/036 b/tests/nvme/036 index 36ea792..ef6c29d 100755 --- a/tests/nvme/036 +++ b/tests/nvme/036 @@ -13,6 +13,10 @@ requires() { _have_kernel_option NVME_TARGET_PASSTHRU } +set_conditions() { + _set_nvme_trtype "$@" +} + test_device() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/037 b/tests/nvme/037 index 66d6656..ef7ac59 100755 --- a/tests/nvme/037 +++ b/tests/nvme/037 @@ -12,6 +12,10 @@ requires() { _have_kernel_option NVME_TARGET_PASSTHRU } +set_conditions() { + _set_nvme_trtype "$@" +} + test_device() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/038 b/tests/nvme/038 index 007b5f4..8435415 100755 --- a/tests/nvme/038 +++ b/tests/nvme/038 @@ -18,6 +18,10 @@ requires() { _nvme_requires } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/040 b/tests/nvme/040 index bb9ed5e..9536f35 100755 --- a/tests/nvme/040 +++ b/tests/nvme/040 @@ -16,6 +16,10 @@ requires() { _require_nvme_trtype_is_fabrics } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/041 b/tests/nvme/041 index f1fa00c..aa44f04 100755 --- a/tests/nvme/041 +++ b/tests/nvme/041 @@ -19,6 +19,9 @@ requires() { _require_nvme_cli_auth } +set_conditions() { + _set_nvme_trtype "$@" +} test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/042 b/tests/nvme/042 index a9e79c6..70c9056 100755 --- a/tests/nvme/042 +++ b/tests/nvme/042 @@ -19,6 +19,9 @@ requires() { _require_nvme_cli_auth } +set_conditions() { + _set_nvme_trtype "$@" +} test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/043 b/tests/nvme/043 index 4589423..cf99865 100755 --- a/tests/nvme/043 +++ b/tests/nvme/043 @@ -20,6 +20,9 @@ requires() { _have_driver dh_generic } +set_conditions() { + _set_nvme_trtype "$@" +} test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/044 b/tests/nvme/044 index 8b88590..9ed46c9 100755 --- a/tests/nvme/044 +++ b/tests/nvme/044 @@ -20,6 +20,9 @@ requires() { _have_driver dh_generic } +set_conditions() { + _set_nvme_trtype "$@" +} test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/045 b/tests/nvme/045 index f387ead..be81316 100755 --- a/tests/nvme/045 +++ b/tests/nvme/045 @@ -21,6 +21,9 @@ requires() { _have_driver dh_generic } +set_conditions() { + _set_nvme_trtype "$@" +} test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/047 b/tests/nvme/047 index 9bbe84d..1ab68f8 100755 --- a/tests/nvme/047 +++ b/tests/nvme/047 @@ -17,6 +17,10 @@ requires() { _have_kver 4 21 } +set_conditions() { + _set_nvme_trtype "$@" +} + test() { echo "Running ${TEST_NAME}" diff --git a/tests/nvme/048 b/tests/nvme/048 index 0b299a9..bd41fae 100755 --- a/tests/nvme/048 +++ b/tests/nvme/048 @@ -15,6 +15,10 @@ requires() { _require_min_cpus 2 } +set_conditions() { + _set_nvme_trtype "$@" +} + nvmf_wait_for_state() { local def_state_timeout=5 local subsys_name="$1" From patchwork Tue Apr 16 10:32:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13631670 Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) (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 997573D38E for ; Tue, 16 Apr 2024 10:32:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.141.245 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263539; cv=none; b=qT1i9b9clbc0UkNXLsI05d7/AWlt0m8Ms2jjS5tloYAE0TSDP0dz0jP0lKyLzL87QLTUonjGnlNqKLBF3b+N3Wuf50ZoOijp8wis8POZxesHCMWRBXEtxecAMUtzyzrps+KKVbGoSIu+YiqkK9TZlf20CAjmrhRw71mdrxeQspA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263539; c=relaxed/simple; bh=wKrzhkD2vg/WvRStbcCDepGHYo8qCYqridvUcZHyY20=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QxhtHbVUvuhBIEQaKVW2dXbvNriTGXWbjhNGfMzH2W9ozNGZHkchQvoBc9O9mBE+SxXIPVKlp8SvZcx/HBqmsgBx/u/TYBV8SUSEcszHcghEjjxwnlxPao1vERl4uAAptlnyiWIAQC5MDy84pkNkUIU/O29TnVyPjrLRuvMgWyQ= 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=qZt+LTXh; arc=none smtp.client-ip=68.232.141.245 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="qZt+LTXh" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713263537; x=1744799537; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wKrzhkD2vg/WvRStbcCDepGHYo8qCYqridvUcZHyY20=; b=qZt+LTXhoed1mm5QaItyoi6qrOtVfMINcNBN9QWwc3AGCXRUbZA8sI37 Qzsj8y0RIFfktF0opod7YvRD62anTI4PzN7t9j5m6NHNkLnCFjfo1DDMh mahDNrl1SmaCOpmonBRSveLL8BAIYJfGGVYrC5wEyupK78E4kPd7808vt 9dmdCiNIaKeq0bVz1ufqp3jwFxRrVIuDq6x/3TA5OzlktITJn5ctA+wMe rUBeFGj6oU9cklmHDPI6gK5TCGi0JlTXfowwcG6V2KArRir2Lyqv5F5px niNnPUQ/xniF8wKGq5x9qlUhHb/8ZiAxBNuV+NFmAS1qImBiot1EHM5/+ g==; X-CSE-ConnectionGUID: BaTuNwykSPSx42lqrtsOPg== X-CSE-MsgGUID: wFkJbbJuT9y6IcbEZSjR/A== X-IronPort-AV: E=Sophos;i="6.07,205,1708358400"; d="scan'208";a="14322625" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 16 Apr 2024 18:32:17 +0800 IronPort-SDR: 7vO60s5qHzLVQN/2T/oTxEednf1A7z8WKguG4xX6NR84f25bxYlFbdkX8PZj4hQjMaXUVQorm0 p/wdIFb7O16Q== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 16 Apr 2024 02:34:56 -0700 IronPort-SDR: OCYt+4IGiSmW3wki+5ltkt26okeUcFju6kRV0lM8/gun52l2xgB/5S0VtpWoq84xfNS1zYnHn3 fwvvXV7mFrzGwr9qi/vJX62Rgk8ZgcDaB/H+/F9Q3KhjPhb4M9Z5BC0ekm6sjNOzwyQx2BHO6A n2/3O5y7BvZoBGOCz5wyE1rOFyG6uhvEPea+1d8MmNu6aeWqN4J9vYTfGUdTnzoj6gs6HahRKu PDWKryHhNyvMeij4W0LynrXUobiLl9OfJ20wzxuLkTN/q2WTuXouhdGSE1dWgNAwjVE0VygclC Ats= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 16 Apr 2024 03:32:16 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests v2 09/11] nvme/{006,008,010,012,014,019,023}: support NVMET_BLKDEV_TYPES Date: Tue, 16 Apr 2024 19:32:05 +0900 Message-ID: <20240416103207.2754778-10-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> References: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Enable repeated test runs for the listed test cases for NVMET_BLKDEV_TYPES. Modify the set_conditions() hooks to call _set_nvme_trtype_and_nvmet_blkdev_type() instead of _set_nvmet_trtype() so that the test cases are repeated for listed conditions in NVMET_BLKDEV_TYPES and NVMET_TRTYPES. The default values of NVMET_BLKDEV_TYPES is (device file). With this default set up, each of the listed test cases are run twice. The second runs of the test cases for 'file' blkdev type do exact same test as other test cases nvme/007, 009, 011, 013, 015, 020 and 024. Signed-off-by: Shin'ichiro Kawasaki --- tests/nvme/006 | 2 +- tests/nvme/008 | 2 +- tests/nvme/010 | 2 +- tests/nvme/012 | 2 +- tests/nvme/014 | 2 +- tests/nvme/019 | 2 +- tests/nvme/023 | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/nvme/006 b/tests/nvme/006 index a0c4096..0e1f142 100755 --- a/tests/nvme/006 +++ b/tests/nvme/006 @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { diff --git a/tests/nvme/008 b/tests/nvme/008 index 1877d8a..b53ecdb 100755 --- a/tests/nvme/008 +++ b/tests/nvme/008 @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { diff --git a/tests/nvme/010 b/tests/nvme/010 index 34914a7..0417daf 100755 --- a/tests/nvme/010 +++ b/tests/nvme/010 @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { diff --git a/tests/nvme/012 b/tests/nvme/012 index e06bf8d..37b9056 100755 --- a/tests/nvme/012 +++ b/tests/nvme/012 @@ -20,7 +20,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { diff --git a/tests/nvme/014 b/tests/nvme/014 index ff0ebfb..bcfbc87 100755 --- a/tests/nvme/014 +++ b/tests/nvme/014 @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { diff --git a/tests/nvme/019 b/tests/nvme/019 index 31020d9..fb11d41 100755 --- a/tests/nvme/019 +++ b/tests/nvme/019 @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { diff --git a/tests/nvme/023 b/tests/nvme/023 index da99406..a723b73 100755 --- a/tests/nvme/023 +++ b/tests/nvme/023 @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { From patchwork Tue Apr 16 10:32:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13631672 Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) (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 3A1E1127E11 for ; Tue, 16 Apr 2024 10:32:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.141.245 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263541; cv=none; b=GuQHJtOQfL7sH2vnzjdnOgp4secHH1OkuaFtg01RdxXoPr+sdbuVDWBkNFdEo1lqqvOswx+v/O81YIHhBHDPXK+IRZUbPNaX33zs5v4PsppEaNF98+Bmn0Ev9TYSVPJBs1O4h27tF8+AoZFqqaxXqKhhi5mkRzruHHofZQ4htsw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263541; c=relaxed/simple; bh=HvJF2shEgndKaExsvjj2e8YuMaD5oXBayXp85FAgT6U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b8x5wU0o8AvMWqn3hRfLG5BcD1iU/1Y1i6Cwhc4Y/0K8tdxKcD64Htjtzyr6wvQqBuxyJN0AJDBVfycDIOpSK2M3RL0XIXVeRIDw/qaHrZlnfoBXE6p26uaTQSKdplYDvDvl4P2ZMjWtxzpwRW34jvCRbXH8O1p8InWbWk1MoEI= 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=ibmazu0y; arc=none smtp.client-ip=68.232.141.245 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="ibmazu0y" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713263538; x=1744799538; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HvJF2shEgndKaExsvjj2e8YuMaD5oXBayXp85FAgT6U=; b=ibmazu0y4fM5f6cE7kF0JXZLz62S7pO/e4f8jP43Jrngx08/dBvRB9Gh oj+i5BftWYN9ooECXKBDpLBWHacHK0P0g+GHB3JTCp3jH97lZvuaoFjxh t68CDPjIM9NQsCOa3xT94v4iObXO9kFMAYgJ/TNeYhKMxJB/x1MPUuumd Tv2LPjeLjwORl81HheqqQgrwZ7k9gc7UWPbx67i6yx/aRF3QWNUFfgs09 qmWd7w4hbC4snmWae5F8DMJWt+TBcirIJH/XAsNx/f4FZGy3xYcatW97S 85rr+KeRA69av5t7VgZKB1d02cirL7QzolI5Y3568wpefhrHCmGC1Vupk g==; X-CSE-ConnectionGUID: zGr3D409R9qPvkxaGNJeKQ== X-CSE-MsgGUID: GnFP5Qs7STSZPw2OagPLiA== X-IronPort-AV: E=Sophos;i="6.07,205,1708358400"; d="scan'208";a="14322629" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 16 Apr 2024 18:32:18 +0800 IronPort-SDR: ZLNSqlFz2KId5UsASeltoPGGFTEsynoFr2T7mozMYzlHgsEBxp9G34WYd9c0/IPUkL9Ho2fKkt yB85QdpwReXg== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 16 Apr 2024 02:34:57 -0700 IronPort-SDR: D0jN0SHQiXANwlRbbvdLzGBwQT40Qie4ItnrCPBJ1avBsYhg/uFh7AdeRDGM9JwtsS1MhunVqD vdSB3CLYkZDbB/4cgiDcQXzC0+G5/5plQxE2sMmAkRwrbSf8kxBcc27LoVyzyq5Hz213dKhUv1 LbJt0zXAUHRMFJUMinXMswEaSgzkZuZaW1Z+JTlSSTGExwDNVhQFIA4HJ5dztbVYMekmuRoqWE /ckLZMuZzbZr3IOnFXAaxHFP5H2XOnMblDzUkz8K7hy+oiJ02L5xQMGWROvdkPu/shPwIXPZV9 3PQ= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 16 Apr 2024 03:32:17 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests v2 10/11] nvme/{007,009,011,013,015,020,024}: drop duplicate nvmet blkdev type tests Date: Tue, 16 Apr 2024 19:32:06 +0900 Message-ID: <20240416103207.2754778-11-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> References: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Daniel Wagner There are various tests which only differ on the blkdev type of the target. With the newly added feature which allows to control the target blkdev type via the environment, these duplicate tests are not necessary anymore and reduces the maintenance overhead. The removed tests are covered by the other test cases nvme/006 ,008, 010, 012, 014, 019 and 023 using 'file' blkdev type. Signed-off-by: Daniel Wagner Signed-off-by: Shin'ichiro Kawasaki --- tests/nvme/006 | 5 ++--- tests/nvme/007 | 32 ---------------------------- tests/nvme/007.out | 2 -- tests/nvme/008 | 4 ++-- tests/nvme/009 | 40 ----------------------------------- tests/nvme/009.out | 3 --- tests/nvme/010 | 4 ++-- tests/nvme/011 | 43 -------------------------------------- tests/nvme/011.out | 3 --- tests/nvme/012 | 4 ++-- tests/nvme/013 | 47 ----------------------------------------- tests/nvme/013.out | 3 --- tests/nvme/014 | 4 ++-- tests/nvme/015 | 52 ---------------------------------------------- tests/nvme/015.out | 4 ---- tests/nvme/019 | 4 ++-- tests/nvme/020 | 44 --------------------------------------- tests/nvme/020.out | 4 ---- tests/nvme/023 | 4 ++-- tests/nvme/024 | 44 --------------------------------------- tests/nvme/024.out | 2 -- 21 files changed, 14 insertions(+), 338 deletions(-) delete mode 100755 tests/nvme/007 delete mode 100644 tests/nvme/007.out delete mode 100755 tests/nvme/009 delete mode 100644 tests/nvme/009.out delete mode 100755 tests/nvme/011 delete mode 100644 tests/nvme/011.out delete mode 100755 tests/nvme/013 delete mode 100644 tests/nvme/013.out delete mode 100755 tests/nvme/015 delete mode 100644 tests/nvme/015.out delete mode 100755 tests/nvme/020 delete mode 100644 tests/nvme/020.out delete mode 100755 tests/nvme/024 delete mode 100644 tests/nvme/024.out diff --git a/tests/nvme/006 b/tests/nvme/006 index 0e1f142..0ea679b 100755 --- a/tests/nvme/006 +++ b/tests/nvme/006 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMeOF target creation with a block device backed ns. +# Test NVMeOF target creation. . tests/nvme/rc -DESCRIPTION="create an NVMeOF target with a block device-backed ns" +DESCRIPTION="create an NVMeOF target" QUICK=1 requires() { @@ -24,7 +24,6 @@ test() { _setup_nvmet - _nvmet_target_setup _nvmet_target_cleanup diff --git a/tests/nvme/007 b/tests/nvme/007 deleted file mode 100755 index 3b16d5f..0000000 --- a/tests/nvme/007 +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# Test NVMeOF target creation with a file backed ns. - -. tests/nvme/rc - -DESCRIPTION="create an NVMeOF target with a file-backed ns" -QUICK=1 - -requires() { - _nvme_requires - _require_nvme_trtype_is_fabrics -} - -set_conditions() { - _set_nvme_trtype "$@" -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - - _nvmet_target_setup --blkdev file - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/007.out b/tests/nvme/007.out deleted file mode 100644 index fdb3472..0000000 --- a/tests/nvme/007.out +++ /dev/null @@ -1,2 +0,0 @@ -Running nvme/007 -Test complete diff --git a/tests/nvme/008 b/tests/nvme/008 index b53ecdb..838eb07 100755 --- a/tests/nvme/008 +++ b/tests/nvme/008 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMeOF host creation with a block device backed ns. +# Test NVMeOF host creation. . tests/nvme/rc -DESCRIPTION="create an NVMeOF host with a block device-backed ns" +DESCRIPTION="create an NVMeOF host" QUICK=1 requires() { diff --git a/tests/nvme/009 b/tests/nvme/009 deleted file mode 100755 index d7b1307..0000000 --- a/tests/nvme/009 +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# Test NVMeOF host creation with a file backed ns. - -. tests/nvme/rc - -DESCRIPTION="create an NVMeOF host with a file-backed ns" -QUICK=1 - -requires() { - _nvme_requires - _require_nvme_trtype_is_fabrics -} - -set_conditions() { - _set_nvme_trtype "$@" -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - local nvmedev - - _nvmet_target_setup --blkdev file - - _nvme_connect_subsys - - nvmedev=$(_find_nvme_dev "${def_subsysnqn}") - _check_uuid "${nvmedev}" - - _nvme_disconnect_subsys - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/009.out b/tests/nvme/009.out deleted file mode 100644 index 4d53a8e..0000000 --- a/tests/nvme/009.out +++ /dev/null @@ -1,3 +0,0 @@ -Running nvme/009 -disconnected 1 controller(s) -Test complete diff --git a/tests/nvme/010 b/tests/nvme/010 index 0417daf..9ea2561 100755 --- a/tests/nvme/010 +++ b/tests/nvme/010 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# This is a data verification test for block device backed ns. +# This is a data verification test. . tests/nvme/rc -DESCRIPTION="run data verification fio job on NVMeOF block device-backed ns" +DESCRIPTION="run data verification fio job" TIMED=1 requires() { diff --git a/tests/nvme/011 b/tests/nvme/011 deleted file mode 100755 index bd29129..0000000 --- a/tests/nvme/011 +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# This is a data verification test for file backed ns. - -. tests/nvme/rc - -DESCRIPTION="run data verification fio job on NVMeOF file-backed ns" -TIMED=1 - -requires() { - _nvme_requires - _have_fio - _require_nvme_trtype_is_fabrics -} - -set_conditions() { - _set_nvme_trtype "$@" -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - local ns - - _nvmet_target_setup --blkdev file - - _nvme_connect_subsys - - ns=$(_find_nvme_ns "${def_subsys_uuid}") - - _run_fio_verify_io --size="${nvme_img_size}" \ - --filename="/dev/${ns}" - - _nvme_disconnect_subsys - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/011.out b/tests/nvme/011.out deleted file mode 100644 index ebbb4f7..0000000 --- a/tests/nvme/011.out +++ /dev/null @@ -1,3 +0,0 @@ -Running nvme/011 -disconnected 1 controller(s) -Test complete diff --git a/tests/nvme/012 b/tests/nvme/012 index 37b9056..d0eb487 100755 --- a/tests/nvme/012 +++ b/tests/nvme/012 @@ -2,12 +2,12 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test mkfs with data verification for block device backed ns. +# Test mkfs with data verification. . tests/nvme/rc . common/xfs -DESCRIPTION="run mkfs and data verification fio job on NVMeOF block device-backed ns" +DESCRIPTION="run mkfs and data verification fio" TIMED=1 requires() { diff --git a/tests/nvme/013 b/tests/nvme/013 deleted file mode 100755 index 91da498..0000000 --- a/tests/nvme/013 +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# Test mkfs with data verification for file backed ns. - -. tests/nvme/rc -. common/xfs - -DESCRIPTION="run mkfs and data verification fio job on NVMeOF file-backed ns" -TIMED=1 - -requires() { - _nvme_requires - _have_xfs - _have_fio - _require_nvme_trtype_is_fabrics - _require_nvme_test_img_size 350m -} - -set_conditions() { - _set_nvme_trtype "$@" -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - local ns - - _nvmet_target_setup --blkdev file - - _nvme_connect_subsys - - ns=$(_find_nvme_ns "${def_subsys_uuid}") - - if ! _xfs_run_fio_verify_io "/dev/${ns}"; then - echo "FAIL: fio verify failed" - fi - - _nvme_disconnect_subsys - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/013.out b/tests/nvme/013.out deleted file mode 100644 index a727170..0000000 --- a/tests/nvme/013.out +++ /dev/null @@ -1,3 +0,0 @@ -Running nvme/013 -disconnected 1 controller(s) -Test complete diff --git a/tests/nvme/014 b/tests/nvme/014 index bcfbc87..1429180 100755 --- a/tests/nvme/014 +++ b/tests/nvme/014 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMeOF flush command from host with a block device backed ns. +# Test NVMeOF flush command from host. . tests/nvme/rc -DESCRIPTION="flush a NVMeOF block device-backed ns" +DESCRIPTION="flush a command from host" QUICK=1 requires() { diff --git a/tests/nvme/015 b/tests/nvme/015 deleted file mode 100755 index b5ec10c..0000000 --- a/tests/nvme/015 +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# Test NVMeOF flush command from host with a file backed ns. - -. tests/nvme/rc - -DESCRIPTION="unit test for NVMe flush for file backed ns" -QUICK=1 - -requires() { - _nvme_requires - _have_loop - _require_nvme_trtype_is_fabrics -} - -set_conditions() { - _set_nvme_trtype "$@" -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - local ns - local size - local bs - local count - - _nvmet_target_setup --blkdev file - - _nvme_connect_subsys - - ns=$(_find_nvme_ns "${def_subsys_uuid}") - - size="$(blockdev --getsize64 "/dev/${ns}")" - bs="$(blockdev --getbsz "/dev/${ns}")" - count=$((size / bs)) - - dd if=/dev/urandom of="/dev/${ns}" \ - count="${count}" bs="${bs}" status=none - - nvme flush "/dev/${ns}" - - _nvme_disconnect_subsys - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/015.out b/tests/nvme/015.out deleted file mode 100644 index f854f0b..0000000 --- a/tests/nvme/015.out +++ /dev/null @@ -1,4 +0,0 @@ -Running nvme/015 -NVMe Flush: success -disconnected 1 controller(s) -Test complete diff --git a/tests/nvme/019 b/tests/nvme/019 index fb11d41..d4cb926 100755 --- a/tests/nvme/019 +++ b/tests/nvme/019 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe DSM Discard command on NVMeOF with a block-device ns. +# Test NVMe DSM Discard command. . tests/nvme/rc -DESCRIPTION="test NVMe DSM Discard command on NVMeOF block-device ns" +DESCRIPTION="test NVMe DSM Discard command" QUICK=1 requires() { diff --git a/tests/nvme/020 b/tests/nvme/020 deleted file mode 100755 index 4993e36..0000000 --- a/tests/nvme/020 +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# Test NVMe DSM Discard command on NVMeOF with a file-backed ns. - -. tests/nvme/rc - -DESCRIPTION="test NVMe DSM Discard command on NVMeOF file-backed ns" -QUICK=1 - -requires() { - _nvme_requires - _require_nvme_trtype_is_fabrics -} - -set_conditions() { - _set_nvme_trtype "$@" -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - local ns - local nblk_range="10,10,10,10,10,10,10,10,10,10" - local sblk_range="100,200,300,400,500,600,700,800,900,1000" - - _nvmet_target_setup --blkdev file - - _nvme_connect_subsys - - ns=$(_find_nvme_ns "${def_subsys_uuid}") - - nvme dsm "/dev/${ns}" --ad \ - --slbs "${sblk_range}" --blocks "${nblk_range}" - - _nvme_disconnect_subsys - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/020.out b/tests/nvme/020.out deleted file mode 100644 index 61be280..0000000 --- a/tests/nvme/020.out +++ /dev/null @@ -1,4 +0,0 @@ -Running nvme/020 -NVMe DSM: success -disconnected 1 controller(s) -Test complete diff --git a/tests/nvme/023 b/tests/nvme/023 index a723b73..78dfb9e 100755 --- a/tests/nvme/023 +++ b/tests/nvme/023 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe smart-log command on NVMeOF with a block-device ns. +# Test NVMe smart-log command. . tests/nvme/rc -DESCRIPTION="test NVMe smart-log command on NVMeOF block-device ns" +DESCRIPTION="test NVMe smart-log command" QUICK=1 requires() { diff --git a/tests/nvme/024 b/tests/nvme/024 deleted file mode 100755 index cab1818..0000000 --- a/tests/nvme/024 +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0+ -# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. -# -# Test NVMe smart-log command on NVMeOF with a file-backed ns. - -. tests/nvme/rc - -DESCRIPTION="test NVMe smart-log command on NVMeOF file-backed ns" -QUICK=1 - -requires() { - _nvme_requires - _have_loop - _require_nvme_trtype_is_fabrics -} - -set_conditions() { - _set_nvme_trtype "$@" -} - -test() { - echo "Running ${TEST_NAME}" - - _setup_nvmet - - local ns - - _nvmet_target_setup --blkdev file - - _nvme_connect_subsys - - ns=$(_find_nvme_ns ${def_subsys_uuid}) - - if ! nvme smart-log "/dev/${ns}" >> "$FULL" 2>&1; then - echo "ERROR: smart-log file-ns failed" - fi - - _nvme_disconnect_subsys >> "$FULL" 2>&1 - - _nvmet_target_cleanup - - echo "Test complete" -} diff --git a/tests/nvme/024.out b/tests/nvme/024.out deleted file mode 100644 index 76c3e29..0000000 --- a/tests/nvme/024.out +++ /dev/null @@ -1,2 +0,0 @@ -Running nvme/024 -Test complete From patchwork Tue Apr 16 10:32:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 13631673 Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) (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 86BD6127E22 for ; Tue, 16 Apr 2024 10:32:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.141.245 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263542; cv=none; b=fDydrQIV6HGW66Vw+yQPn+TyUyZ7HVQVpmXLt+uW892lQWf4V60zcZ7Iu5OuNJFtYFtkvku7JVfA5GGDZr0gT46F5IjWiwKMq9IEpo98tsyVlyKFdbDoHlcUnS3HgXD93gRLTZUkMjM0RxrFKXEj50tSH8UaL0Xc5zoj7d5XCyU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713263542; c=relaxed/simple; bh=rzcMOsqH0Im5ddUaeNbwuyBxslay/s5Hc/qroNU+kX4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lY4luk/yeH7ImJXXmaQx23lQG6goG+Q3dVwzLy/HrOZsTB0b7Qv0wIZEkcxp9u9wrmM3UYPj8q2/bzrq/ArP74Nw80xz2lixdyybHVTn/Nn+B27qde7KhiEJNgD7GhYDBrpGPQraRH3o755OXi1I/iVKd6CVrRaKlfMBOit/C9Y= 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=QYugYia7; arc=none smtp.client-ip=68.232.141.245 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="QYugYia7" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1713263540; x=1744799540; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rzcMOsqH0Im5ddUaeNbwuyBxslay/s5Hc/qroNU+kX4=; b=QYugYia7MX9rCFvaEM0SJYp8gkSFMTLBo5oZM7CgmmLpCvPKaMHzMkei IKzRN/W3SwmMfTfy1nFu8JJl/5jDKqUHrJaZpOQyaSY4uuKBrNrDLAErv IacLLXQoV6HfxRNszbo5AXua0P7EJzWscWNeRIpFPxRiQFYBpsXjEv9cN jJGNCF8gVzk+/yq4R6Mi2vfYbliUG87BA/huGDVuvLEdvKnhXJimRwGiS LxbWAEnjcCHFa97ZNkKdy7sazPmtj//Gd2ZRQLeAivimx0BcohRYw+XHG sQxjuNTSYfnk5z0ra758hVy5LfmW0Ufsw7UT8dGrqsNR+wEP3aODoIYok g==; X-CSE-ConnectionGUID: XGG4F78cQuWpXtXvdbpVOQ== X-CSE-MsgGUID: 3eB1ZaY5SgGP/0LFXp/3jw== X-IronPort-AV: E=Sophos;i="6.07,205,1708358400"; d="scan'208";a="14322635" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 16 Apr 2024 18:32:18 +0800 IronPort-SDR: EjMlA7E1UUWnNpSaVti0y4oSp4+E2l5epDDp5m+hPFG4GhVScAQlEa9lB3APLxMvCOz0EI3AD9 /n/aQJKC7+5A== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 16 Apr 2024 02:34:57 -0700 IronPort-SDR: naS9laMhEXCRkmL04inqCaO0MmpHVpGjt3Ob22a+DlTIf9Jh20h0qiTBl8GSxG+YH691BANjHq q0raRdx+6fsmhISbYfhA5XzSHM1LF2hoD8k1FaQimE+CDktr9hktJ5HqN+9FbOEYXdrI31Ax7Q KeSf7wFZhzag6LgUSQGNJY/BxcCvRxXJ6TN5Z9EDw8zcLoIjLuLHhvZYR3muyL1gfLXqXZjhqk nrhiAKotgTuNg/+hLZNFwIcUZ/XQGnW9S/L5iLY6FypVVYPm2IaS+my+23hX319Wm7tX6eucua yMQ= WDCIronportException: Internal Received: from unknown (HELO shindev.ssa.fujisawa.hgst.com) ([10.149.66.30]) by uls-op-cesaip02.wdc.com with ESMTP; 16 Apr 2024 03:32:18 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Chaitanya Kulkarni Subject: [PATCH blktests v2 11/11] nvme/{021,022,025,026,027,028}: do not hard code target blkdev type Date: Tue, 16 Apr 2024 19:32:07 +0900 Message-ID: <20240416103207.2754778-12-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> References: <20240416103207.2754778-1-shinichiro.kawasaki@wdc.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Daniel Wagner There is no need to hardcode the target blkdev type. This allows the user to select different blkdev types via the nvmet_blkdev_type environment variable. Also modify set_conditions() hooks to call _set_nvme_trtype_and_nvmet_blkdev_type() instead of _set_nvme_trtype(), so that the test cases are run for all blkdev types set in NVMET_BLKDEV_TYPES. Signed-off-by: Daniel Wagner [Shin'ichiro: modify set_conditions()] Signed-off-by: Shin'ichiro Kawasaki --- tests/nvme/021 | 8 ++++---- tests/nvme/022 | 8 ++++---- tests/nvme/025 | 8 ++++---- tests/nvme/026 | 8 ++++---- tests/nvme/027 | 8 ++++---- tests/nvme/028 | 8 ++++---- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/tests/nvme/021 b/tests/nvme/021 index 270d90e..d7add6f 100755 --- a/tests/nvme/021 +++ b/tests/nvme/021 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe list command on NVMeOF with a file-backed ns. +# Test NVMe list command. . tests/nvme/rc -DESCRIPTION="test NVMe list command on NVMeOF file-backed ns" +DESCRIPTION="test NVMe list command" QUICK=1 requires() { @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { @@ -26,7 +26,7 @@ test() { local ns - _nvmet_target_setup --blkdev file + _nvmet_target_setup _nvme_connect_subsys diff --git a/tests/nvme/022 b/tests/nvme/022 index adaa765..0f2868c 100755 --- a/tests/nvme/022 +++ b/tests/nvme/022 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe reset command on NVMeOF with a file-backed ns. +# Test NVMe reset command. . tests/nvme/rc -DESCRIPTION="test NVMe reset command on NVMeOF file-backed ns" +DESCRIPTION="test NVMe reset command" QUICK=1 requires() { @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { @@ -26,7 +26,7 @@ test() { local nvmedev - _nvmet_target_setup --blkdev file + _nvmet_target_setup _nvme_connect_subsys diff --git a/tests/nvme/025 b/tests/nvme/025 index 224492b..a171099 100755 --- a/tests/nvme/025 +++ b/tests/nvme/025 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe effects-log command on NVMeOF with a file-backed ns. +# Test NVMe effects-log command. . tests/nvme/rc -DESCRIPTION="test NVMe effects-log command on NVMeOF file-backed ns" +DESCRIPTION="test NVMe effects-log" QUICK=1 requires() { @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { @@ -26,7 +26,7 @@ test() { local ns - _nvmet_target_setup --blkdev file + _nvmet_target_setup _nvme_connect_subsys diff --git a/tests/nvme/026 b/tests/nvme/026 index 6ee6a51..7196c60 100755 --- a/tests/nvme/026 +++ b/tests/nvme/026 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe ns-descs command on NVMeOF with a file-backed ns. +# Test NVMe ns-descs command. . tests/nvme/rc -DESCRIPTION="test NVMe ns-descs command on NVMeOF file-backed ns" +DESCRIPTION="test NVMe ns-descs" QUICK=1 requires() { @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { @@ -26,7 +26,7 @@ test() { local ns - _nvmet_target_setup --blkdev file + _nvmet_target_setup _nvme_connect_subsys diff --git a/tests/nvme/027 b/tests/nvme/027 index a63e42b..b117cc1 100755 --- a/tests/nvme/027 +++ b/tests/nvme/027 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe ns-rescan command on NVMeOF with a file-backed ns. +# Test NVMe ns-rescan command. . tests/nvme/rc -DESCRIPTION="test NVMe ns-rescan command on NVMeOF file-backed ns" +DESCRIPTION="test NVMe ns-rescan command" QUICK=1 requires() { @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { @@ -26,7 +26,7 @@ test() { local nvmedev - _nvmet_target_setup --blkdev file + _nvmet_target_setup _nvme_connect_subsys diff --git a/tests/nvme/028 b/tests/nvme/028 index 65c52a9..d6ffdd6 100755 --- a/tests/nvme/028 +++ b/tests/nvme/028 @@ -2,11 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2017-2018 Western Digital Corporation or its affiliates. # -# Test NVMe list-subsys command on NVMeOF with a file-backed ns. +# Test NVMe list-subsys command. . tests/nvme/rc -DESCRIPTION="test NVMe list-subsys command on NVMeOF file-backed ns" +DESCRIPTION="test NVMe list-subsys" QUICK=1 requires() { @@ -16,7 +16,7 @@ requires() { } set_conditions() { - _set_nvme_trtype "$@" + _set_nvme_trtype_and_nvmet_blkdev_type "$@" } test() { @@ -24,7 +24,7 @@ test() { _setup_nvmet - _nvmet_target_setup --blkdev file + _nvmet_target_setup _nvme_connect_subsys