Unique core name - test update

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga
2019-07-25 15:27:14 +02:00
parent 4f0735b503
commit b73b2857dd
4 changed files with 11 additions and 9 deletions

View File

@@ -128,7 +128,7 @@ def test_add_remove_30core(pyocf_ctx):
stats = cache.get_stats()
assert stats["conf"]["core_count"] == i
core_device = Volume(S.from_MiB(10))
core = Core.using_device(core_device)
core = Core.using_device(core_device, name=f"core{i}")
core_devices.append(core)
cache.add_core(core)
@@ -158,7 +158,7 @@ def test_adding_to_random_cache(pyocf_ctx):
# Create 50 core devices and add to random cache
for i in range(0, core_amount):
core_device = Volume(S.from_MiB(10))
core = Core.using_device(core_device)
core = Core.using_device(core_device, name=f"core{i}")
core_devices[core] = randint(0, cache_amount - 1)
cache_devices[core_devices[core]].add_core(core)
@@ -246,7 +246,7 @@ def test_add_remove_incrementally(pyocf_ctx, cache_mode, cls):
# Create 5 core devices and add to cache
for i in range(0, core_amount):
core_device = Volume(S.from_MiB(10))
core = Core.using_device(core_device)
core = Core.using_device(core_device, name=f"core{i}")
core_devices.append(core)
cache.add_core(core)

View File

@@ -64,9 +64,9 @@ def test_cache_change_seq_cut_off_policy(pyocf_ctx, cm, cls):
# Create 2 core devices
core_device1 = Volume(S.from_MiB(10))
core1 = Core.using_device(core_device1)
core1 = Core.using_device(core_device1, name="core1")
core_device2 = Volume(S.from_MiB(10))
core2 = Core.using_device(core_device2)
core2 = Core.using_device(core_device2, name="core2")
# Add cores
cache.add_core(core1)
@@ -103,9 +103,9 @@ def test_core_change_seq_cut_off_policy(pyocf_ctx, cm, cls):
# Create 2 core devices
core_device1 = Volume(S.from_MiB(10))
core1 = Core.using_device(core_device1)
core1 = Core.using_device(core_device1, name="core1")
core_device2 = Volume(S.from_MiB(10))
core2 = Core.using_device(core_device2)
core2 = Core.using_device(core_device2, name="core2")
# Add cores
cache.add_core(core1)