Skip to content

Commit

Permalink
Fix condition in Leapp test for non-admin
Browse files Browse the repository at this point in the history
Signed-off-by: Gaurav Talreja <gtalreja@redhat.com>
  • Loading branch information
Gauravtalreja1 committed Sep 20, 2024
1 parent 48c081e commit 8936e28
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/foreman/cli/test_leapp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
f'_to_{upgrade_path["target_version"]}',
)
@pytest.mark.parametrize('auth_type', ['admin', 'non-admin'])
def test_leapp_upgrade_rhel(
def test_positive_leapp_upgrade_rhel(
request,
module_target_sat,
custom_leapp_host,
Expand Down Expand Up @@ -62,7 +62,7 @@ def test_leapp_upgrade_rhel(
login = settings.server.admin_username
password = settings.server.admin_password
org = module_sca_manifest_org
if 'auth_type' == 'non-admin':
if auth_type == 'non-admin':
login = gen_string('alpha')
roles = ['Organization admin', 'Remote Execution Manager', 'Remote Execution User']
user = module_target_sat.cli_factory.user(
Expand All @@ -73,7 +73,7 @@ def test_leapp_upgrade_rhel(
'organization-ids': org.id,
}
)
request.addfinalizer(user.delete)
request.addfinalizer(lambda: module_target_sat.cli.User.delete({'login': user.login}))
for role in roles:
module_target_sat.cli.User.add_role({'id': user['id'], 'login': login, 'role': role})
# Workaround for https://issues.redhat.com/browse/RHEL-55871
Expand Down

0 comments on commit 8936e28

Please sign in to comment.