summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-30 22:38:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-30 22:38:48 +0000
commit01c4d3d32c5044d3d17055c2d94d40fee9d130e1 (patch)
tree2c213cd5436bff644fa7023b94674a9c12d2e1af /tests
parentAdding upstream version 2.4+really2.4. (diff)
downloadnvme-cli-upstream/2.5.tar.xz
nvme-cli-upstream/2.5.zip
Adding upstream version 2.5.upstream/2.5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/meson.build1
-rw-r--r--tests/nvme_ctrl_reset_test.py48
2 files changed, 49 insertions, 0 deletions
diff --git a/tests/meson.build b/tests/meson.build
index 630f35d..90f1a68 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -28,6 +28,7 @@ tests = [
'nvme_verify_test.py',
'nvme_lba_status_log_test.py',
'nvme_get_lba_status_test.py',
+ 'nvme_ctrl_reset_test.py',
]
runtests = find_program('nose2', required : false)
diff --git a/tests/nvme_ctrl_reset_test.py b/tests/nvme_ctrl_reset_test.py
new file mode 100644
index 0000000..b8b3c3b
--- /dev/null
+++ b/tests/nvme_ctrl_reset_test.py
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# This file is part of nvme-cli
+#
+# Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved.
+#
+# Author: Arunpandian J <arun.j@samsung.com>
+
+"""
+NVMe controller reset Testcase:-
+
+ 1. Execute nvme controller reset.
+
+"""
+
+from nvme_test import TestNVMe
+
+
+class TestNVMeCtrlReset(TestNVMe):
+
+ """
+ Represents NVMe Controller reset testcase.
+ - Attributes:
+ - test_log_dir : directory for logs, temp files.
+ """
+
+ def setUp(self):
+ """ Pre Section for TestNVMeCtrlReset """
+ super().setUp()
+ self.setup_log_dir(self.__class__.__name__)
+
+ def tearDown(self):
+ """ Post Section for TestNVMeCtrlReset """
+ super().tearDown()
+
+ def ctrl_reset(self):
+ """ Wrapper for nvme controller reset
+ - Args:
+ - None
+ - Returns:
+ - return code for nvme controller reset.
+ """
+ ctrl_reset_cmd = "nvme reset " + self.ctrl
+ return self.exec_cmd(ctrl_reset_cmd)
+
+ def test_ctrl_reset(self):
+ """ Testcase main """
+ self.assertEqual(self.ctrl_reset(), 0)