Skip to content

Commit

Permalink
Test incremental update time
Browse files Browse the repository at this point in the history
  • Loading branch information
damoore044 committed Apr 11, 2024
1 parent 8eea8dc commit c458337
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions tests/foreman/longrun/test_inc_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,83 @@ def test_positive_noapply_api(
outval['action']
== 'Incremental Update of 1 Content View Version(s) with 1 Package(s), and 1 Errata'
)


@pytest.mark.tier3
def test_positive_incremental_update_time(module_target_sat, module_sca_manifest_org):
"""Incremental update should not take a long time.
:id: a9cdcc58-2d10-42cf-8e24-f7bec3b79d6b
:steps:
1. Setup and sync rhel8 baseOS, rhst8, and rhsc8 repositories.
2. Create content view and add repos.
3. Publish a content view version with all content.
4. Using hammer, perform incremental update on that new version.
5. Publish the incremental version
:expectedresults: Incremental update takes a short amount of time
:BZ: 2117760, 1829266
"""
# rhel8 base os
rhel8_repo_id = module_target_sat.api_factory.enable_rhrepo_and_fetchid(
basearch=DEFAULT_ARCHITECTURE,
org_id=module_sca_manifest_org.id,
product=PRDS['rhel8'],
repo=REPOS['rhel8_bos']['name'],
reposet=REPOSET['rhel8_bos'],
releasever=REPOS['rhel8_bos']['releasever'],
)
rhel8_repo = module_target_sat.api.Repository(id=rhel8_repo_id).read()
assert rhel8_repo.sync(timeout=3000)['result'] == 'success'
# rh sat tools
rhst8_repo_id = module_target_sat.api_factory.enable_rhrepo_and_fetchid(
basearch=DEFAULT_ARCHITECTURE,
org_id=module_sca_manifest_org.id,
product=PRDS['rhel8'],
repo=REPOS['rhst8']['name'],
reposet=REPOSET['rhst8'],
releasever=None,
)
rhst8_repo = module_target_sat.api.Repository(id=rhst8_repo_id).read()
assert rhst8_repo.sync()['result'] == 'success'
# rh sat client
rhsc8_repo_id = module_target_sat.api_factory.enable_rhrepo_and_fetchid(
basearch=DEFAULT_ARCHITECTURE,
org_id=module_sca_manifest_org.id,
product=PRDS['rhel8'],
repo=REPOS['rhsclient8']['name'],
reposet=REPOSET['rhsclient8'],
releasever=None,
)
rhsc8_repo = module_target_sat.api.Repository(id=rhsc8_repo_id).read()
assert rhsc8_repo.sync()['result'] == 'success'
# create content view, add all repos
cv = module_target_sat.cli_factory.make_content_view(
{'organization-id': module_sca_manifest_org.id}
)
rhel_repos = [rhst8_repo_id, rhsc8_repo_id, rhel8_repo_id]
for repo_id in rhel_repos:
module_target_sat.cli.ContentView.add_repository(
{
'id': cv['id'],
'organization-id': module_sca_manifest_org.id,
'repository-id': repo_id,
}
)
# publish and fetch new CVV
module_target_sat.cli.ContentView.publish({'id': cv['id']})
content_view = module_target_sat.cli.ContentView.info({'id': cv['id']})
cvv = content_view['versions'][0]

# update incremental version of the CVV via hammer, publish it
timeout = 500
start_time = datetime.utcnow() - timedelta(seconds=1)
result = module_target_sat.cli.ContentView.version_incremental_update(
{'content-view-version-id': cvv['id'], 'errata-ids': 'RHSA-2023:5982'}
)
assert 'version-1.1' in str(result[0].keys())
module_target_sat.cli.ContentView.publish({'id': cv['id']})
assert (datetime.utcnow() - timedelta(seconds=1)) - start_time <= timedelta(seconds=timeout)

0 comments on commit c458337

Please sign in to comment.