-
Notifications
You must be signed in to change notification settings - Fork 115
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
CC Automation - reclaim-space CLI test #14425
Changes from all commits
ca25aee
9037d3f
6e1fc84
9d63c82
48ec919
756e061
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,3 +125,41 @@ def test_positive_disable_rh_repo_with_basearch(module_target_sat, module_entitl | |
} | ||
) | ||
assert 'Repository disabled' in disabled_repo[0]['message'] | ||
|
||
|
||
def test_reclaim_space_command_no_exception(module_target_sat, module_sca_manifest_org): | ||
"""Hammer repository reclaim-space should not throw any improper exceptions | ||
|
||
:id: 74b669d8-ee6b-4fc6-864f-91410d7ea3c2 | ||
|
||
:steps: | ||
1. Enable and sync an On Demand repo | ||
|
||
2. hammer repository reclaim-space --id REPOID --organization-id ORGID | ||
|
||
|
||
:expectedresults: Command works as expected | ||
|
||
:customerscenario: true | ||
|
||
:BZ: 2164997 | ||
""" | ||
rh_repo_id = module_target_sat.api_factory.enable_rhrepo_and_fetchid( | ||
basearch=DEFAULT_ARCHITECTURE, | ||
org_id=module_sca_manifest_org.id, | ||
product=REPOS['kickstart']['rhel8_aps']['product'], | ||
repo=REPOS['kickstart']['rhel8_aps']['name'], | ||
reposet=REPOS['kickstart']['rhel8_aps']['reposet'], | ||
releasever=REPOS['kickstart']['rhel8_aps']['version'], | ||
) | ||
repo = module_target_sat.api.Repository(id=rh_repo_id).read() | ||
repo.sync(timeout=600) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that all of the steps up until this point should be considered a setup. Consider using the already existing fixtures that prepare the repos for you, e.g. |
||
output = module_target_sat.cli.Repository.reclaim_space( | ||
{ | ||
'organization-id': module_sca_manifest_org.id, | ||
'id': rh_repo_id, | ||
} | ||
) | ||
# Checking that the fail message isn't present. On a success, no message is returned | ||
if output != {}: | ||
assert 'Could not reclaim the repository' not in output[0]['message'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Couldnt we have some real scenario of reclaiming space rather than this generic check ? I mean where we could verify some bytes/mbs are reclaimed ? |
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.
Should have a better expected result! Something like the space is reclaimed or more descriptive.
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.
Yes, it should state here that the space is really reclaimed and at the end, it should be asserted. The fact this passes without any error doesn't mean it works.