Skip to content

Commit c276f3d

Browse files
ikegami-tigaw
authored andcommitted
tests: add blkdev checking after NS creation
To make sure the blkdev as same with NS attachment. Signed-off-by: Tokunori Ikegami <[email protected]>
1 parent f54f046 commit c276f3d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/nvme_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,11 @@ def create_and_validate_ns(self, nsid, nsze, ncap, flbas, dps):
392392
err = subprocess.call(id_ns_cmd,
393393
shell=True,
394394
stdout=subprocess.DEVNULL)
395+
if err == 0:
396+
# enumerate new namespace block device
397+
self.nvme_reset_ctrl()
398+
# check if new namespace block device exists
399+
err = 0 if stat.S_ISBLK(os.stat(self.ctrl + "n" + str(nsid)).st_mode) else 1
395400
return err
396401

397402
def attach_ns(self, ctrl_id, nsid):

0 commit comments

Comments
 (0)