diff --git a/pytest_fixtures/core/sat_cap_factory.py b/pytest_fixtures/core/sat_cap_factory.py index eb80a1991ea..d0281430830 100644 --- a/pytest_fixtures/core/sat_cap_factory.py +++ b/pytest_fixtures/core/sat_cap_factory.py @@ -156,7 +156,9 @@ def session_capsule_host(request, capsule_factory): @pytest.fixture def capsule_configured(request, capsule_host, target_sat): """Configure the capsule instance with the satellite from settings.server.hostname""" - if not request.config.option.n_minus: + if request.config.option.n_minus: + capsule_host.cached_capsule_setup(sat_host=target_sat) + else: capsule_host.capsule_setup(sat_host=target_sat) return capsule_host @@ -171,7 +173,9 @@ def large_capsule_configured(large_capsule_host, target_sat): @pytest.fixture(scope='module') def module_capsule_configured(request, module_capsule_host, module_target_sat): """Configure the capsule instance with the satellite from settings.server.hostname""" - if not request.config.option.n_minus: + if request.config.option.n_minus: + module_capsule_host.cached_capsule_setup(sat_host=module_target_sat) + else: module_capsule_host.capsule_setup(sat_host=module_target_sat) return module_capsule_host diff --git a/robottelo/hosts.py b/robottelo/hosts.py index b167d1eba26..0f03ce4eec1 100644 --- a/robottelo/hosts.py +++ b/robottelo/hosts.py @@ -1643,6 +1643,10 @@ def capsule_setup(self, sat_host=None, capsule_cert_opts=None, **installer_kwarg f'A core service is not running at capsule host\n{result.stdout}' ) + @lru_cache + def cached_capsule_setup(self, sat_host): + self.capsule_setup(sat_host=sat_host) + def set_rex_script_mode_provider(self, mode='ssh'): """Set provider for remote execution script mode. One of: ssh(default), pull-mqtt, ssh-async"""