]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
tests: add blkdev checking after NS creation
authorTokunori Ikegami <ikegami.t@gmail.com>
Thu, 23 Jan 2025 15:03:45 +0000 (00:03 +0900)
committerDaniel Wagner <wagi@monom.org>
Mon, 27 Jan 2025 08:48:17 +0000 (09:48 +0100)
To make sure the blkdev as same with NS attachment.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
tests/nvme_test.py

index 66e8edfb2b45978ef960d11caf65778e63c663c1..55d083a6e6d968e2f406872eba63f2edc9d152f4 100644 (file)
@@ -392,6 +392,11 @@ class TestNVMe(unittest.TestCase):
             err = subprocess.call(id_ns_cmd,
                                   shell=True,
                                   stdout=subprocess.DEVNULL)
+            if err == 0:
+                # enumerate new namespace block device
+                self.nvme_reset_ctrl()
+                # check if new namespace block device exists
+                err = 0 if stat.S_ISBLK(os.stat(self.ctrl + "n"  + str(nsid)).st_mode) else 1
         return err
 
     def attach_ns(self, ctrl_id, nsid):