diff --git a/test/e2e/common/configmap_volume.go b/test/e2e/common/configmap_volume.go index dc909f643dd..ca30127ed9c 100644 --- a/test/e2e/common/configmap_volume.go +++ b/test/e2e/common/configmap_volume.go @@ -54,7 +54,9 @@ var _ = ginkgo.Describe("[sig-storage] ConfigMap", func() { doConfigMapE2EWithoutMappings(f, 0, 0, &defaultMode) }) - ginkgo.It("should be consumable from pods in volume as non-root with defaultMode and fsGroup set [NodeFeature:FSGroup]", 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") defaultMode := int32(0440) /* setting fsGroup sets mode to at least 440 */ doConfigMapE2EWithoutMappings(f, 1000, 1001, &defaultMode) }) @@ -69,7 +71,9 @@ var _ = ginkgo.Describe("[sig-storage] ConfigMap", func() { doConfigMapE2EWithoutMappings(f, 1000, 0, nil) }) - ginkgo.It("should be consumable from pods in volume as non-root with FSGroup [NodeFeature:FSGroup]", 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") doConfigMapE2EWithoutMappings(f, 1000, 1001, nil) }) @@ -103,7 +107,9 @@ var _ = ginkgo.Describe("[sig-storage] ConfigMap", func() { doConfigMapE2EWithMappings(f, 1000, 0, nil) }) - ginkgo.It("should be consumable from pods in volume with mappings as non-root with FSGroup [NodeFeature:FSGroup]", 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") doConfigMapE2EWithMappings(f, 1000, 1001, nil) }) diff --git a/test/e2e/common/downwardapi_volume.go b/test/e2e/common/downwardapi_volume.go index 4d302d8eea2..7570cd4d53a 100644 --- a/test/e2e/common/downwardapi_volume.go +++ b/test/e2e/common/downwardapi_volume.go @@ -87,7 +87,9 @@ var _ = ginkgo.Describe("[sig-storage] Downward API volume", func() { }) }) - ginkgo.It("should provide podname as non-root with fsgroup [NodeFeature:FSGroup]", 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") podName := "metadata-volume-" + string(uuid.NewUUID()) uid := int64(1001) gid := int64(1234) @@ -101,7 +103,9 @@ var _ = ginkgo.Describe("[sig-storage] Downward API volume", func() { }) }) - ginkgo.It("should provide podname as non-root with fsgroup and defaultMode [NodeFeature:FSGroup]", 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") podName := "metadata-volume-" + string(uuid.NewUUID()) uid := int64(1001) gid := int64(1234) diff --git a/test/e2e/common/empty_dir.go b/test/e2e/common/empty_dir.go index ebfb42f39cf..2a5d0c1a474 100644 --- a/test/e2e/common/empty_dir.go +++ b/test/e2e/common/empty_dir.go @@ -41,7 +41,13 @@ var ( var _ = ginkgo.Describe("[sig-storage] EmptyDir volumes", func() { f := framework.NewDefaultFramework("emptydir") - ginkgo.Context("when FSGroup is specified [NodeFeature:FSGroup]", func() { + ginkgo.Context("when FSGroup is specified [LinuxOnly] [NodeFeature:FSGroup]", func() { + + ginkgo.BeforeEach(func() { + // Windows does not support the FSGroup SecurityContext option. + framework.SkipIfNodeOSDistroIs("windows") + }) + ginkgo.It("new files should be created with FSGroup ownership when container is root", func() { doTestSetgidFSGroup(f, testImageRootUid, v1.StorageMediumMemory) }) diff --git a/test/e2e/common/projected_configmap.go b/test/e2e/common/projected_configmap.go index 1b54ec345de..f6d3f738a23 100644 --- a/test/e2e/common/projected_configmap.go +++ b/test/e2e/common/projected_configmap.go @@ -55,7 +55,9 @@ var _ = ginkgo.Describe("[sig-storage] Projected configMap", func() { doProjectedConfigMapE2EWithoutMappings(f, 0, 0, &defaultMode) }) - ginkgo.It("should be consumable from pods in volume as non-root with defaultMode and fsGroup set [NodeFeature:FSGroup]", 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") defaultMode := int32(0440) /* setting fsGroup sets mode to at least 440 */ doProjectedConfigMapE2EWithoutMappings(f, 1000, 1001, &defaultMode) }) @@ -70,7 +72,9 @@ var _ = ginkgo.Describe("[sig-storage] Projected configMap", func() { doProjectedConfigMapE2EWithoutMappings(f, 1000, 0, nil) }) - ginkgo.It("should be consumable from pods in volume as non-root with FSGroup [NodeFeature:FSGroup]", 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") doProjectedConfigMapE2EWithoutMappings(f, 1000, 1001, nil) }) @@ -104,7 +108,9 @@ var _ = ginkgo.Describe("[sig-storage] Projected configMap", func() { doProjectedConfigMapE2EWithMappings(f, 1000, 0, nil) }) - ginkgo.It("should be consumable from pods in volume with mappings as non-root with FSGroup [NodeFeature:FSGroup]", 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") doProjectedConfigMapE2EWithMappings(f, 1000, 1001, nil) }) diff --git a/test/e2e/common/projected_downwardapi.go b/test/e2e/common/projected_downwardapi.go index adbdaddefe5..87788045123 100644 --- a/test/e2e/common/projected_downwardapi.go +++ b/test/e2e/common/projected_downwardapi.go @@ -87,7 +87,9 @@ var _ = ginkgo.Describe("[sig-storage] Projected downwardAPI", func() { }) }) - ginkgo.It("should provide podname as non-root with fsgroup [NodeFeature:FSGroup]", 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") podName := "metadata-volume-" + string(uuid.NewUUID()) uid := int64(1001) gid := int64(1234) @@ -101,7 +103,9 @@ var _ = ginkgo.Describe("[sig-storage] Projected downwardAPI", func() { }) }) - ginkgo.It("should provide podname as non-root with fsgroup and defaultMode [NodeFeature:FSGroup]", 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") podName := "metadata-volume-" + string(uuid.NewUUID()) uid := int64(1001) gid := int64(1234) diff --git a/test/e2e/common/security_context.go b/test/e2e/common/security_context.go index 16fce458882..05a14bae6aa 100644 --- a/test/e2e/common/security_context.go +++ b/test/e2e/common/security_context.go @@ -120,7 +120,9 @@ var _ = framework.KubeDescribe("Security Context", func() { } } - ginkgo.It("should run with an explicit non-root user ID", 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") name := "explicit-nonroot-uid" pod := makeNonRootPod(name, rootImage, pointer.Int64Ptr(1234)) pod = podClient.Create(pod) @@ -128,7 +130,9 @@ var _ = framework.KubeDescribe("Security Context", func() { podClient.WaitForSuccess(name, framework.PodStartTimeout) framework.ExpectNoError(podClient.MatchContainerOutput(name, name, "1234")) }) - ginkgo.It("should not run with an explicit root user ID", 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") name := "explicit-root-uid" pod := makeNonRootPod(name, nonRootImage, pointer.Int64Ptr(0)) pod = podClient.Create(pod) diff --git a/test/e2e/common/sysctl.go b/test/e2e/common/sysctl.go index aa15c27d441..aa38e1ba554 100644 --- a/test/e2e/common/sysctl.go +++ b/test/e2e/common/sysctl.go @@ -29,7 +29,13 @@ import ( "github.com/onsi/gomega" ) -var _ = framework.KubeDescribe("Sysctls [NodeFeature:Sysctls]", func() { +var _ = framework.KubeDescribe("Sysctls [LinuxOnly] [NodeFeature:Sysctls]", func() { + + ginkgo.BeforeEach(func() { + // sysctl is not supported on Windows. + framework.SkipIfNodeOSDistroIs("windows") + }) + f := framework.NewDefaultFramework("sysctl") var podClient *framework.PodClient diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index eec98bf2790..82280da2327 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -350,6 +350,13 @@ func SkipUnlessNodeOSDistroIs(supportedNodeOsDistros ...string) { } } +// SkipIfNodeOSDistroIs skips if the node OS distro is included in the unsupportedNodeOsDistros. +func SkipIfNodeOSDistroIs(unsupportedNodeOsDistros ...string) { + if NodeOSDistroIs(unsupportedNodeOsDistros...) { + skipInternalf(1, "Not supported for node OS distro %v (is %s)", unsupportedNodeOsDistros, TestContext.NodeOSDistro) + } +} + // SkipUnlessTaintBasedEvictionsEnabled skips if the TaintBasedEvictions is not enabled. func SkipUnlessTaintBasedEvictionsEnabled() { if !utilfeature.DefaultFeatureGate.Enabled(features.TaintBasedEvictions) { diff --git a/test/e2e/network/dns_configmap.go b/test/e2e/network/dns_configmap.go index c648c03c620..37e072cd3d2 100644 --- a/test/e2e/network/dns_configmap.go +++ b/test/e2e/network/dns_configmap.go @@ -511,7 +511,12 @@ var _ = SIGDescribe("DNS configMap nameserver [IPv4]", func() { }) }) -var _ = SIGDescribe("DNS configMap nameserver [Feature:Networking-IPv6]", func() { +var _ = SIGDescribe("DNS configMap nameserver [Feature:Networking-IPv6] [LinuxOnly]", func() { + + ginkgo.BeforeEach(func() { + // IPv6 is not supported on Windows. + framework.SkipIfNodeOSDistroIs("windows") + }) ginkgo.Context("Change stubDomain", func() { nsTest := &dnsNameserverTest{dnsTestCommon: newDNSTestCommon()} diff --git a/test/e2e/network/network_policy.go b/test/e2e/network/network_policy.go index 183ab91f013..8276f7a0f62 100644 --- a/test/e2e/network/network_policy.go +++ b/test/e2e/network/network_policy.go @@ -42,12 +42,17 @@ connections from one of the clients. The test then asserts that the clients failed or successfully connected as expected. */ -var _ = SIGDescribe("NetworkPolicy", func() { +var _ = SIGDescribe("NetworkPolicy [LinuxOnly]", func() { var service *v1.Service var podServer *v1.Pod var podServerLabelSelector string f := framework.NewDefaultFramework("network-policy") + ginkgo.BeforeEach(func() { + // Windows does not support network policies. + framework.SkipIfNodeOSDistroIs("windows") + }) + ginkgo.Context("NetworkPolicy between server and client", func() { ginkgo.BeforeEach(func() { ginkgo.By("Creating a simple server that serves on port 80 and 81.") diff --git a/test/e2e/network/networking.go b/test/e2e/network/networking.go index 5be5904390f..1ce032cacbc 100644 --- a/test/e2e/network/networking.go +++ b/test/e2e/network/networking.go @@ -52,7 +52,9 @@ var _ = SIGDescribe("Networking", func() { framework.CheckConnectivityToHost(f, "", "connectivity-test", "8.8.8.8", 53, 30)) }) - ginkgo.It("should provide Internet connection for containers [Feature:Networking-IPv6][Experimental]", func() { + ginkgo.It("should provide Internet connection for containers [Feature:Networking-IPv6][Experimental][LinuxOnly]", func() { + // IPv6 is not supported on Windows. + framework.SkipIfNodeOSDistroIs("windows") ginkgo.By("Running container which tries to connect to 2001:4860:4860::8888") framework.ExpectNoError( framework.CheckConnectivityToHost(f, "", "connectivity-test", "2001:4860:4860::8888", 53, 30)) diff --git a/test/e2e/network/networking_perf.go b/test/e2e/network/networking_perf.go index f74ac13bc4a..0ade431e717 100644 --- a/test/e2e/network/networking_perf.go +++ b/test/e2e/network/networking_perf.go @@ -167,6 +167,8 @@ var _ = SIGDescribe("Networking IPerf IPv4 [Experimental] [Feature:Networking-IP // Declared as Flakey since it has not been proven to run in parallel on small nodes or slow networks in CI // TODO jayunit100 : Retag this test according to semantics from #22401 -var _ = SIGDescribe("Networking IPerf IPv6 [Experimental] [Feature:Networking-IPv6] [Slow] [Feature:Networking-Performance]", func() { +var _ = SIGDescribe("Networking IPerf IPv6 [Experimental] [Feature:Networking-IPv6] [Slow] [Feature:Networking-Performance] [LinuxOnly]", func() { + // IPv6 is not supported on Windows. + framework.SkipIfNodeOSDistroIs("windows") networkingIPerfTest(true) }) diff --git a/test/e2e/network/service.go b/test/e2e/network/service.go index 11ba96d4aa5..76fe43f6711 100644 --- a/test/e2e/network/service.go +++ b/test/e2e/network/service.go @@ -265,7 +265,9 @@ var _ = SIGDescribe("Services", func() { framework.ExpectNoError(err, "failed to validate endpoints for service %s in namespace: %s", serviceName, ns) }) - ginkgo.It("should preserve source pod IP for traffic thru service cluster IP", func() { + ginkgo.It("should preserve source pod IP for traffic thru service cluster IP [LinuxOnly]", func() { + // this test is creating a pod with HostNetwork=true, which is not supported on Windows. + framework.SkipIfNodeOSDistroIs("windows") // This behavior is not supported if Kube-proxy is in "userspace" mode. // So we check the kube-proxy mode and skip this test if that's the case.