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 some cmd-test for oc policy scc-subject-review/scc-review #16122

Merged
merged 1 commit into from
Sep 14, 2017

Conversation

shiywang
Copy link

@shiywang shiywang commented Sep 4, 2017

this is a testcase enhance from OCP-12839
@soltysh @stuartchuan @akostadinov ptal

@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 4, 2017
@bparees
Copy link
Contributor

bparees commented Sep 4, 2017

/unassign

@shiywang
Copy link
Author

shiywang commented Sep 5, 2017

/test cmd

@akostadinov
Copy link
Contributor

btw if only unit tests are added and they pass, but some other unit tests fail, then they should be ignored [1]. I'm not sure this is the case here. Just saying no need to retest until everything pass when only some unstable units are failing.

[1] or probably reported somewhere as flakes

@danwinship
Copy link
Contributor

/unassign
/assign @stevekuznetsov
(I should remove myself from this OWNERS file... the patch looks fine to me, but I don't feel like I know test/cmd enough that I should be approving people's changes to it.)

@stevekuznetsov
Copy link
Contributor

/lgtm
/retest

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 5, 2017
@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 5, 2017
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@shiywang
Copy link
Author

shiywang commented Sep 6, 2017

/test extended_conformance_gce

@brenton
Copy link
Contributor

brenton commented Sep 6, 2017

@deads2k, would you be able to give a quick review of this PR? QE would like to upstream some of their tests.

@@ -105,6 +105,7 @@ os::cmd::expect_success_and_text 'oc policy can-i --list --user harold --groups

os::cmd::expect_failure 'oc policy scc-subject-review'
os::cmd::expect_failure 'oc policy scc-review'
os::cmd::expect_failure 'oc policy scc-subject-review -u invalid --namespace=noexist'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ones above failed on arg problems, but this one is probably failing on something else. Add a text check.

Copy link
Author

@shiywang shiywang Sep 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, sorry, I think this is just another arg check case, because inputfile in this command is required.

if len(args) == 0 && len(o.FilenameOptions.Filenames) == 0 {

os::cmd::expect_success 'oc create -f ${OS_ROOT}/test/testdata/scc_lax.yaml'
os::cmd::expect_success "oc login -u bob -p bobpassword"
os::cmd::expect_success_and_text 'oc policy scc-review -f ${OS_ROOT}/test/testdata/job.yaml --no-headers=true' 'Job/hello default lax'
os::cmd::expect_success_and_text 'oc policy scc-review -z default -f ${OS_ROOT}/test/testdata/job.yaml --no-headers=true' 'Job/hello default lax'
os::cmd::expect_success_and_text 'oc policy scc-review -z system:serviceaccount:policy-second:default -f ${OS_ROOT}/test/testdata/job.yaml --no-headers=true' 'Job/hello default lax'
os::cmd::expect_success_and_text 'oc policy scc-review -f ${OS_ROOT}/test/extended/testdata/deployments/deployment-simple.yaml --no-headers=true' 'DeploymentConfig/deployment-simple default lax'
os::cmd::expect_success_and_text 'oc policy scc-review -f ${OS_ROOT}/test/testdata/nginx_pod.yaml --no-headers=true' ''
os::cmd::expect_failure_and_text 'oc policy scc-review -z default -f ${OS_ROOT}/test/testdata/job.yaml --namespace=no-exist' 'error: unable to compute Pod Security Policy Review for "hello": User "bob" cannot create podsecuritypolicyreviews in project "no-exist"'
os::cmd::expect_failure_and_text 'oc policy scc-review -z default -f ${OS_ROOT}/test/testdata/pspreview_unsupported_statefulset.yaml' 'error: StatefulSet "rd" with spec.volumeClaimTemplates currently not supported.'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like a bug. Any idea why we don't support it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like a bug. Any idea why we don't support it?

hmmm... maybe we don't know how to complete it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine, we don't support stateful sets, see line 109 and 112 for same errors.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine, we don't support stateful sets, see line 109 and 112 for same errors.

Why don't we? Is not possible given the info?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe at the time of writing it we didn't. It's worth double checking now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's your answer:

// TODO remove this as soon upstream statefulSet validation for podSpec is fixed.
I'm checking this right now and will open a PR shortly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it's still not fixed upstream, either: https://github.com/kubernetes/kubernetes/blob/ea017719e52138263cb6e82eff8652cdd465d322/pkg/apis/apps/validation/validation.go#L57 so I don't think we can fix it on our end as well.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@soltysh are you working on this? if not, I would like to take a look : )

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to pick it up.

@deads2k
Copy link
Contributor

deads2k commented Sep 6, 2017

@deads2k, would you be able to give a quick review of this PR? QE would like to upstream some of their tests.

Looks ok. Needs a squash and maybe a comment or two.

Seems like you might want your own files to make sure that they don't get scrubbed away by accident. Something you're an owner/approver on.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@stevekuznetsov
Copy link
Contributor

/lgtm cancel

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Sep 6, 2017
@openshift-merge-robot openshift-merge-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 6, 2017
@shiywang
Copy link
Author

shiywang commented Sep 8, 2017

@soltysh @deads2k squashed, ptal, thanks

@shiywang
Copy link
Author

shiywang commented Sep 11, 2017

hi @soltysh I met a really weird problem, in this line : https://github.com/openshift/origin/pull/16122/files#diff-9a8e8ef8bf78b44957b8d3a6c9163dbdR144

previously the failed error message was podsecuritypolicyreviews in project "no-exist" and it passed.
but yesterday it failed, and the error message change to podsecuritypolicyreviews in the namespace "no-exist"', should we use project instead of namespace, right ?

@akostadinov I think this is a typical reason why we should move those checks into upstream.

@soltysh
Copy link
Contributor

soltysh commented Sep 11, 2017

but yesterday it failed, and the error message change to podsecuritypolicyreviews in the namespace "no-exist"', should we use project instead of namespace, right ?

Yes, that changed just recently.

@soltysh
Copy link
Contributor

soltysh commented Sep 11, 2017

/assign

@soltysh
Copy link
Contributor

soltysh commented Sep 11, 2017

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 11, 2017
@shiywang
Copy link
Author

ping @stevekuznetsov for approval

@stevekuznetsov
Copy link
Contributor

/approve

@openshift-merge-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: shiywang, soltysh, stevekuznetsov

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 12, 2017
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@shiywang
Copy link
Author

/retest

3 similar comments
@shiywang
Copy link
Author

/retest

@shiywang
Copy link
Author

/retest

@stevekuznetsov
Copy link
Contributor

/retest

@soltysh
Copy link
Contributor

soltysh commented Sep 13, 2017

No need to retest, this is blocked on #16323

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue

@openshift-merge-robot openshift-merge-robot merged commit 8417ef5 into openshift:master Sep 14, 2017
@shiywang shiywang deleted the test-extend branch September 14, 2017 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.