From be80094814e133fd4d59e59e113721ea1880f13e Mon Sep 17 00:00:00 2001 From: Jitendra Yejare Date: Mon, 23 Sep 2024 16:41:58 +0530 Subject: [PATCH] [6.14.z][Combined Jenkins Ask] Capsule testing for sanity (#15948) (#16421) * [Combined Jenkins Ask] Capsule testing for sanity (#15948) * Capsule Sanity Test from installer * Design Change: only count change * Satellite Maintain fapolicyd package installation * Capsule RHEL version fix --- pytest_fixtures/core/sat_cap_factory.py | 11 +++++++---- tests/foreman/installer/test_installer.py | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pytest_fixtures/core/sat_cap_factory.py b/pytest_fixtures/core/sat_cap_factory.py index 96c1683bfb7..d0416fdeacc 100644 --- a/pytest_fixtures/core/sat_cap_factory.py +++ b/pytest_fixtures/core/sat_cap_factory.py @@ -304,15 +304,18 @@ def sat_ready_rhel(request): @pytest.fixture(scope='module') -def module_sat_ready_rhels(request): +def module_sat_ready_rhels(request, module_target_sat): deploy_args = get_deploy_args(request) - with Broker(**deploy_args, host_class=Satellite, _count=2) as hosts: - yield hosts + if 'build_sanity' not in request.config.option.markexpr: + with Broker(**deploy_args, host_class=Satellite, _count=2) as hosts: + yield hosts + else: + yield [module_target_sat] @pytest.fixture def cap_ready_rhel(): - rhel_version = Version(settings.capsule.version.release) + rhel_version = Version(settings.capsule.version.rhel_version) deploy_args = { 'deploy_rhel_version': rhel_version.base_version, 'deploy_flavor': settings.flavors.default, diff --git a/tests/foreman/installer/test_installer.py b/tests/foreman/installer/test_installer.py index 7512e6adc30..e0553bf2698 100644 --- a/tests/foreman/installer/test_installer.py +++ b/tests/foreman/installer/test_installer.py @@ -1374,8 +1374,9 @@ def sat_default_install(module_sat_ready_rhels): 'scenario satellite', f'foreman-initial-admin-password {settings.server.admin_password}', ] - install_satellite(module_sat_ready_rhels[0], installer_args) - return module_sat_ready_rhels[0] + sat = module_sat_ready_rhels.pop() + install_satellite(sat, installer_args) + return sat @pytest.fixture(scope='module') @@ -1387,13 +1388,15 @@ def sat_non_default_install(module_sat_ready_rhels): 'foreman-rails-cache-store type:redis', 'foreman-proxy-content-pulpcore-hide-guarded-distributions false', ] - install_satellite(module_sat_ready_rhels[1], installer_args) - return module_sat_ready_rhels[1] + sat = module_sat_ready_rhels.pop() + install_satellite(sat, installer_args) + return sat @pytest.mark.e2e @pytest.mark.tier1 @pytest.mark.pit_server +@pytest.mark.build_sanity def test_capsule_installation(sat_default_install, cap_ready_rhel, default_org): """Run a basic Capsule installation