Skip to content

Commit

Permalink
Fix Capsule test case for non-admin user (#17422)
Browse files Browse the repository at this point in the history
(cherry picked from commit 32a07be)
  • Loading branch information
vsedmik authored and web-flow committed Jan 23, 2025
1 parent a3a308a commit 685bf2c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/foreman/api/test_capsulecontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1912,6 +1912,7 @@ def test_positive_read_with_non_admin_user(
target_sat,
module_capsule_configured,
default_org,
default_location,
default_non_admin_user,
):
"""Try to list and read Capsules with a non-admin user with and without permissions.
Expand All @@ -1923,8 +1924,9 @@ def test_positive_read_with_non_admin_user(
2. Non-admin user without any roles/permissions.
:steps:
1. Using the non-admin user try to list all or particular Capsule.
2. Add Viewer role to the user and try again.
1. Assign the capsule to the default org/loc so it can be searched and found.
2. Using the non-admin user try to list all or particular Capsule.
3. Add Viewer role to the user and try again.
:expectedresults:
1. Read should fail without Viewer role.
Expand All @@ -1934,6 +1936,12 @@ def test_positive_read_with_non_admin_user(
:customerscenario: true
"""
# Assign the capsule to the default org/loc so it can be searched and found.
nc = module_capsule_configured.nailgun_smart_proxy
target_sat.api.SmartProxy(
id=nc.id, organization=[default_org], location=[default_location]
).update(['organization', 'location'])

# Using the non-admin user try to list all or particular Capsule
user = default_non_admin_user
sc = ServerConfig(
Expand Down

0 comments on commit 685bf2c

Please sign in to comment.