Skip to content

Commit a4d510f

Browse files
pondrejkrmynar
authored andcommitted
check logout redirection (SatelliteQE#20718)
(cherry picked from commit 90b1295)
1 parent ae274a6 commit a4d510f

2 files changed

Lines changed: 24 additions & 2 deletions

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: 22 additions & 2 deletions
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
@@ -256,15 +262,23 @@ def test_single_sign_on_ldap_ad_server(
256262
assert f'{target_sat.url}/new/hosts' in result.stdout
257263

258264

265+
@pytest.mark.parametrize(
266+
'setting_update',
267+
[f'login_delegation_logout_url={LOGIN_DELEGATION_LOGOUT_URL}'],
268+
ids=["external_redirect"],
269+
indirect=True,
270+
)
259271
def test_single_sign_on_using_rhsso(
260-
enable_external_auth_rhsso, rhsso_setting_setup, module_target_sat
272+
enable_external_auth_rhsso, rhsso_setting_setup, module_target_sat, setting_update
261273
):
262274
"""Verify the single sign-on functionality with external authentication RH-SSO
263275
264276
:id: 18a77de8-570f-11ea-a202-d46d6dd3b5b2
265277
266278
:setup: Enroll the RH-SSO Configuration for External Authentication
267279
280+
:verifies: SAT-40322
281+
268282
:steps:
269283
1. Create Mappers on RHSSO Instance and Update the Settings in Satellite
270284
2. Login into Satellite using RHSSO login page redirected by Satellite
@@ -280,6 +294,12 @@ def test_single_sign_on_using_rhsso(
280294
session.user.search('')
281295
actual_user = session.task.read_all(widget_names="current_user")['current_user']
282296
assert settings.rhsso.rhsso_user in actual_user
297+
# logout verification for SAT-40322
298+
session.rhsso_login.logout()
299+
assert session.browser.url == LOGIN_DELEGATION_LOGOUT_URL, "Unsuccessful logout redirect"
300+
with pytest.raises(NavigationTriesExceeded) as error:
301+
session.task.read_all(widget_names='current_user')['current_user']
302+
assert error.typename == 'NavigationTriesExceeded'
283303

284304

285305
def test_external_logout_rhsso(rhsso_setting_setup, enable_external_auth_rhsso, module_target_sat):

0 commit comments

Comments
 (0)