Skip to content

Commit 4d0d050

Browse files
committed
tests: correct to check blkdev for NS attached
Since currently only default NS blkdev checked for all NSs. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
1 parent b7822bd commit 4d0d050

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/nvme_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ def create_and_validate_ns(self, nsid, nsze, ncap, flbas, dps):
394394
stdout=subprocess.DEVNULL)
395395
return err
396396

397-
def attach_ns(self, ctrl_id, ns_id):
397+
def attach_ns(self, ctrl_id, nsid):
398398
""" Wrapper for attaching the namespace.
399399
- Args:
400400
- ctrl_id : controller id to which namespace to be attached.
@@ -403,15 +403,15 @@ def attach_ns(self, ctrl_id, ns_id):
403403
- 0 on success, error code on failure.
404404
"""
405405
attach_ns_cmd = f"{self.nvme_bin} attach-ns {self.ctrl} " + \
406-
f"--namespace-id={str(ns_id)} --controllers={ctrl_id}"
406+
f"--namespace-id={str(nsid)} --controllers={ctrl_id}"
407407
err = subprocess.call(attach_ns_cmd,
408408
shell=True,
409409
stdout=subprocess.DEVNULL)
410410
if err == 0:
411411
# enumerate new namespace block device
412412
self.nvme_reset_ctrl()
413413
# check if new namespace block device exists
414-
err = 0 if stat.S_ISBLK(os.stat(self.ns1).st_mode) else 1
414+
err = 0 if stat.S_ISBLK(os.stat(self.ctrl + "n" + str(nsid)).st_mode) else 1
415415
return err
416416

417417
def detach_ns(self, ctrl_id, nsid):

0 commit comments

Comments
 (0)