lkml.org 
[lkml]   [2020]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH blktests v2 11/11] nvme/038: Test removal of un-enabled subsystem and ports
Test that we can remove a subsystem that has not been enabled by
passthru or any ns. Do the same for ports while we are at it.

This was an issue in the original passthru patches and is
not commonly tested. So this test will ensure we don't regress this.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
---
tests/nvme/038 | 36 ++++++++++++++++++++++++++++++++++++
tests/nvme/038.out | 2 ++
2 files changed, 38 insertions(+)
create mode 100755 tests/nvme/038
create mode 100644 tests/nvme/038.out

diff --git a/tests/nvme/038 b/tests/nvme/038
new file mode 100755
index 000000000000..24f02d4ad4d1
--- /dev/null
+++ b/tests/nvme/038
@@ -0,0 +1,36 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2019 Logan Gunthorpe
+# Copyright (C) 2019 Eideticom Communications Inc.
+#
+# Test that we can remove a subsystem that has not been enabled by
+# passthru or any ns. Do the same for ports while we are at it.
+#
+# This was an issue in the original passthru patches and is
+# not commonly tested. So this test will ensure we don't regress this.
+#
+. tests/nvme/rc
+
+DESCRIPTION="test deletion of NVMeOF subsystem without enabling"
+QUICK=1
+
+requires() {
+ _nvme_requires
+}
+
+test() {
+ local subsys_path="${NVMET_CFS}/subsystems/blktests-subsystem-1"
+ local port
+
+ echo "Running ${TEST_NAME}"
+
+ _setup_nvmet
+
+ mkdir -p "${subsys_path}"
+ rmdir "${subsys_path}"
+
+ port=$(_create_nvmet_port loop)
+ _remove_nvmet_port "${port}"
+
+ echo "Test complete"
+}
diff --git a/tests/nvme/038.out b/tests/nvme/038.out
new file mode 100644
index 000000000000..06bc98022c33
--- /dev/null
+++ b/tests/nvme/038.out
@@ -0,0 +1,2 @@
+Running nvme/038
+Test complete
--
2.20.1
\
 
 \ /
  Last update: 2020-09-30 20:55    [W:0.251 / U:1.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site