Skip to content

Commit

Permalink
ensure mqtt capsule is not bypassed (#13817)
Browse files Browse the repository at this point in the history
  • Loading branch information
pondrejk authored Jan 30, 2024
1 parent 5c9cb77 commit 7f317a6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/foreman/api/test_remoteexecution.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,20 @@ def test_positive_run_capsule_upgrade_playbook(module_capsule_configured, target
@pytest.mark.tier3
@pytest.mark.no_containers
@pytest.mark.rhel_ver_list('8')
@pytest.mark.parametrize(
'setting_update',
['remote_execution_global_proxy=False'],
ids=["no_global_proxy"],
indirect=True,
)
def test_negative_time_to_pickup(
module_org,
module_target_sat,
smart_proxy_location,
module_ak_with_cv,
module_capsule_configured_mqtt,
rhel_contenthost,
setting_update,
):
"""Time to pickup setting is honored for host registered to mqtt
Expand Down Expand Up @@ -131,13 +138,6 @@ def test_negative_time_to_pickup(
result = rhel_contenthost.execute('systemctl stop yggdrasild')
assert result.status == 0, f'Failed to stop yggdrasil on client: {result.stderr}'

# Make sure the job is executed by the registered-trough capsule
global_ttp = module_target_sat.api.Setting().search(
query={'search': 'name="remote_execution_global_proxy"'}
)[0]
global_ttp.value = False
global_ttp.update(['value'])

# run script provider rex command with time_to_pickup
job = module_target_sat.api.JobInvocation().run(
synchronous=False,
Expand Down
14 changes: 14 additions & 0 deletions tests/foreman/cli/test_remoteexecution.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,12 @@ class TestPullProviderRex:
@pytest.mark.upgrade
@pytest.mark.no_containers
@pytest.mark.rhel_ver_match('[^6].*')
@pytest.mark.parametrize(
'setting_update',
['remote_execution_global_proxy=False'],
ids=["no_global_proxy"],
indirect=True,
)
def test_positive_run_job_on_host_converted_to_pull_provider(
self,
module_org,
Expand All @@ -1243,6 +1249,7 @@ def test_positive_run_job_on_host_converted_to_pull_provider(
module_target_sat,
module_capsule_configured_mqtt,
rhel_contenthost,
setting_update,
):
"""Run custom template on host converted to mqtt
Expand Down Expand Up @@ -1339,6 +1346,12 @@ def test_positive_run_job_on_host_converted_to_pull_provider(
@pytest.mark.e2e
@pytest.mark.no_containers
@pytest.mark.rhel_ver_match('[^6].*')
@pytest.mark.parametrize(
'setting_update',
['remote_execution_global_proxy=False'],
ids=["no_global_proxy"],
indirect=True,
)
def test_positive_run_job_on_host_registered_to_pull_provider(
self,
module_org,
Expand All @@ -1347,6 +1360,7 @@ def test_positive_run_job_on_host_registered_to_pull_provider(
module_ak_with_cv,
module_capsule_configured_mqtt,
rhel_contenthost,
setting_update,
):
"""Run custom template on host registered to mqtt, check effective user setting
Expand Down

0 comments on commit 7f317a6

Please sign in to comment.