diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-29 04:41:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-29 04:41:05 +0000 |
commit | 1cc8413aaf5f8fa6595aece1933462c096e88639 (patch) | |
tree | e97b4f25c511372d73bdd96c389c5f468d99138a /tests/nvme_dsm_test.py | |
parent | Initial commit. (diff) | |
download | nvme-cli-5cfa46883ee24249a66010b27ade5caf2917916a.tar.xz nvme-cli-5cfa46883ee24249a66010b27ade5caf2917916a.zip |
Adding upstream version 2.4+really2.3.upstream/2.4+really2.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/nvme_dsm_test.py | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/tests/nvme_dsm_test.py b/tests/nvme_dsm_test.py new file mode 100644 index 0000000..d92bf58 --- /dev/null +++ b/tests/nvme_dsm_test.py @@ -0,0 +1,56 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# This file is part of nvme-cli +# +# Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved. +# +# Author: Arunpandian J <apj.arun@samsung.com> + +""" +NVMe DSM Testcase:- + + 1. Issue DSM command on set of block; shall pass. + +""" + +from nvme_test import TestNVMe + + +class TestNVMeDsm(TestNVMe): + + """ + Represents NVMe Verify testcase. + - Attributes: + - start_block : starting block of to verify operation. + - range : Range of blocks for DSM operation. + - test_log_dir : directory for logs, temp files. + """ + + def setUp(self): + """ Pre Section for TestNVMeDsm """ + super().setUp() + self.start_block = 0 + self.range = 0 + self.namespace = 1 + self.setup_log_dir(self.__class__.__name__) + + def tearDown(self): + """ Post Section for TestNVMeDsm """ + super().tearDown() + + def dsm(self): + """ Wrapper for nvme verify + - Args: + - None + - Returns: + - return code for nvme dsm command. + """ + dsm_cmd = "nvme dsm " + self.ctrl + \ + " --namespace-id=" + str(self.namespace) + \ + " --blocks=" + str(self.range) + \ + " --slbs=" + str(self.start_block) + return self.exec_cmd(dsm_cmd) + + def test_dsm(self): + """ Testcase main """ + self.assertEqual(self.dsm(), 0) |