Skip to content

Commit 695aa71

Browse files
committed
tests: add blkdev checking after NS creation
To make sure the blkdev as same with NS attachment. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
1 parent 4d0d050 commit 695aa71

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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)