Skip to content

Commit db96b26

Browse files
rmynarpondrejk
andauthored
[6.18.z] check logout redirection (#20718) (#21451)
* check logout redirection (#20718) (cherry picked from commit 90b1295) * set the logout redirect setting within the test body (#20824) --------- Co-authored-by: Peter Ondrejka <pondrejk@users.noreply.github.com>
1 parent 89b8afb commit db96b26

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

robottelo/constants/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2068,6 +2068,8 @@
20682068

20692069
RHSSO_RESET_PASSWORD = {"temporary": "false", "type": "password", "value": ""}
20702070

2071+
LOGIN_DELEGATION_LOGOUT_URL = "https://theforeman.org/"
2072+
20712073
FOREMAN_ANSIBLE_MODULES = [
20722074
"activation_key",
20732075
"architecture",

tests/foreman/destructive/test_ldap_authentication.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@
2020
import pytest
2121

2222
from robottelo.config import settings
23-
from robottelo.constants import CERT_PATH, HAMMER_CONFIG, HAMMER_SESSIONS, LDAP_ATTR
23+
from robottelo.constants import (
24+
CERT_PATH,
25+
HAMMER_CONFIG,
26+
HAMMER_SESSIONS,
27+
LDAP_ATTR,
28+
LOGIN_DELEGATION_LOGOUT_URL,
29+
)
2430
from robottelo.exceptions import CLIReturnCodeError
2531
from robottelo.logging import logger
2632
from robottelo.utils.datafactory import gen_string
@@ -265,6 +271,8 @@ def test_single_sign_on_using_rhsso(
265271
266272
:setup: Enroll the RH-SSO Configuration for External Authentication
267273
274+
:verifies: SAT-40322
275+
268276
:steps:
269277
1. Create Mappers on RHSSO Instance and Update the Settings in Satellite
270278
2. Login into Satellite using RHSSO login page redirected by Satellite
@@ -280,6 +288,24 @@ def test_single_sign_on_using_rhsso(
280288
session.user.search('')
281289
actual_user = session.task.read_all(widget_names="current_user")['current_user']
282290
assert settings.rhsso.rhsso_user in actual_user
291+
# logout verification for SAT-40322
292+
setting_object = module_target_sat.api.Setting().search(
293+
query={'search': 'name=login_delegation_logout_url'}
294+
)[0]
295+
default_setting_value = '' if setting_object.value is None else setting_object.value
296+
setting_object.value = LOGIN_DELEGATION_LOGOUT_URL
297+
setting_object.update({'value'})
298+
try:
299+
session.rhsso_login.logout()
300+
assert session.browser.url == LOGIN_DELEGATION_LOGOUT_URL, (
301+
"Unsuccessful logout redirect"
302+
)
303+
with pytest.raises(NavigationTriesExceeded) as error:
304+
session.task.read_all(widget_names='current_user')['current_user']
305+
assert error.typename == 'NavigationTriesExceeded'
306+
finally:
307+
setting_object.value = default_setting_value
308+
setting_object.update({'value'})
283309

284310

285311
def test_external_logout_rhsso(rhsso_setting_setup, enable_external_auth_rhsso, module_target_sat):

0 commit comments

Comments
 (0)