e2e: use framework labels

This changes the text registration so that tags for which the framework has a
dedicated API (features, feature gates, slow, serial, etc.) those APIs are
used.

Arbitrary, custom tags are still left in place for now.
This commit is contained in:
Patrick Ohly
2023-06-20 10:27:14 +02:00
parent 833156b77e
commit f2cfbf44b1
230 changed files with 834 additions and 680 deletions

View File

@@ -29,6 +29,7 @@ import (
"k8s.io/apimachinery/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
"k8s.io/kubernetes/test/e2e/nodefeature"
imageutils "k8s.io/kubernetes/test/utils/image"
admissionapi "k8s.io/pod-security-admission/api"
@@ -43,7 +44,7 @@ var _ = SIGDescribe("Security Context", func() {
podClient = e2epod.NewPodClient(f)
})
ginkgo.Context("[NodeConformance][LinuxOnly] Container PID namespace sharing", func() {
f.Context(framework.WithNodeConformance(), "[LinuxOnly] Container PID namespace sharing", func() {
ginkgo.It("containers in pods using isolated PID namespaces should all receive PID 1", func(ctx context.Context) {
ginkgo.By("Create a pod with isolated PID namespaces.")
e2epod.NewPodClient(f).CreateSync(ctx, &v1.Pod{
@@ -147,7 +148,7 @@ var _ = SIGDescribe("Security Context", func() {
nginxPid = strings.TrimSpace(output)
})
ginkgo.It("should show its pid in the host PID namespace [NodeFeature:HostAccess]", func(ctx context.Context) {
f.It("should show its pid in the host PID namespace", nodefeature.HostAccess, func(ctx context.Context) {
busyboxPodName := "busybox-hostpid-" + string(uuid.NewUUID())
createAndWaitHostPidPod(ctx, busyboxPodName, true)
logs, err := e2epod.GetPodLogs(ctx, f.ClientSet, f.Namespace.Name, busyboxPodName, busyboxPodName)
@@ -167,7 +168,7 @@ var _ = SIGDescribe("Security Context", func() {
}
})
ginkgo.It("should not show its pid in the non-hostpid containers [NodeFeature:HostAccess]", func(ctx context.Context) {
f.It("should not show its pid in the non-hostpid containers", nodefeature.HostAccess, func(ctx context.Context) {
busyboxPodName := "busybox-non-hostpid-" + string(uuid.NewUUID())
createAndWaitHostPidPod(ctx, busyboxPodName, false)
logs, err := e2epod.GetPodLogs(ctx, f.ClientSet, f.Namespace.Name, busyboxPodName, busyboxPodName)
@@ -223,7 +224,7 @@ var _ = SIGDescribe("Security Context", func() {
framework.Logf("Got host shared memory ID %q", hostSharedMemoryID)
})
ginkgo.It("should show the shared memory ID in the host IPC containers [NodeFeature:HostAccess]", func(ctx context.Context) {
f.It("should show the shared memory ID in the host IPC containers", nodefeature.HostAccess, func(ctx context.Context) {
ipcutilsPodName := "ipcutils-hostipc-" + string(uuid.NewUUID())
createAndWaitHostIPCPod(ctx, ipcutilsPodName, true)
logs, err := e2epod.GetPodLogs(ctx, f.ClientSet, f.Namespace.Name, ipcutilsPodName, ipcutilsPodName)
@@ -238,7 +239,7 @@ var _ = SIGDescribe("Security Context", func() {
}
})
ginkgo.It("should not show the shared memory ID in the non-hostIPC containers [NodeFeature:HostAccess]", func(ctx context.Context) {
f.It("should not show the shared memory ID in the non-hostIPC containers", nodefeature.HostAccess, func(ctx context.Context) {
ipcutilsPodName := "ipcutils-non-hostipc-" + string(uuid.NewUUID())
createAndWaitHostIPCPod(ctx, ipcutilsPodName, false)
logs, err := e2epod.GetPodLogs(ctx, f.ClientSet, f.Namespace.Name, ipcutilsPodName, ipcutilsPodName)
@@ -306,7 +307,7 @@ var _ = SIGDescribe("Security Context", func() {
framework.Logf("Opened a new tcp port %q", listeningPort)
})
ginkgo.It("should listen on same port in the host network containers [NodeFeature:HostAccess]", func(ctx context.Context) {
f.It("should listen on same port in the host network containers", nodefeature.HostAccess, func(ctx context.Context) {
busyboxPodName := "busybox-hostnetwork-" + string(uuid.NewUUID())
createAndWaitHostNetworkPod(ctx, busyboxPodName, true)
logs, err := e2epod.GetPodLogs(ctx, f.ClientSet, f.Namespace.Name, busyboxPodName, busyboxPodName)
@@ -320,7 +321,7 @@ var _ = SIGDescribe("Security Context", func() {
}
})
ginkgo.It("shouldn't show the same port in the non-hostnetwork containers [NodeFeature:HostAccess]", func(ctx context.Context) {
f.It("shouldn't show the same port in the non-hostnetwork containers", nodefeature.HostAccess, func(ctx context.Context) {
busyboxPodName := "busybox-non-hostnetwork-" + string(uuid.NewUUID())
createAndWaitHostNetworkPod(ctx, busyboxPodName, false)
logs, err := e2epod.GetPodLogs(ctx, f.ClientSet, f.Namespace.Name, busyboxPodName, busyboxPodName)