-
Notifications
You must be signed in to change notification settings - Fork 96
Tests for module usage counter after CAS upgrade #478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above
| 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!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above
| unload_kernel_module(CasModule.cache.value) | ||
| unload_kernel_module(CasModule.disk.value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above
| unload_kernel_module(CasModule.cache.value) | ||
| start_cache(cache_dev.partitions[0], force=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above
| modes_list = [] | ||
| for mode in CacheMode: | ||
| modes_list.append(mode) | ||
| return modes_list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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