Skip to content

Commit

Permalink
fix in test_permission (#13879)
Browse files Browse the repository at this point in the history
(cherry picked from commit fff14fc)
  • Loading branch information
pondrejk committed Mar 19, 2024
1 parent 10412af commit 94162d4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/foreman/destructive/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
from robottelo.constants import HAMMER_CONFIG

LOGEDIN_MSG = "Session exists, currently logged in as '{0}'"
LOGEDOFF_MSG = "Using sessions, you are currently not logged in"
NOTCONF_MSG = "Credentials are not configured."
password = gen_string('alpha')
pytestmark = pytest.mark.destructive

Expand All @@ -36,7 +34,7 @@ def test_positive_password_reset(target_sat):
"""
result = target_sat.execute('foreman-rake permissions:reset')
assert result.status == 0
reset_password = result.stdout.splitlines()[0].split('password: ')[1]
reset_password = result.stdout.splitlines()[1].split('password: ')[1]
result = target_sat.execute(
f'''sed -i -e '/username/d;/password/d;/use_sessions/d' {HAMMER_CONFIG};\
echo ' :use_sessions: true' >> {HAMMER_CONFIG}'''
Expand All @@ -46,5 +44,5 @@ def test_positive_password_reset(target_sat):
{'username': settings.server.admin_username, 'password': reset_password}
)
result = target_sat.cli.Auth.with_user().status()
assert LOGEDIN_MSG.format(settings.server.admin_username) in result[0]['message']
assert LOGEDIN_MSG.format(settings.server.admin_username) in result.split("\n")[1]
assert target_sat.cli.Org.with_user().list()

0 comments on commit 94162d4

Please sign in to comment.