From c4554ef42f934b42b948e5d1890601555b462d33 Mon Sep 17 00:00:00 2001 From: vijaysawant Date: Thu, 25 Apr 2024 14:56:33 +0530 Subject: [PATCH] changed fixture from sca to non-sca mode --- tests/foreman/longrun/test_inc_updates.py | 26 ++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/tests/foreman/longrun/test_inc_updates.py b/tests/foreman/longrun/test_inc_updates.py index 67c8194de16..af8457ee99b 100644 --- a/tests/foreman/longrun/test_inc_updates.py +++ b/tests/foreman/longrun/test_inc_updates.py @@ -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 @@ -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}"' @@ -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()) @@ -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,