Tests for module usage counter after CAS upgrade#478
Tests for module usage counter after CAS upgrade#478Ostrokrzew wants to merge 2 commits intoOpen-CAS:masterfrom
Conversation
|
Hello @Ostrokrzew! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-07-31 09:54:00 UTC |
Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
…cores Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
| from test_utils.size import Size, Unit | ||
|
|
||
| cache_size = Size(1, Unit.GiB) | ||
| cache_modes_amount = len(set(list(CacheMode.__members__.values()))) |
There was a problem hiding this comment.
len(CacheMode) should be enough (it doesn't count DEFAULT as separate entry)
| @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) | ||
| def test_module_usage_counter_without_cores(): | ||
| """ | ||
| title: Validate OpenCAS module used by counter, no cores. |
There was a problem hiding this comment.
The title is quite ambiguous. Sounds like validating a module which is used by a counter. If 'module used by' is a name of a counter, then do what I just did - put it in ' '.
| pass_criteria: | ||
| - Cannot remove OpenCAS kernel modules when usage counter is not 0. | ||
| - OpenCAS increase and decrease cas_cache usage counter. | ||
| - OpenCAS usage counter is equal to amount of caches. |
There was a problem hiding this comment.
'number' instead of 'amount' ('amount' is for uncountable nouns)
| after starting many cache instances (one for each cache mode) without adding cores. | ||
| pass_criteria: | ||
| - Cannot remove OpenCAS kernel modules when usage counter is not 0. | ||
| - OpenCAS increase and decrease cas_cache usage counter. |
There was a problem hiding this comment.
Adding/removing caches increases/decreases...
| installer.set_up_opencas() | ||
| original_commit = git.get_current_commit_hash(from_dut=True) | ||
|
|
||
| installer.uninstall_opencas() | ||
| installer.set_up_opencas(cas_version_to_upgrade) |
| installer._clean_opencas_repo() | ||
| git.checkout_cas_version(original_commit) | ||
| try: | ||
| upgrade_in_flight.upgrade_start() | ||
| except CmdException: | ||
| restore_pretest_state(original_commit) | ||
| TestRun.fail("Upgrade failed!") |
| unload_kernel_module(CasModule.cache.value) | ||
| unload_kernel_module(CasModule.disk.value) |
| unload_kernel_module(CasModule.cache.value) | ||
| start_cache(cache_dev.partitions[0], force=True) |
| modes_list = [] | ||
| for mode in CacheMode: | ||
| modes_list.append(mode) | ||
| return modes_list |
There was a problem hiding this comment.
return [mode for mode in CacheModes]
Fix freeing oversized discard requests
|
Can one of the admins verify this patch? |
|
Upgrade in flight is not supported anymore |
Two variants:
Waits for patches #391 and #440