Skip to content

Commit

Permalink
changed fixture from sca to non-sca mode
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaysawant committed Apr 25, 2024
1 parent e0e7470 commit c4554ef
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions tests/foreman/longrun/test_inc_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def test_positive_noapply_api(


@pytest.mark.tier3
def test_positive_incremental_update_time(target_sat, function_sca_manifest_org):
def test_positive_incremental_update_time(module_target_sat, module_entitlement_manifest_org):
"""Incremental update should not take a long time.
:id: a9cdcc58-2d10-42cf-8e24-f7bec3b79d6b
Expand All @@ -256,31 +256,33 @@ def test_positive_incremental_update_time(target_sat, function_sca_manifest_org)
"""
# create content view
cv = target_sat.cli_factory.make_content_view({'organization-id': function_sca_manifest_org.id})
cv = module_target_sat.cli_factory.make_content_view(
{'organization-id': module_entitlement_manifest_org.id}
)
repo_sync_timestamp = (
datetime.utcnow().replace(microsecond=0) - timedelta(seconds=1)
).strftime('%Y-%m-%d %H:%M')
# setup rh repositories, add to cv, begin sync
for _repo in ['rhel8_bos', 'rhst8', 'rhsclient8']:
rh_repo_id = target_sat.api_factory.enable_rhrepo_and_fetchid(
rh_repo_id = module_target_sat.api_factory.enable_rhrepo_and_fetchid(
basearch=DEFAULT_ARCHITECTURE,
org_id=function_sca_manifest_org.id,
org_id=module_entitlement_manifest_org.id,
product=PRDS['rhel8'],
repo=REPOS[_repo]['name'],
reposet=REPOSET[_repo],
releasever=REPOS[_repo]['releasever'],
)
target_sat.cli.ContentView.add_repository(
module_target_sat.cli.ContentView.add_repository(
{
'id': cv['id'],
'organization-id': function_sca_manifest_org.id,
'organization-id': module_entitlement_manifest_org.id,
'repository-id': rh_repo_id,
}
)
target_sat.api.Repository(id=rh_repo_id).sync(synchronous=False)
module_target_sat.api.Repository(id=rh_repo_id).sync(synchronous=False)

# wait for all repo sync tasks
sync_tasks = target_sat.wait_for_tasks(
sync_tasks = module_target_sat.wait_for_tasks(
search_query=(
'label = Actions::Katello::Repository::Sync'
f' and started_at >= "{repo_sync_timestamp}"'
Expand All @@ -290,14 +292,14 @@ def test_positive_incremental_update_time(target_sat, function_sca_manifest_org)
)
assert all(task.poll()['result'] == 'success' for task in sync_tasks)
# publish and fetch new CVV
target_sat.cli.ContentView.publish({'id': cv['id']})
content_view = target_sat.cli.ContentView.info({'id': cv['id']})
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 via hammer, using one errata.
# expect: incr. "version-1.1" is created
update_start_time = datetime.utcnow()
result = target_sat.cli.ContentView.version_incremental_update(
result = module_target_sat.cli.ContentView.version_incremental_update(
{'content-view-version-id': cvv['id'], 'errata-ids': REAL_RHEL8_1_ERRATA_ID}
)
assert 'version-1.1' in str(result[0].keys())
Expand All @@ -308,7 +310,7 @@ def test_positive_incremental_update_time(target_sat, function_sca_manifest_org)
)
# publish the full CV, containing the added version-1.1
publish_start_time = datetime.utcnow()
result = target_sat.cli.ContentView.publish({'id': cv['id']})
result = module_target_sat.cli.ContentView.publish({'id': cv['id']})
publish_duration = (datetime.utcnow() - publish_start_time).total_seconds()
logger.info(f'Publish for CV id: {content_view["id"]}, took {publish_duration} seconds.')
# Per BZs: expect update duration was quicker than publish duration,
Expand Down

0 comments on commit c4554ef

Please sign in to comment.