Skip to content

Commit

Permalink
Merge pull request #1212 from s-urbaniak/fix-e2e-tests
Browse files Browse the repository at this point in the history
UPSTREAM: 106454: test/e2e: fix e2e tests for restricted policy
  • Loading branch information
openshift-merge-robot committed Mar 21, 2022
2 parents 02aefbf + 4bf9a12 commit b085777
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/e2e/apimachinery/resource_quota.go
Expand Up @@ -917,6 +917,7 @@ var _ = SIGDescribe("ResourceQuota", func() {

var _ = SIGDescribe("ResourceQuota [Feature:ScopeSelectors]", func() {
f := framework.NewDefaultFramework("scope-selectors")
f.NamespacePodSecurityEnforceLevel = admissionapi.LevelBaseline
ginkgo.It("should verify ResourceQuota with best effort scope using scope-selectors.", func() {
ginkgo.By("Creating a ResourceQuota with best effort scope")
resourceQuotaBestEffort, err := createResourceQuota(f.ClientSet, f.Namespace.Name, newTestResourceQuotaWithScopeSelector("quota-besteffort", v1.ResourceQuotaScopeBestEffort))
Expand Down Expand Up @@ -1097,6 +1098,7 @@ var _ = SIGDescribe("ResourceQuota [Feature:ScopeSelectors]", func() {

var _ = SIGDescribe("ResourceQuota [Feature:PodPriority]", func() {
f := framework.NewDefaultFramework("resourcequota-priorityclass")
f.NamespacePodSecurityEnforceLevel = admissionapi.LevelBaseline

ginkgo.It("should verify ResourceQuota's priority class scope (quota set to pod count: 1) against a pod with same priority class.", func() {

Expand Down
2 changes: 2 additions & 0 deletions test/e2e/auth/node_authn.go
Expand Up @@ -26,6 +26,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/cluster/ports"
"k8s.io/kubernetes/test/e2e/framework"
admissionapi "k8s.io/pod-security-admission/api"

"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
Expand All @@ -36,6 +37,7 @@ import (
var _ = SIGDescribe("[Feature:NodeAuthenticator]", func() {

f := framework.NewDefaultFramework("node-authn")
f.NamespacePodSecurityEnforceLevel = admissionapi.LevelBaseline
var ns string
var nodeIPs []string
ginkgo.BeforeEach(func() {
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/auth/node_authz.go
Expand Up @@ -29,6 +29,7 @@ import (
restclient "k8s.io/client-go/rest"
"k8s.io/kubernetes/test/e2e/framework"
imageutils "k8s.io/kubernetes/test/utils/image"
admissionapi "k8s.io/pod-security-admission/api"

"github.com/onsi/ginkgo"
)
Expand All @@ -41,6 +42,7 @@ const (
var _ = SIGDescribe("[Feature:NodeAuthorizer]", func() {

f := framework.NewDefaultFramework("node-authz")
f.NamespacePodSecurityEnforceLevel = admissionapi.LevelBaseline
// client that will impersonate a node
var c clientset.Interface
var ns string
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/autoscaling/horizontal_pod_autoscaling.go
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package autoscaling

import (
"k8s.io/pod-security-admission/api"
"time"

"k8s.io/apimachinery/pkg/runtime/schema"
Expand All @@ -30,6 +31,7 @@ import (
//
var _ = SIGDescribe("[Feature:HPA] Horizontal pod autoscaling (scale resource: CPU)", func() {
f := framework.NewDefaultFramework("horizontal-pod-autoscaling")
f.NamespacePodSecurityEnforceLevel = api.LevelBaseline

titleUp := "Should scale from 1 pod to 3 pods and from 3 to 5"
titleDown := "Should scale from 5 pods to 3 pods and from 3 to 1"
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/node/examples.go
Expand Up @@ -34,6 +34,7 @@ import (
e2eauth "k8s.io/kubernetes/test/e2e/framework/auth"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
e2etestfiles "k8s.io/kubernetes/test/e2e/framework/testfiles"
admissionapi "k8s.io/pod-security-admission/api"

"github.com/onsi/ginkgo"
)
Expand All @@ -44,6 +45,7 @@ const (

var _ = SIGDescribe("[Feature:Example]", func() {
f := framework.NewDefaultFramework("examples")
f.NamespacePodSecurityEnforceLevel = admissionapi.LevelBaseline

var c clientset.Interface
var ns string
Expand Down

0 comments on commit b085777

Please sign in to comment.