mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Use e2eskipper package in test/e2e/common/
This commit is contained in:
parent
5d1c301610
commit
afe3d5f09f
@ -76,6 +76,7 @@ go_library(
|
||||
"//test/e2e/framework/node:go_default_library",
|
||||
"//test/e2e/framework/pod:go_default_library",
|
||||
"//test/e2e/framework/rc:go_default_library",
|
||||
"//test/e2e/framework/skipper:go_default_library",
|
||||
"//test/e2e/framework/volume:go_default_library",
|
||||
"//test/utils:go_default_library",
|
||||
"//test/utils/image:go_default_library",
|
||||
|
@ -27,6 +27,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/util/uuid"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||
)
|
||||
|
||||
@ -55,7 +56,7 @@ var _ = ginkgo.Describe("[sig-storage] ConfigMap", func() {
|
||||
|
||||
ginkgo.It("should be consumable from pods in volume as non-root with defaultMode and fsGroup set [LinuxOnly] [NodeFeature:FSGroup]", func() {
|
||||
// Windows does not support RunAsUser / FSGroup SecurityContext options, and it does not support setting file permissions.
|
||||
framework.SkipIfNodeOSDistroIs("windows")
|
||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||
defaultMode := int32(0440) /* setting fsGroup sets mode to at least 440 */
|
||||
doConfigMapE2EWithoutMappings(f, true, 1001, &defaultMode)
|
||||
})
|
||||
@ -71,7 +72,7 @@ var _ = ginkgo.Describe("[sig-storage] ConfigMap", func() {
|
||||
|
||||
ginkgo.It("should be consumable from pods in volume as non-root with FSGroup [LinuxOnly] [NodeFeature:FSGroup]", func() {
|
||||
// Windows does not support RunAsUser / FSGroup SecurityContext options.
|
||||
framework.SkipIfNodeOSDistroIs("windows")
|
||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||
doConfigMapE2EWithoutMappings(f, true, 1001, nil)
|
||||
})
|
||||
|
||||
@ -106,7 +107,7 @@ var _ = ginkgo.Describe("[sig-storage] ConfigMap", func() {
|
||||
|
||||
ginkgo.It("should be consumable from pods in volume with mappings as non-root with FSGroup [LinuxOnly] [NodeFeature:FSGroup]", func() {
|
||||
// Windows does not support RunAsUser / FSGroup SecurityContext options.
|
||||
framework.SkipIfNodeOSDistroIs("windows")
|
||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||
doConfigMapE2EWithMappings(f, true, 1001, nil)
|
||||
})
|
||||
|
||||
|
@ -31,6 +31,7 @@ import (
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
e2eevents "k8s.io/kubernetes/test/e2e/framework/events"
|
||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||
testutils "k8s.io/kubernetes/test/utils"
|
||||
|
||||
"github.com/onsi/ginkgo"
|
||||
@ -212,7 +213,7 @@ var _ = framework.KubeDescribe("Probing container", func() {
|
||||
*/
|
||||
ginkgo.It("should be restarted with a docker exec liveness probe with timeout ", func() {
|
||||
// TODO: enable this test once the default exec handler supports timeout.
|
||||
framework.Skipf("The default exec handler, dockertools.NativeExecHandler, does not support timeouts due to a limitation in the Docker Remote API")
|
||||
e2eskipper.Skipf("The default exec handler, dockertools.NativeExecHandler, does not support timeouts due to a limitation in the Docker Remote API")
|
||||
cmd := []string{"/bin/sh", "-c", "sleep 600"}
|
||||
livenessProbe := &v1.Probe{
|
||||
Handler: execHandler([]string{"/bin/sh", "-c", "sleep 10"}),
|
||||
|
@ -25,6 +25,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/util/uuid"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
e2enetwork "k8s.io/kubernetes/test/e2e/framework/network"
|
||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||
|
||||
"github.com/onsi/ginkgo"
|
||||
@ -288,7 +289,7 @@ var _ = framework.KubeDescribe("Downward API [Serial] [Disruptive] [NodeFeature:
|
||||
|
||||
ginkgo.Context("Downward API tests for local ephemeral storage", func() {
|
||||
ginkgo.BeforeEach(func() {
|
||||
framework.SkipUnlessLocalEphemeralStorageEnabled()
|
||||
e2eskipper.SkipUnlessLocalEphemeralStorageEnabled()
|
||||
})
|
||||
|
||||
ginkgo.It("should provide container's limits.ephemeral-storage and requests.ephemeral-storage as env vars", func() {
|
||||
|
@ -26,6 +26,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/util/uuid"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||
|
||||
"github.com/onsi/ginkgo"
|
||||
@ -89,7 +90,7 @@ var _ = ginkgo.Describe("[sig-storage] Downward API volume", func() {
|
||||
|
||||
ginkgo.It("should provide podname as non-root with fsgroup [LinuxOnly] [NodeFeature:FSGroup]", func() {
|
||||
// Windows does not support RunAsUser / FSGroup SecurityContext options.
|
||||
framework.SkipIfNodeOSDistroIs("windows")
|
||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||
podName := "metadata-volume-" + string(uuid.NewUUID())
|
||||
gid := int64(1234)
|
||||
pod := downwardAPIVolumePodForSimpleTest(podName, "/etc/podinfo/podname")
|
||||
@ -104,7 +105,7 @@ var _ = ginkgo.Describe("[sig-storage] Downward API volume", func() {
|
||||
|
||||
ginkgo.It("should provide podname as non-root with fsgroup and defaultMode [LinuxOnly] [NodeFeature:FSGroup]", func() {
|
||||
// Windows does not support RunAsUser / FSGroup SecurityContext options, and it does not support setting file permissions.
|
||||
framework.SkipIfNodeOSDistroIs("windows")
|
||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||
podName := "metadata-volume-" + string(uuid.NewUUID())
|
||||
gid := int64(1234)
|
||||
mode := int32(0440) /* setting fsGroup sets mode to at least 440 */
|
||||
|
@ -25,6 +25,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/uuid"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||
)
|
||||
|
||||
@ -44,7 +45,7 @@ var _ = ginkgo.Describe("[sig-storage] EmptyDir volumes", func() {
|
||||
|
||||
ginkgo.BeforeEach(func() {
|
||||
// Windows does not support the FSGroup SecurityContext option.
|
||||
framework.SkipIfNodeOSDistroIs("windows")
|
||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||
})
|
||||
|
||||
ginkgo.It("new files should be created with FSGroup ownership when container is root", func() {
|
||||
|
@ -25,6 +25,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/util/uuid"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||
|
||||
"github.com/onsi/ginkgo"
|
||||
@ -56,7 +57,7 @@ var _ = ginkgo.Describe("[sig-storage] Projected configMap", func() {
|
||||
|
||||
ginkgo.It("should be consumable from pods in volume as non-root with defaultMode and fsGroup set [LinuxOnly] [NodeFeature:FSGroup]", func() {
|
||||
// Windows does not support RunAsUser / FSGroup SecurityContext options, and it does not support setting file permissions.
|
||||
framework.SkipIfNodeOSDistroIs("windows")
|
||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||
defaultMode := int32(0440) /* setting fsGroup sets mode to at least 440 */
|
||||
doProjectedConfigMapE2EWithoutMappings(f, true, 1001, &defaultMode)
|
||||
})
|
||||
@ -72,7 +73,7 @@ var _ = ginkgo.Describe("[sig-storage] Projected configMap", func() {
|
||||
|
||||
ginkgo.It("should be consumable from pods in volume as non-root with FSGroup [LinuxOnly] [NodeFeature:FSGroup]", func() {
|
||||
// Windows does not support RunAsUser / FSGroup SecurityContext options.
|
||||
framework.SkipIfNodeOSDistroIs("windows")
|
||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||
doProjectedConfigMapE2EWithoutMappings(f, true, 1001, nil)
|
||||
})
|
||||
|
||||
@ -107,7 +108,7 @@ var _ = ginkgo.Describe("[sig-storage] Projected configMap", func() {
|
||||
|
||||
ginkgo.It("should be consumable from pods in volume with mappings as non-root with FSGroup [LinuxOnly] [NodeFeature:FSGroup]", func() {
|
||||
// Windows does not support RunAsUser / FSGroup SecurityContext options.
|
||||
framework.SkipIfNodeOSDistroIs("windows")
|
||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||
doProjectedConfigMapE2EWithMappings(f, true, 1001, nil)
|
||||
})
|
||||
|
||||
|
@ -25,6 +25,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/util/uuid"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||
|
||||
"github.com/onsi/ginkgo"
|
||||
@ -89,7 +90,7 @@ var _ = ginkgo.Describe("[sig-storage] Projected downwardAPI", func() {
|
||||
|
||||
ginkgo.It("should provide podname as non-root with fsgroup [LinuxOnly] [NodeFeature:FSGroup]", func() {
|
||||
// Windows does not support RunAsUser / FSGroup SecurityContext options.
|
||||
framework.SkipIfNodeOSDistroIs("windows")
|
||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||
podName := "metadata-volume-" + string(uuid.NewUUID())
|
||||
gid := int64(1234)
|
||||
pod := downwardAPIVolumePodForSimpleTest(podName, "/etc/podinfo/podname")
|
||||
@ -104,7 +105,7 @@ var _ = ginkgo.Describe("[sig-storage] Projected downwardAPI", func() {
|
||||
|
||||
ginkgo.It("should provide podname as non-root with fsgroup and defaultMode [LinuxOnly] [NodeFeature:FSGroup]", func() {
|
||||
// Windows does not support RunAsUser / FSGroup SecurityContext options, and it does not support setting file permissions.
|
||||
framework.SkipIfNodeOSDistroIs("windows")
|
||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||
podName := "metadata-volume-" + string(uuid.NewUUID())
|
||||
gid := int64(1234)
|
||||
mode := int32(0440) /* setting fsGroup sets mode to at least 440 */
|
||||
|
@ -27,6 +27,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/kubelet/events"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||
"k8s.io/utils/pointer"
|
||||
|
||||
@ -122,7 +123,7 @@ var _ = framework.KubeDescribe("Security Context", func() {
|
||||
|
||||
ginkgo.It("should run with an explicit non-root user ID [LinuxOnly]", func() {
|
||||
// creates a pod with RunAsUser, which is not supported on Windows.
|
||||
framework.SkipIfNodeOSDistroIs("windows")
|
||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||
name := "explicit-nonroot-uid"
|
||||
pod := makeNonRootPod(name, rootImage, pointer.Int64Ptr(nonRootTestUserID))
|
||||
podClient.Create(pod)
|
||||
@ -132,7 +133,7 @@ var _ = framework.KubeDescribe("Security Context", func() {
|
||||
})
|
||||
ginkgo.It("should not run with an explicit root user ID [LinuxOnly]", func() {
|
||||
// creates a pod with RunAsUser, which is not supported on Windows.
|
||||
framework.SkipIfNodeOSDistroIs("windows")
|
||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||
name := "explicit-root-uid"
|
||||
pod := makeNonRootPod(name, nonRootImage, pointer.Int64Ptr(0))
|
||||
pod = podClient.Create(pod)
|
||||
|
@ -23,6 +23,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/kubelet/sysctl"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||
|
||||
"github.com/onsi/ginkgo"
|
||||
@ -33,7 +34,7 @@ var _ = framework.KubeDescribe("Sysctls [LinuxOnly] [NodeFeature:Sysctls]", func
|
||||
|
||||
ginkgo.BeforeEach(func() {
|
||||
// sysctl is not supported on Windows.
|
||||
framework.SkipIfNodeOSDistroIs("windows")
|
||||
e2eskipper.SkipIfNodeOSDistroIs("windows")
|
||||
})
|
||||
|
||||
f := framework.NewDefaultFramework("sysctl")
|
||||
@ -86,7 +87,7 @@ var _ = framework.KubeDescribe("Sysctls [LinuxOnly] [NodeFeature:Sysctls]", func
|
||||
ev, err := f.PodClient().WaitForErrorEventOrSuccess(pod)
|
||||
framework.ExpectNoError(err)
|
||||
if ev != nil && ev.Reason == sysctl.UnsupportedReason {
|
||||
framework.Skipf("No sysctl support in Docker <1.12")
|
||||
e2eskipper.Skipf("No sysctl support in Docker <1.12")
|
||||
}
|
||||
gomega.Expect(ev).To(gomega.BeNil())
|
||||
|
||||
@ -129,7 +130,7 @@ var _ = framework.KubeDescribe("Sysctls [LinuxOnly] [NodeFeature:Sysctls]", func
|
||||
ev, err := f.PodClient().WaitForErrorEventOrSuccess(pod)
|
||||
framework.ExpectNoError(err)
|
||||
if ev != nil && ev.Reason == sysctl.UnsupportedReason {
|
||||
framework.Skipf("No sysctl support in Docker <1.12")
|
||||
e2eskipper.Skipf("No sysctl support in Docker <1.12")
|
||||
}
|
||||
gomega.Expect(ev).To(gomega.BeNil())
|
||||
|
||||
@ -206,7 +207,7 @@ var _ = framework.KubeDescribe("Sysctls [LinuxOnly] [NodeFeature:Sysctls]", func
|
||||
ev, err := f.PodClient().WaitForErrorEventOrSuccess(pod)
|
||||
framework.ExpectNoError(err)
|
||||
if ev != nil && ev.Reason == sysctl.UnsupportedReason {
|
||||
framework.Skipf("No sysctl support in Docker <1.12")
|
||||
e2eskipper.Skipf("No sysctl support in Docker <1.12")
|
||||
}
|
||||
|
||||
ginkgo.By("Checking that the pod was rejected")
|
||||
|
@ -46,6 +46,7 @@ import (
|
||||
"k8s.io/api/core/v1"
|
||||
clientset "k8s.io/client-go/kubernetes"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
|
||||
"k8s.io/kubernetes/test/e2e/framework/volume"
|
||||
|
||||
"github.com/onsi/ginkgo"
|
||||
@ -62,7 +63,7 @@ var _ = ginkgo.Describe("[sig-storage] GCP Volumes", func() {
|
||||
var c clientset.Interface
|
||||
|
||||
ginkgo.BeforeEach(func() {
|
||||
framework.SkipUnlessNodeOSDistroIs("gci", "ubuntu", "custom")
|
||||
e2eskipper.SkipUnlessNodeOSDistroIs("gci", "ubuntu", "custom")
|
||||
|
||||
namespace = f.Namespace
|
||||
c = f.ClientSet
|
||||
|
Loading…
Reference in New Issue
Block a user