diff mbox series

[RFC,blktests,v2,2/3] nvme/030: only run against kernel soft target

Message ID 20240612110444.4507-3-dwagner@suse.de (mailing list archive)
State New, archived
Headers show
Series Add support to run against real target | expand

Commit Message

Daniel Wagner June 12, 2024, 11:04 a.m. UTC
This tests is exercising the target code and not so much the host side.
The problem with nvme/030 is that it depends on interface to interact
with the target which is not covered by the standard. Thus we can't
run it against a real target. Just skip it when we run against a
real target.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
 tests/nvme/030 | 1 +
 tests/nvme/rc  | 8 ++++++++
 2 files changed, 9 insertions(+)

Comments

Shin'ichiro Kawasaki June 14, 2024, 5:11 a.m. UTC | #1
On Jun 12, 2024 / 13:04, Daniel Wagner wrote:
> This tests is exercising the target code and not so much the host side.

s/tests/test/

> The problem with nvme/030 is that it depends on interface to interact
> with the target which is not covered by the standard. Thus we can't
> run it against a real target. Just skip it when we run against a
> real target.
> 
> Signed-off-by: Daniel Wagner <dwagner@suse.de>
> ---
>  tests/nvme/030 | 1 +
>  tests/nvme/rc  | 8 ++++++++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/tests/nvme/030 b/tests/nvme/030
> index b1ed8bc20908..672487734332 100755
> --- a/tests/nvme/030
> +++ b/tests/nvme/030
> @@ -13,6 +13,7 @@ requires() {
>  	_nvme_requires
>  	_have_loop
>  	_require_nvme_trtype_is_fabrics
> +	_require_kernel_target

The function name sounds generic too much for me. How about
_require_kernel_nvme_target? (The current name reminds me SCSI target).

>  }
>  
>  set_conditions() {
> diff --git a/tests/nvme/rc b/tests/nvme/rc
> index aaa64453fe16..4a2d107bd532 100644
> --- a/tests/nvme/rc
> +++ b/tests/nvme/rc
> @@ -219,6 +219,14 @@ _require_kernel_nvme_fabrics_feature() {
>  	return 0
>  }
>  
> +_require_kernel_target() {
> +	if [[ -n "${nvme_target_control}" ]]; then
> +		SKIP_REASONS+=("Linux kernel soft target not available")
> +		return 1;
> +	fi
> +	return 0
> +}
> +
>  _test_dev_nvme_ctrl() {
>  	echo "/dev/char/$(cat "${TEST_DEV_SYSFS}/device/dev")"
>  }
> -- 
> 2.45.2
>
diff mbox series

Patch

diff --git a/tests/nvme/030 b/tests/nvme/030
index b1ed8bc20908..672487734332 100755
--- a/tests/nvme/030
+++ b/tests/nvme/030
@@ -13,6 +13,7 @@  requires() {
 	_nvme_requires
 	_have_loop
 	_require_nvme_trtype_is_fabrics
+	_require_kernel_target
 }
 
 set_conditions() {
diff --git a/tests/nvme/rc b/tests/nvme/rc
index aaa64453fe16..4a2d107bd532 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -219,6 +219,14 @@  _require_kernel_nvme_fabrics_feature() {
 	return 0
 }
 
+_require_kernel_target() {
+	if [[ -n "${nvme_target_control}" ]]; then
+		SKIP_REASONS+=("Linux kernel soft target not available")
+		return 1;
+	fi
+	return 0
+}
+
 _test_dev_nvme_ctrl() {
 	echo "/dev/char/$(cat "${TEST_DEV_SYSFS}/device/dev")"
 }