diff mbox series

[RFC,blktests,v1,10/10] nvme/030: only run against kernel soft target

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

Commit Message

Daniel Wagner March 18, 2024, 9:38 a.m. UTC
This tests is exercising the target code and not so much the host side.
Thus just skip it when we run against a remote target.

Signed-off-by: Daniel Wagner <dwagner@suse.de>

merge
---
 tests/nvme/030 | 1 +
 tests/nvme/rc  | 8 ++++++++
 2 files changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/tests/nvme/030 b/tests/nvme/030
index 9251e1744f61..6d51e0ada07c 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
 }
 
 test() {
diff --git a/tests/nvme/rc b/tests/nvme/rc
index 35eb4cc5e954..41ec30af7787 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -185,6 +185,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")"
 }