Skip to content

Commit

Permalink
Fix: namespace creation size with multiple regions
Browse files Browse the repository at this point in the history
Current implementation overwrites size on first iteration and uses
the same for all regions. hence replacing the variable with a
proper persistence.

Signed-off-by: Harish <[email protected]>
  • Loading branch information
harish-24 committed Dec 5, 2019
1 parent 4894ee1 commit cb9ea42
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions memory/ndctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,20 +444,22 @@ def test_multiple_ns_multiple_region(self):
self.disable_namespace()
self.destroy_namespace()
for val in regions:
ns_size = None
region = self.get_json_val(val, 'dev')
self.log.info("Using %s for muliple namespaces", region)
self.log.info("Creating %s namespaces", self.cnt)
if not self.size:
self.size = self.get_json_val(self.get_json(
ns_size = self.get_json_val(self.get_json(
'-r %s' % region)[0], 'size')
ch_cnt = self.get_aligned_count(self.size)
self.size = self.size // ch_cnt
ch_cnt = self.get_aligned_count(ns_size)
ns_size = ns_size // ch_cnt
else:
# Assuming size is aligned
ns_size = self.size
ch_cnt = self.cnt
for nid in range(0, ch_cnt):
self.create_namespace(
region=region, mode=self.mode_to_use, size=self.size)
region=region, mode=self.mode_to_use, size=ns_size)
self.log.info("Namespace %s created", nid + 1)

def test_nslot_namespace(self):
Expand Down

0 comments on commit cb9ea42

Please sign in to comment.