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

Add tests for remove-user with a rolebinding name #18602

Merged
merged 1 commit into from
Feb 14, 2018
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: 12 additions & 0 deletions test/cmd/policy.sh
Original file line number Diff line number Diff line change
@@ -69,6 +69,18 @@ os::cmd::expect_failure_and_text 'oc get rolebinding/cluster-admin --no-headers'
os::cmd::expect_success 'oc policy remove-group system:unauthenticated'
os::cmd::expect_success 'oc policy remove-user system:no-user'

# Test failure to mix and mismatch role/rolebiding removal
os::cmd::expect_success 'oc login -u local-admin -p pw'
os::cmd::expect_success 'oc new-project mismatch-prj'
os::cmd::expect_success 'oc create rolebinding match --clusterrole=admin --user=user'
os::cmd::expect_success 'oc create rolebinding mismatch --clusterrole=edit --user=user'
os::cmd::expect_failure_and_text 'oc policy remove-role-from-user admin user --rolebinding-name mismatch' 'rolebinding mismatch'
os::cmd::expect_success_and_text 'oc policy remove-user user' 'user'
os::cmd::expect_failure_and_text 'oc get rolebinding mismatch --no-headers' 'NotFound'
os::cmd::expect_failure_and_text 'oc get rolebinding match --no-headers' 'NotFound'
os::cmd::expect_success "oc login -u system:admin -n '${project}'"
os::cmd::expect_success 'oc delete project mismatch-prj'

# check to make sure that our SCC policies don't prevent GC from deleting pods
os::cmd::expect_success 'oc create -f ${OS_ROOT}/test/testdata/privileged-pod.yaml'
os::cmd::expect_success 'oc delete pod/test-build-pod-issue --cascade=false'