Skip to content

Commit 93e540b

Browse files
authored
Merge pull request kubernetes#87270 from YuikoTakada/move_skip_e2e_common
Use e2eskipper package in test/e2e/common/
2 parents bae9f61 + afe3d5f commit 93e540b

11 files changed

+31
-20
lines changed

test/e2e/common/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ go_library(
7676
"//test/e2e/framework/node:go_default_library",
7777
"//test/e2e/framework/pod:go_default_library",
7878
"//test/e2e/framework/rc:go_default_library",
79+
"//test/e2e/framework/skipper:go_default_library",
7980
"//test/e2e/framework/volume:go_default_library",
8081
"//test/utils:go_default_library",
8182
"//test/utils/image:go_default_library",

test/e2e/common/configmap_volume.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"k8s.io/apimachinery/pkg/util/uuid"
2929
"k8s.io/kubernetes/test/e2e/framework"
3030
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
31+
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
3132
imageutils "k8s.io/kubernetes/test/utils/image"
3233
)
3334

@@ -56,7 +57,7 @@ var _ = ginkgo.Describe("[sig-storage] ConfigMap", func() {
5657

5758
ginkgo.It("should be consumable from pods in volume as non-root with defaultMode and fsGroup set [LinuxOnly] [NodeFeature:FSGroup]", func() {
5859
// Windows does not support RunAsUser / FSGroup SecurityContext options, and it does not support setting file permissions.
59-
framework.SkipIfNodeOSDistroIs("windows")
60+
e2eskipper.SkipIfNodeOSDistroIs("windows")
6061
defaultMode := int32(0440) /* setting fsGroup sets mode to at least 440 */
6162
doConfigMapE2EWithoutMappings(f, true, 1001, &defaultMode)
6263
})
@@ -72,7 +73,7 @@ var _ = ginkgo.Describe("[sig-storage] ConfigMap", func() {
7273

7374
ginkgo.It("should be consumable from pods in volume as non-root with FSGroup [LinuxOnly] [NodeFeature:FSGroup]", func() {
7475
// Windows does not support RunAsUser / FSGroup SecurityContext options.
75-
framework.SkipIfNodeOSDistroIs("windows")
76+
e2eskipper.SkipIfNodeOSDistroIs("windows")
7677
doConfigMapE2EWithoutMappings(f, true, 1001, nil)
7778
})
7879

@@ -107,7 +108,7 @@ var _ = ginkgo.Describe("[sig-storage] ConfigMap", func() {
107108

108109
ginkgo.It("should be consumable from pods in volume with mappings as non-root with FSGroup [LinuxOnly] [NodeFeature:FSGroup]", func() {
109110
// Windows does not support RunAsUser / FSGroup SecurityContext options.
110-
framework.SkipIfNodeOSDistroIs("windows")
111+
e2eskipper.SkipIfNodeOSDistroIs("windows")
111112
doConfigMapE2EWithMappings(f, true, 1001, nil)
112113
})
113114

test/e2e/common/container_probe.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
"k8s.io/kubernetes/test/e2e/framework"
3232
e2eevents "k8s.io/kubernetes/test/e2e/framework/events"
3333
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
34+
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
3435
testutils "k8s.io/kubernetes/test/utils"
3536

3637
"github.com/onsi/ginkgo"
@@ -212,7 +213,7 @@ var _ = framework.KubeDescribe("Probing container", func() {
212213
*/
213214
ginkgo.It("should be restarted with a docker exec liveness probe with timeout ", func() {
214215
// TODO: enable this test once the default exec handler supports timeout.
215-
framework.Skipf("The default exec handler, dockertools.NativeExecHandler, does not support timeouts due to a limitation in the Docker Remote API")
216+
e2eskipper.Skipf("The default exec handler, dockertools.NativeExecHandler, does not support timeouts due to a limitation in the Docker Remote API")
216217
cmd := []string{"/bin/sh", "-c", "sleep 600"}
217218
livenessProbe := &v1.Probe{
218219
Handler: execHandler([]string{"/bin/sh", "-c", "sleep 10"}),

test/e2e/common/downward_api.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"k8s.io/apimachinery/pkg/util/uuid"
2626
"k8s.io/kubernetes/test/e2e/framework"
2727
e2enetwork "k8s.io/kubernetes/test/e2e/framework/network"
28+
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
2829
imageutils "k8s.io/kubernetes/test/utils/image"
2930

3031
"github.com/onsi/ginkgo"
@@ -288,7 +289,7 @@ var _ = framework.KubeDescribe("Downward API [Serial] [Disruptive] [NodeFeature:
288289

289290
ginkgo.Context("Downward API tests for local ephemeral storage", func() {
290291
ginkgo.BeforeEach(func() {
291-
framework.SkipUnlessLocalEphemeralStorageEnabled()
292+
e2eskipper.SkipUnlessLocalEphemeralStorageEnabled()
292293
})
293294

294295
ginkgo.It("should provide container's limits.ephemeral-storage and requests.ephemeral-storage as env vars", func() {

test/e2e/common/downwardapi_volume.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"k8s.io/apimachinery/pkg/util/uuid"
2727
"k8s.io/kubernetes/test/e2e/framework"
2828
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
29+
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
2930
imageutils "k8s.io/kubernetes/test/utils/image"
3031

3132
"github.com/onsi/ginkgo"
@@ -89,7 +90,7 @@ var _ = ginkgo.Describe("[sig-storage] Downward API volume", func() {
8990

9091
ginkgo.It("should provide podname as non-root with fsgroup [LinuxOnly] [NodeFeature:FSGroup]", func() {
9192
// Windows does not support RunAsUser / FSGroup SecurityContext options.
92-
framework.SkipIfNodeOSDistroIs("windows")
93+
e2eskipper.SkipIfNodeOSDistroIs("windows")
9394
podName := "metadata-volume-" + string(uuid.NewUUID())
9495
gid := int64(1234)
9596
pod := downwardAPIVolumePodForSimpleTest(podName, "/etc/podinfo/podname")
@@ -104,7 +105,7 @@ var _ = ginkgo.Describe("[sig-storage] Downward API volume", func() {
104105

105106
ginkgo.It("should provide podname as non-root with fsgroup and defaultMode [LinuxOnly] [NodeFeature:FSGroup]", func() {
106107
// Windows does not support RunAsUser / FSGroup SecurityContext options, and it does not support setting file permissions.
107-
framework.SkipIfNodeOSDistroIs("windows")
108+
e2eskipper.SkipIfNodeOSDistroIs("windows")
108109
podName := "metadata-volume-" + string(uuid.NewUUID())
109110
gid := int64(1234)
110111
mode := int32(0440) /* setting fsGroup sets mode to at least 440 */

test/e2e/common/empty_dir.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2626
"k8s.io/apimachinery/pkg/util/uuid"
2727
"k8s.io/kubernetes/test/e2e/framework"
28+
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
2829
imageutils "k8s.io/kubernetes/test/utils/image"
2930
)
3031

@@ -44,7 +45,7 @@ var _ = ginkgo.Describe("[sig-storage] EmptyDir volumes", func() {
4445

4546
ginkgo.BeforeEach(func() {
4647
// Windows does not support the FSGroup SecurityContext option.
47-
framework.SkipIfNodeOSDistroIs("windows")
48+
e2eskipper.SkipIfNodeOSDistroIs("windows")
4849
})
4950

5051
ginkgo.It("new files should be created with FSGroup ownership when container is root", func() {

test/e2e/common/projected_configmap.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"k8s.io/apimachinery/pkg/util/uuid"
2626
"k8s.io/kubernetes/test/e2e/framework"
2727
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
28+
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
2829
imageutils "k8s.io/kubernetes/test/utils/image"
2930

3031
"github.com/onsi/ginkgo"
@@ -56,7 +57,7 @@ var _ = ginkgo.Describe("[sig-storage] Projected configMap", func() {
5657

5758
ginkgo.It("should be consumable from pods in volume as non-root with defaultMode and fsGroup set [LinuxOnly] [NodeFeature:FSGroup]", func() {
5859
// Windows does not support RunAsUser / FSGroup SecurityContext options, and it does not support setting file permissions.
59-
framework.SkipIfNodeOSDistroIs("windows")
60+
e2eskipper.SkipIfNodeOSDistroIs("windows")
6061
defaultMode := int32(0440) /* setting fsGroup sets mode to at least 440 */
6162
doProjectedConfigMapE2EWithoutMappings(f, true, 1001, &defaultMode)
6263
})
@@ -72,7 +73,7 @@ var _ = ginkgo.Describe("[sig-storage] Projected configMap", func() {
7273

7374
ginkgo.It("should be consumable from pods in volume as non-root with FSGroup [LinuxOnly] [NodeFeature:FSGroup]", func() {
7475
// Windows does not support RunAsUser / FSGroup SecurityContext options.
75-
framework.SkipIfNodeOSDistroIs("windows")
76+
e2eskipper.SkipIfNodeOSDistroIs("windows")
7677
doProjectedConfigMapE2EWithoutMappings(f, true, 1001, nil)
7778
})
7879

@@ -107,7 +108,7 @@ var _ = ginkgo.Describe("[sig-storage] Projected configMap", func() {
107108

108109
ginkgo.It("should be consumable from pods in volume with mappings as non-root with FSGroup [LinuxOnly] [NodeFeature:FSGroup]", func() {
109110
// Windows does not support RunAsUser / FSGroup SecurityContext options.
110-
framework.SkipIfNodeOSDistroIs("windows")
111+
e2eskipper.SkipIfNodeOSDistroIs("windows")
111112
doProjectedConfigMapE2EWithMappings(f, true, 1001, nil)
112113
})
113114

test/e2e/common/projected_downwardapi.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"k8s.io/apimachinery/pkg/util/uuid"
2626
"k8s.io/kubernetes/test/e2e/framework"
2727
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
28+
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
2829
imageutils "k8s.io/kubernetes/test/utils/image"
2930

3031
"github.com/onsi/ginkgo"
@@ -89,7 +90,7 @@ var _ = ginkgo.Describe("[sig-storage] Projected downwardAPI", func() {
8990

9091
ginkgo.It("should provide podname as non-root with fsgroup [LinuxOnly] [NodeFeature:FSGroup]", func() {
9192
// Windows does not support RunAsUser / FSGroup SecurityContext options.
92-
framework.SkipIfNodeOSDistroIs("windows")
93+
e2eskipper.SkipIfNodeOSDistroIs("windows")
9394
podName := "metadata-volume-" + string(uuid.NewUUID())
9495
gid := int64(1234)
9596
pod := downwardAPIVolumePodForSimpleTest(podName, "/etc/podinfo/podname")
@@ -104,7 +105,7 @@ var _ = ginkgo.Describe("[sig-storage] Projected downwardAPI", func() {
104105

105106
ginkgo.It("should provide podname as non-root with fsgroup and defaultMode [LinuxOnly] [NodeFeature:FSGroup]", func() {
106107
// Windows does not support RunAsUser / FSGroup SecurityContext options, and it does not support setting file permissions.
107-
framework.SkipIfNodeOSDistroIs("windows")
108+
e2eskipper.SkipIfNodeOSDistroIs("windows")
108109
podName := "metadata-volume-" + string(uuid.NewUUID())
109110
gid := int64(1234)
110111
mode := int32(0440) /* setting fsGroup sets mode to at least 440 */

test/e2e/common/security_context.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"k8s.io/kubernetes/pkg/kubelet/events"
2828
"k8s.io/kubernetes/test/e2e/framework"
2929
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
30+
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
3031
imageutils "k8s.io/kubernetes/test/utils/image"
3132
"k8s.io/utils/pointer"
3233

@@ -122,7 +123,7 @@ var _ = framework.KubeDescribe("Security Context", func() {
122123

123124
ginkgo.It("should run with an explicit non-root user ID [LinuxOnly]", func() {
124125
// creates a pod with RunAsUser, which is not supported on Windows.
125-
framework.SkipIfNodeOSDistroIs("windows")
126+
e2eskipper.SkipIfNodeOSDistroIs("windows")
126127
name := "explicit-nonroot-uid"
127128
pod := makeNonRootPod(name, rootImage, pointer.Int64Ptr(nonRootTestUserID))
128129
podClient.Create(pod)
@@ -132,7 +133,7 @@ var _ = framework.KubeDescribe("Security Context", func() {
132133
})
133134
ginkgo.It("should not run with an explicit root user ID [LinuxOnly]", func() {
134135
// creates a pod with RunAsUser, which is not supported on Windows.
135-
framework.SkipIfNodeOSDistroIs("windows")
136+
e2eskipper.SkipIfNodeOSDistroIs("windows")
136137
name := "explicit-root-uid"
137138
pod := makeNonRootPod(name, nonRootImage, pointer.Int64Ptr(0))
138139
pod = podClient.Create(pod)

test/e2e/common/sysctl.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"k8s.io/kubernetes/pkg/kubelet/sysctl"
2424
"k8s.io/kubernetes/test/e2e/framework"
2525
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
26+
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
2627
imageutils "k8s.io/kubernetes/test/utils/image"
2728

2829
"github.com/onsi/ginkgo"
@@ -33,7 +34,7 @@ var _ = framework.KubeDescribe("Sysctls [LinuxOnly] [NodeFeature:Sysctls]", func
3334

3435
ginkgo.BeforeEach(func() {
3536
// sysctl is not supported on Windows.
36-
framework.SkipIfNodeOSDistroIs("windows")
37+
e2eskipper.SkipIfNodeOSDistroIs("windows")
3738
})
3839

3940
f := framework.NewDefaultFramework("sysctl")
@@ -86,7 +87,7 @@ var _ = framework.KubeDescribe("Sysctls [LinuxOnly] [NodeFeature:Sysctls]", func
8687
ev, err := f.PodClient().WaitForErrorEventOrSuccess(pod)
8788
framework.ExpectNoError(err)
8889
if ev != nil && ev.Reason == sysctl.UnsupportedReason {
89-
framework.Skipf("No sysctl support in Docker <1.12")
90+
e2eskipper.Skipf("No sysctl support in Docker <1.12")
9091
}
9192
gomega.Expect(ev).To(gomega.BeNil())
9293

@@ -129,7 +130,7 @@ var _ = framework.KubeDescribe("Sysctls [LinuxOnly] [NodeFeature:Sysctls]", func
129130
ev, err := f.PodClient().WaitForErrorEventOrSuccess(pod)
130131
framework.ExpectNoError(err)
131132
if ev != nil && ev.Reason == sysctl.UnsupportedReason {
132-
framework.Skipf("No sysctl support in Docker <1.12")
133+
e2eskipper.Skipf("No sysctl support in Docker <1.12")
133134
}
134135
gomega.Expect(ev).To(gomega.BeNil())
135136

@@ -206,7 +207,7 @@ var _ = framework.KubeDescribe("Sysctls [LinuxOnly] [NodeFeature:Sysctls]", func
206207
ev, err := f.PodClient().WaitForErrorEventOrSuccess(pod)
207208
framework.ExpectNoError(err)
208209
if ev != nil && ev.Reason == sysctl.UnsupportedReason {
209-
framework.Skipf("No sysctl support in Docker <1.12")
210+
e2eskipper.Skipf("No sysctl support in Docker <1.12")
210211
}
211212

212213
ginkgo.By("Checking that the pod was rejected")

0 commit comments

Comments
 (0)