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_lba_status_log_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_lba_status_log_test.py | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/nvme_lba_status_log_test.py b/tests/nvme_lba_status_log_test.py new file mode 100644 index 0000000..c91d1e5 --- /dev/null +++ b/tests/nvme_lba_status_log_test.py @@ -0,0 +1,59 @@ +# 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 LBA Status Log Testcase :- + + 1. Execute lba-status-log on a device. +""" + +import subprocess + +from nvme_test import TestNVMe + + +class TestNVMeLbaStatLogCmd(TestNVMe): + + """ + Represents LBA Status Log test. + """ + + def setUp(self): + """ Pre Section for TestNVMeLbaStatLogCmd. """ + super().setUp() + self.setup_log_dir(self.__class__.__name__) + + def tearDown(self): + """ + Post Section for TestNVMeLbaStatLogCmd. + + - Call super class's destructor. + """ + super().tearDown() + + def get_lba_stat_log(self): + """ Wrapper for executing nvme lba-status-log. + - Args: + - None + - Returns: + - 0 on success, error code on failure. + """ + err = 0 + lba_stat_log_cmd = "nvme lba-status-log " + self.ctrl + proc = subprocess.Popen(lba_stat_log_cmd, + shell=True, + stdout=subprocess.PIPE, + encoding='utf-8') + lba_stat_log_output = proc.communicate()[0] + print("\n" + lba_stat_log_output + "\n") + err = proc.wait() + return err + + def test_lba_stat_log(self): + """ Testcase main """ + self.assertEqual(self.get_lba_stat_log(), 0) |