Skip to content

Commit f6d5e53

Browse files
authored
Merge branch '6.19.z' into cherry-pick-6.19.z-b63db29008c99e58249bccc22cd2b912c3d356a5
2 parents 702513f + 00af017 commit f6d5e53

5 files changed

Lines changed: 38 additions & 23 deletions

File tree

conf/container.yaml.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CONTAINER:
44
- docker
55
- podman
66
REGISTRY_HUB: https://mirror.gcr.io
7-
UPSTREAM_NAME: 'library/busybox'
7+
UPSTREAM_NAME: jmalloc/echo-server
88
ALTERNATIVE_UPSTREAM_NAMES:
99
- hello-world
1010
- alpine

robottelo/config/validators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
'container.upstream_name',
120120
must_exist=True,
121121
is_type_of=str,
122-
default='library/busybox',
122+
default='jmalloc/echo-server',
123123
),
124124
Validator(
125125
'container.alternative_upstream_names',

tests/foreman/cli/test_container_management.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"""
1212

1313
from datetime import UTC, datetime
14+
import re
1415

1516
from box import Box
1617
from fauxfactory import gen_string
@@ -94,16 +95,18 @@ def test_positive_pull_image(
9495
)
9596
assert result.status == 0
9697
try:
97-
result = module_container_contenthost.execute(f'docker run {repo["published-at"]}')
98+
result = module_container_contenthost.execute(
99+
f'docker run -d {repo["published-at"]}'
100+
)
98101
assert result.status == 0
102+
match = re.match(r'^[0-9a-f]+$', result.stdout)
103+
if match:
104+
container_id = match.group(0)
99105
finally:
100106
# Stop and remove the container
101-
result = module_container_contenthost.execute(
102-
f'docker ps -a | grep {repo["published-at"]}'
103-
)
104-
container_id = result.stdout[0].split()[0]
105-
module_container_contenthost.execute(f'docker stop {container_id}')
106-
module_container_contenthost.execute(f'docker rm {container_id}')
107+
if container_id:
108+
module_container_contenthost.execute(f'docker stop {container_id}')
109+
module_container_contenthost.execute(f'docker rm {container_id}')
107110
finally:
108111
# Remove docker image
109112
module_container_contenthost.execute(f'docker rmi {repo["published-at"]}')

tests/foreman/destructive/test_ldap_authentication.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,8 @@ def test_single_sign_on_ldap_ad_server(
266266
assert f'{url}/new/hosts' in result.stdout
267267

268268

269-
@pytest.mark.parametrize(
270-
'setting_update',
271-
[f'login_delegation_logout_url={LOGIN_DELEGATION_LOGOUT_URL}'],
272-
ids=["external_redirect"],
273-
indirect=True,
274-
)
275269
def test_single_sign_on_using_rhsso(
276-
enable_external_auth_rhsso, rhsso_setting_setup, module_target_sat, setting_update
270+
enable_external_auth_rhsso, rhsso_setting_setup, module_target_sat
277271
):
278272
"""Verify the single sign-on functionality with external authentication RH-SSO
279273
@@ -299,11 +293,23 @@ def test_single_sign_on_using_rhsso(
299293
actual_user = session.task.read_all(widget_names="current_user")['current_user']
300294
assert settings.rhsso.rhsso_user in actual_user
301295
# logout verification for SAT-40322
302-
session.rhsso_login.logout()
303-
assert session.browser.url == LOGIN_DELEGATION_LOGOUT_URL, "Unsuccessful logout redirect"
304-
with pytest.raises(NavigationTriesExceeded) as error:
305-
session.task.read_all(widget_names='current_user')['current_user']
306-
assert error.typename == 'NavigationTriesExceeded'
296+
setting_object = module_target_sat.api.Setting().search(
297+
query={'search': 'name=login_delegation_logout_url'}
298+
)[0]
299+
default_setting_value = '' if setting_object.value is None else setting_object.value
300+
setting_object.value = LOGIN_DELEGATION_LOGOUT_URL
301+
setting_object.update({'value'})
302+
try:
303+
session.rhsso_login.logout()
304+
assert session.browser.url == LOGIN_DELEGATION_LOGOUT_URL, (
305+
"Unsuccessful logout redirect"
306+
)
307+
with pytest.raises(NavigationTriesExceeded) as error:
308+
session.task.read_all(widget_names='current_user')['current_user']
309+
assert error.typename == 'NavigationTriesExceeded'
310+
finally:
311+
setting_object.value = default_setting_value
312+
setting_object.update({'value'})
307313

308314

309315
def test_external_logout_rhsso(rhsso_setting_setup, enable_external_auth_rhsso, module_target_sat):

tests/foreman/sys/test_mcp.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
33
:CaseAutomation: Automated
44
5-
:CaseComponent: API
5+
:CaseComponent: MCP
66
77
:Team: Endeavour
88
9-
:Requirement: API
9+
:Requirement: MCP
1010
1111
:CaseImportance: High
1212
@@ -158,6 +158,11 @@ async def test_positive_mcp_user_view_permissions(
158158
result = await client.call_tool(
159159
'call_foreman_api_get', {'resource': allowed_resource, 'action': 'index', 'params': {}}
160160
)
161+
if 'error' in result.data and 'Max retries exceeded' in result.data['error']:
162+
result = await client.call_tool(
163+
'call_foreman_api_get',
164+
{'resource': allowed_resource, 'action': 'index', 'params': {}},
165+
)
161166
assert (
162167
result.data['message']
163168
== f"Action 'index' on resource '{allowed_resource}' executed successfully."
@@ -170,3 +175,4 @@ async def test_positive_mcp_user_view_permissions(
170175
f"Failed to execute action 'index' on resource '{denied_resource}'"
171176
in result.data['message']
172177
)
178+
assert result.data['response']['error']['message'] == 'Access denied'

0 commit comments

Comments
 (0)