diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 19:41:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 19:41:32 +0000 |
commit | f26f66d866ba1a9f3204e6fdfe2b07e67b5492ad (patch) | |
tree | c953c007cbe4f60a147ab62f97937d58abb2e9ca /tests/nvme_verify_test.py | |
parent | Initial commit. (diff) | |
download | nvme-cli-f26f66d866ba1a9f3204e6fdfe2b07e67b5492ad.tar.xz nvme-cli-f26f66d866ba1a9f3204e6fdfe2b07e67b5492ad.zip |
Adding upstream version 2.8.upstream/2.8
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/nvme_verify_test.py')
-rw-r--r-- | tests/nvme_verify_test.py | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/nvme_verify_test.py b/tests/nvme_verify_test.py new file mode 100644 index 0000000..7c30828 --- /dev/null +++ b/tests/nvme_verify_test.py @@ -0,0 +1,55 @@ +# 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 Verify Testcase:- + + 1. Issue verify command on set of block; shall pass. + +""" + +from nvme_test import TestNVMe + + +class TestNVMeVerify(TestNVMe): + + """ + Represents NVMe Verify testcase. + - Attributes: + - start_block : starting block of to verify operation. + - test_log_dir : directory for logs, temp files. + """ + + def setUp(self): + """ Pre Section for TestNVMeVerify """ + super().setUp() + self.start_block = 0 + self.block_count = 0 + self.namespace = 1 + self.setup_log_dir(self.__class__.__name__) + + def tearDown(self): + """ Post Section for TestNVMeVerify """ + super().tearDown() + + def verify(self): + """ Wrapper for nvme verify + - Args: + - None + - Returns: + - return code for nvme verify command. + """ + verify_cmd = "nvme verify " + self.ctrl + \ + " --namespace-id=" + str(self.namespace) + \ + " --start-block=" + str(self.start_block) + \ + " --block-count=" + str(self.block_count) + return self.exec_cmd(verify_cmd) + + def test_verify(self): + """ Testcase main """ + self.assertEqual(self.verify(), 0) |