From: Dennis Maisenbacher Date: Wed, 16 Oct 2024 12:56:12 +0000 (+0000) Subject: tests: Adjust ncap and nsze for nvme_format_test X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=761ed9f3516da1ff1ffba08bb1c051291a909908;p=users%2Fsagi%2Fnvme-cli.git tests: Adjust ncap and nsze for nvme_format_test Set ncap and nsze to the lowest possible value, such that this test can be run on different device capacities. Signed-off-by: Dennis Maisenbacher --- diff --git a/tests/nvme_format_test.py b/tests/nvme_format_test.py index 40635c15..12bc128f 100644 --- a/tests/nvme_format_test.py +++ b/tests/nvme_format_test.py @@ -37,6 +37,7 @@ Namespace Format testcase :- - Delete Namespace. """ +import math import subprocess import time @@ -63,10 +64,14 @@ class TestNVMeFormatCmd(TestNVMe): def setUp(self): """ Pre Section for TestNVMeFormatCmd """ super().setUp() - self.dps = 0 # ns data protection settings - self.flbas = 0 # ns formattes logical block settings - self.nsze = 0x1400000 # ns size - self.ncap = 0x1400000 # ns capacity + self.dps = 0 + self.flbas = 0 + # Assuming run_ns_io with 4KiB * 10 writes. + # Calculating minimum required ncap for this workload + (ds, _) = self.get_lba_format_size() + ncap = int(math.ceil((4096*10)/ds)) + self.ncap = ncap + self.nsze = ncap self.ctrl_id = self.get_ctrl_id() self.lba_format_list = [] self.ms_list = []