Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.15.z] Fix Capsule test case for non-admin user #17425

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions tests/foreman/api/test_capsulecontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1786,6 +1786,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 @@ -1797,8 +1798,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 @@ -1808,6 +1810,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
Loading