diff --git a/test/conformance/testdata/conformance.yaml b/test/conformance/testdata/conformance.yaml index 587c5048ddf..5d04770eebc 100755 --- a/test/conformance/testdata/conformance.yaml +++ b/test/conformance/testdata/conformance.yaml @@ -485,7 +485,7 @@ Container will execute curl command to reach the service port within specified max retry limit and MUST result in reporting unique hostnames. release: v1.9, v1.18 - file: test/e2e/common/networking.go + file: test/e2e/common/network/networking.go - testname: Networking, intra pod udp codename: '[k8s.io] [sig-network] Networking Granular Checks: Pods should function for intra-pod communication: udp [NodeConformance] [Conformance]' @@ -497,7 +497,7 @@ Container will execute curl command to reach the service port within specified max retry limit and MUST result in reporting unique hostnames. release: v1.9, v1.18 - file: test/e2e/common/networking.go + file: test/e2e/common/network/networking.go - testname: Networking, intra pod http, from node codename: '[k8s.io] [sig-network] Networking Granular Checks: Pods should function for node-pod communication: http [LinuxOnly] [NodeConformance] [Conformance]' @@ -511,7 +511,7 @@ hostnames. This test is marked LinuxOnly since HostNetwork is not supported on other platforms like Windows. release: v1.9 - file: test/e2e/common/networking.go + file: test/e2e/common/network/networking.go - testname: Networking, intra pod http, from node codename: '[k8s.io] [sig-network] Networking Granular Checks: Pods should function for node-pod communication: udp [LinuxOnly] [NodeConformance] [Conformance]' @@ -525,28 +525,28 @@ hostnames. This test is marked LinuxOnly since HostNetwork is not supported on other platforms like Windows. release: v1.9 - file: test/e2e/common/networking.go + file: test/e2e/common/network/networking.go - testname: ConfigMap, from environment field codename: '[k8s.io] [sig-node] ConfigMap should be consumable via environment variable [NodeConformance] [Conformance]' description: Create a Pod with an environment variable value set using a value from ConfigMap. A ConfigMap value MUST be accessible in the container environment. release: v1.9 - file: test/e2e/common/configmap.go + file: test/e2e/common/node/configmap.go - testname: ConfigMap, from environment variables codename: '[k8s.io] [sig-node] ConfigMap should be consumable via the environment [NodeConformance] [Conformance]' description: Create a Pod with a environment source from ConfigMap. All ConfigMap values MUST be available as environment variables in the container. release: v1.9 - file: test/e2e/common/configmap.go + file: test/e2e/common/node/configmap.go - testname: ConfigMap, with empty-key codename: '[k8s.io] [sig-node] ConfigMap should fail to create ConfigMap with empty key [Conformance]' description: Attempt to create a ConfigMap with an empty key. The creation MUST fail. release: v1.14 - file: test/e2e/common/configmap.go + file: test/e2e/common/node/configmap.go - testname: ConfigMap lifecycle codename: '[k8s.io] [sig-node] ConfigMap should run through a ConfigMap lifecycle [Conformance]' @@ -555,21 +555,21 @@ selector it MUST find the ConfigMap by it's static label and updated value. The ConfigMap must be deleted by Collection. release: v1.19 - file: test/e2e/common/configmap.go + file: test/e2e/common/node/configmap.go - testname: DownwardAPI, environment for CPU and memory limits and requests codename: '[k8s.io] [sig-node] Downward API should provide container''s limits.cpu/memory and requests.cpu/memory as env vars [NodeConformance] [Conformance]' description: Downward API MUST expose CPU request and Memory request set through environment variables at runtime in the container. release: v1.9 - file: test/e2e/common/downward_api.go + file: test/e2e/common/downwardapi.go - testname: DownwardAPI, environment for default CPU and memory limits and requests codename: '[k8s.io] [sig-node] Downward API should provide default limits.cpu/memory from node allocatable [NodeConformance] [Conformance]' description: Downward API MUST expose CPU request and Memory limits set through environment variables at runtime in the container. release: v1.9 - file: test/e2e/common/downward_api.go + file: test/e2e/common/downwardapi.go - testname: DownwardAPI, environment for host ip codename: '[k8s.io] [sig-node] Downward API should provide host IP as an env var [NodeConformance] [Conformance]' @@ -577,14 +577,14 @@ Specify host IP as environment variable in the Pod Spec are visible at runtime in the container. release: v1.9 - file: test/e2e/common/downward_api.go + file: test/e2e/common/downwardapi.go - testname: DownwardAPI, environment for Pod UID codename: '[k8s.io] [sig-node] Downward API should provide pod UID as env vars [NodeConformance] [Conformance]' description: Downward API MUST expose Pod UID set through environment variables at runtime in the container. release: v1.9 - file: test/e2e/common/downward_api.go + file: test/e2e/common/downwardapi.go - testname: DownwardAPI, environment for name, namespace and ip codename: '[k8s.io] [sig-node] Downward API should provide pod name, namespace and IP address as env vars [NodeConformance] [Conformance]' @@ -592,7 +592,7 @@ Specify Pod Name, namespace and IP as environment variable in the Pod Spec are visible at runtime in the container. release: v1.9 - file: test/e2e/common/downward_api.go + file: test/e2e/common/downwardapi.go - testname: Pod events, verify event from Scheduler and Kubelet codename: '[k8s.io] [sig-node] Events should be sent by kubelets and the scheduler about pods scheduling and running [Conformance]' @@ -624,7 +624,7 @@ be found when listed. The set of Pod Templates is deleted and MUST NOT show up when listed by its label selector. release: v1.19 - file: test/e2e/common/podtemplates.go + file: test/e2e/common/node/podtemplates.go - testname: PodTemplate lifecycle codename: '[k8s.io] [sig-node] PodTemplates should run the lifecycle of PodTemplates [Conformance]' @@ -633,7 +633,7 @@ selector it MUST find the PodTemplate by it's static label and updated value. The PodTemplate must be deleted. release: v1.19 - file: test/e2e/common/podtemplates.go + file: test/e2e/common/node/podtemplates.go - testname: Pods, QOS codename: '[k8s.io] [sig-node] Pods Extended [k8s.io] Pods Set QOS Class should be set on Pods with matching resource requests and limits for memory and cpu [Conformance]' @@ -660,7 +660,7 @@ document. The runtimeclasses resource must support create, get, list, watch, update, patch, delete, and deletecollection.' release: v1.20 - file: test/e2e/common/runtimeclass.go + file: test/e2e/common/node/runtimeclass.go - testname: Security Context, test RunAsGroup at container level codename: '[k8s.io] [sig-node] Security Context should support container.SecurityContext.RunAsUser And container.SecurityContext.RunAsGroup [LinuxOnly] [Conformance]' @@ -687,7 +687,7 @@ to custom path in the Pod. ConfigMap's text data and binary data MUST be verified by reading the content from the mounted files in the Pod. release: v1.12 - file: test/e2e/common/configmap_volume.go + file: test/e2e/common/storage/configmap_volume.go - testname: ConfigMap Volume, create, update and delete codename: '[k8s.io] [sig-storage] ConfigMap optional updates should be reflected in volume [NodeConformance] [Conformance]' @@ -697,7 +697,7 @@ the content from the mounted file in the Pod. Also when the item(file) is deleted from the map that MUST result in a error reading that item(file). release: v1.9 - file: test/e2e/common/configmap_volume.go + file: test/e2e/common/storage/configmap_volume.go - testname: ConfigMap Volume, without mapping codename: '[k8s.io] [sig-storage] ConfigMap should be consumable from pods in volume [NodeConformance] [Conformance]' @@ -707,7 +707,7 @@ content of the file MUST be readable and verified and file modes MUST default to 0x644. release: v1.9 - file: test/e2e/common/configmap_volume.go + file: test/e2e/common/storage/configmap_volume.go - testname: ConfigMap Volume, without mapping, non-root user codename: '[k8s.io] [sig-storage] ConfigMap should be consumable from pods in volume as non-root [NodeConformance] [Conformance]' @@ -717,7 +717,7 @@ created Pod using the volume mount. The file on the volume MUST have file mode set to default value of 0x644. release: v1.9 - file: test/e2e/common/configmap_volume.go + file: test/e2e/common/storage/configmap_volume.go - testname: ConfigMap Volume, without mapping, volume mode set codename: '[k8s.io] [sig-storage] ConfigMap should be consumable from pods in volume with defaultMode set [LinuxOnly] [NodeConformance] [Conformance]' @@ -729,7 +729,7 @@ This test is marked LinuxOnly since Windows does not support setting specific file permissions. release: v1.9 - file: test/e2e/common/configmap_volume.go + file: test/e2e/common/storage/configmap_volume.go - testname: ConfigMap Volume, with mapping codename: '[k8s.io] [sig-storage] ConfigMap should be consumable from pods in volume with mappings [NodeConformance] [Conformance]' @@ -739,7 +739,7 @@ created Pod using the volume mount. The data content of the file MUST be readable and verified and file modes MUST default to 0x644. release: v1.9 - file: test/e2e/common/configmap_volume.go + file: test/e2e/common/storage/configmap_volume.go - testname: ConfigMap Volume, with mapping, volume mode set codename: '[k8s.io] [sig-storage] ConfigMap should be consumable from pods in volume with mappings and Item mode set [LinuxOnly] [NodeConformance] [Conformance]' @@ -751,7 +751,7 @@ MUST be set to the custom value of '0x400' This test is marked LinuxOnly since Windows does not support setting specific file permissions. release: v1.9 - file: test/e2e/common/configmap_volume.go + file: test/e2e/common/storage/configmap_volume.go - testname: ConfigMap Volume, with mapping, non-root user codename: '[k8s.io] [sig-storage] ConfigMap should be consumable from pods in volume with mappings as non-root [NodeConformance] [Conformance]' @@ -761,7 +761,7 @@ MUST be accessible to read from the newly created Pod using the volume mount. The file on the volume MUST have file mode set to default value of 0x644. release: v1.9 - file: test/e2e/common/configmap_volume.go + file: test/e2e/common/storage/configmap_volume.go - testname: ConfigMap Volume, multiple volume maps codename: '[k8s.io] [sig-storage] ConfigMap should be consumable in multiple volumes in the same pod [NodeConformance] [Conformance]' @@ -769,7 +769,7 @@ created Pod using the volume mount that is mapped to multiple paths in the Pod. The content MUST be accessible from all the mapped volume mounts. release: v1.9 - file: test/e2e/common/configmap_volume.go + file: test/e2e/common/storage/configmap_volume.go - testname: ConfigMap Volume, immutability codename: '[k8s.io] [sig-storage] ConfigMap should be immutable if `immutable` field is set [Conformance]' @@ -779,7 +779,7 @@ MUST fail. Try to update the ConfigMap`s metadata (labels), the update must succeed. Try to delete the ConfigMap, the deletion must succeed. release: v1.21 - file: test/e2e/common/configmap_volume.go + file: test/e2e/common/storage/configmap_volume.go - testname: ConfigMap Volume, update codename: '[k8s.io] [sig-storage] ConfigMap updates should be reflected in volume [NodeConformance] [Conformance]' @@ -788,7 +788,7 @@ the ConfigMap is updated the change to the config map MUST be verified by reading the content from the mounted file in the Pod. release: v1.9 - file: test/e2e/common/configmap_volume.go + file: test/e2e/common/storage/configmap_volume.go - testname: DownwardAPI volume, CPU limits codename: '[k8s.io] [sig-storage] Downward API volume should provide container''s cpu limit [NodeConformance] [Conformance]' @@ -796,7 +796,7 @@ contains a item for the CPU limits. The container runtime MUST be able to access CPU limits from the specified path on the mounted volume. release: v1.9 - file: test/e2e/common/downwardapi_volume.go + file: test/e2e/common/storage/downwardapi_volume.go - testname: DownwardAPI volume, CPU request codename: '[k8s.io] [sig-storage] Downward API volume should provide container''s cpu request [NodeConformance] [Conformance]' @@ -804,7 +804,7 @@ contains a item for the CPU request. The container runtime MUST be able to access CPU request from the specified path on the mounted volume. release: v1.9 - file: test/e2e/common/downwardapi_volume.go + file: test/e2e/common/storage/downwardapi_volume.go - testname: DownwardAPI volume, memory limits codename: '[k8s.io] [sig-storage] Downward API volume should provide container''s memory limit [NodeConformance] [Conformance]' @@ -812,7 +812,7 @@ contains a item for the memory limits. The container runtime MUST be able to access memory limits from the specified path on the mounted volume. release: v1.9 - file: test/e2e/common/downwardapi_volume.go + file: test/e2e/common/storage/downwardapi_volume.go - testname: DownwardAPI volume, memory request codename: '[k8s.io] [sig-storage] Downward API volume should provide container''s memory request [NodeConformance] [Conformance]' @@ -820,7 +820,7 @@ contains a item for the memory request. The container runtime MUST be able to access memory request from the specified path on the mounted volume. release: v1.9 - file: test/e2e/common/downwardapi_volume.go + file: test/e2e/common/storage/downwardapi_volume.go - testname: DownwardAPI volume, CPU limit, default node allocatable codename: '[k8s.io] [sig-storage] Downward API volume should provide node allocatable (cpu) as default cpu limit if the limit is not set [NodeConformance] [Conformance]' @@ -829,7 +829,7 @@ The container runtime MUST be able to access CPU limits from the specified path on the mounted volume and the value MUST be default node allocatable. release: v1.9 - file: test/e2e/common/downwardapi_volume.go + file: test/e2e/common/storage/downwardapi_volume.go - testname: DownwardAPI volume, memory limit, default node allocatable codename: '[k8s.io] [sig-storage] Downward API volume should provide node allocatable (memory) as default memory limit if the limit is not set [NodeConformance] [Conformance]' @@ -838,7 +838,7 @@ container. The container runtime MUST be able to access memory limits from the specified path on the mounted volume and the value MUST be default node allocatable. release: v1.9 - file: test/e2e/common/downwardapi_volume.go + file: test/e2e/common/storage/downwardapi_volume.go - testname: DownwardAPI volume, pod name codename: '[k8s.io] [sig-storage] Downward API volume should provide podname only [NodeConformance] [Conformance]' @@ -846,7 +846,7 @@ contains a item for the Pod name. The container runtime MUST be able to access Pod name from the specified path on the mounted volume. release: v1.9 - file: test/e2e/common/downwardapi_volume.go + file: test/e2e/common/storage/downwardapi_volume.go - testname: DownwardAPI volume, volume mode 0400 codename: '[k8s.io] [sig-storage] Downward API volume should set DefaultMode on files [LinuxOnly] [NodeConformance] [Conformance]' @@ -856,7 +856,7 @@ path on the mounted volume. This test is marked LinuxOnly since Windows does not support setting specific file permissions. release: v1.9 - file: test/e2e/common/downwardapi_volume.go + file: test/e2e/common/storage/downwardapi_volume.go - testname: DownwardAPI volume, file mode 0400 codename: '[k8s.io] [sig-storage] Downward API volume should set mode on item file [LinuxOnly] [NodeConformance] [Conformance]' @@ -866,7 +866,7 @@ volume. This test is marked LinuxOnly since Windows does not support setting specific file permissions. release: v1.9 - file: test/e2e/common/downwardapi_volume.go + file: test/e2e/common/storage/downwardapi_volume.go - testname: DownwardAPI volume, update annotations codename: '[k8s.io] [sig-storage] Downward API volume should update annotations on modification [NodeConformance] [Conformance]' @@ -876,7 +876,7 @@ volume. Update the annotations by adding a new annotation to the running Pod. The new annotation MUST be available from the mounted volume. release: v1.9 - file: test/e2e/common/downwardapi_volume.go + file: test/e2e/common/storage/downwardapi_volume.go - testname: DownwardAPI volume, update label codename: '[k8s.io] [sig-storage] Downward API volume should update labels on modification [NodeConformance] [Conformance]' @@ -886,7 +886,7 @@ the labels by adding a new label to the running Pod. The new label MUST be available from the mounted volume. release: v1.9 - file: test/e2e/common/downwardapi_volume.go + file: test/e2e/common/storage/downwardapi_volume.go - testname: EmptyDir, Shared volumes between containers codename: '[k8s.io] [sig-storage] EmptyDir volumes pod should support shared volumes between containers [Conformance]' @@ -895,7 +895,7 @@ mounted to the pod. The main container shoud wait until the sub container drops a file, and main container acess the shared data. release: v1.15 - file: test/e2e/common/empty_dir.go + file: test/e2e/common/storage/empty_dir.go - testname: EmptyDir, medium default, volume mode 0644 codename: '[k8s.io] [sig-storage] EmptyDir volumes should support (non-root,0644,default) [LinuxOnly] [NodeConformance] [Conformance]' @@ -905,7 +905,7 @@ MUST be readable. This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID. release: v1.9 - file: test/e2e/common/empty_dir.go + file: test/e2e/common/storage/empty_dir.go - testname: EmptyDir, medium memory, volume mode 0644, non-root user codename: '[k8s.io] [sig-storage] EmptyDir volumes should support (non-root,0644,tmpfs) [LinuxOnly] [NodeConformance] [Conformance]' @@ -916,7 +916,7 @@ since Windows does not support setting specific file permissions, or running as UID / GID, or the medium = 'Memory'. release: v1.9 - file: test/e2e/common/empty_dir.go + file: test/e2e/common/storage/empty_dir.go - testname: EmptyDir, medium default, volume mode 0666 codename: '[k8s.io] [sig-storage] EmptyDir volumes should support (non-root,0666,default) [LinuxOnly] [NodeConformance] [Conformance]' @@ -926,7 +926,7 @@ MUST be readable. This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID. release: v1.9 - file: test/e2e/common/empty_dir.go + file: test/e2e/common/storage/empty_dir.go - testname: EmptyDir, medium memory, volume mode 0666,, non-root user codename: '[k8s.io] [sig-storage] EmptyDir volumes should support (non-root,0666,tmpfs) [LinuxOnly] [NodeConformance] [Conformance]' @@ -937,7 +937,7 @@ since Windows does not support setting specific file permissions, or running as UID / GID, or the medium = 'Memory'. release: v1.9 - file: test/e2e/common/empty_dir.go + file: test/e2e/common/storage/empty_dir.go - testname: EmptyDir, medium default, volume mode 0777 codename: '[k8s.io] [sig-storage] EmptyDir volumes should support (non-root,0777,default) [LinuxOnly] [NodeConformance] [Conformance]' @@ -947,7 +947,7 @@ MUST be readable. This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID. release: v1.9 - file: test/e2e/common/empty_dir.go + file: test/e2e/common/storage/empty_dir.go - testname: EmptyDir, medium memory, volume mode 0777, non-root user codename: '[k8s.io] [sig-storage] EmptyDir volumes should support (non-root,0777,tmpfs) [LinuxOnly] [NodeConformance] [Conformance]' @@ -958,7 +958,7 @@ since Windows does not support setting specific file permissions, or running as UID / GID, or the medium = 'Memory'. release: v1.9 - file: test/e2e/common/empty_dir.go + file: test/e2e/common/storage/empty_dir.go - testname: EmptyDir, medium default, volume mode 0644 codename: '[k8s.io] [sig-storage] EmptyDir volumes should support (root,0644,default) [LinuxOnly] [NodeConformance] [Conformance]' @@ -967,7 +967,7 @@ MUST be readable. This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID. release: v1.9 - file: test/e2e/common/empty_dir.go + file: test/e2e/common/storage/empty_dir.go - testname: EmptyDir, medium memory, volume mode 0644 codename: '[k8s.io] [sig-storage] EmptyDir volumes should support (root,0644,tmpfs) [LinuxOnly] [NodeConformance] [Conformance]' @@ -977,7 +977,7 @@ Windows does not support setting specific file permissions, or running as UID / GID, or the medium = 'Memory'. release: v1.9 - file: test/e2e/common/empty_dir.go + file: test/e2e/common/storage/empty_dir.go - testname: EmptyDir, medium default, volume mode 0666 codename: '[k8s.io] [sig-storage] EmptyDir volumes should support (root,0666,default) [LinuxOnly] [NodeConformance] [Conformance]' @@ -986,7 +986,7 @@ MUST be readable. This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID. release: v1.9 - file: test/e2e/common/empty_dir.go + file: test/e2e/common/storage/empty_dir.go - testname: EmptyDir, medium memory, volume mode 0666 codename: '[k8s.io] [sig-storage] EmptyDir volumes should support (root,0666,tmpfs) [LinuxOnly] [NodeConformance] [Conformance]' @@ -996,7 +996,7 @@ Windows does not support setting specific file permissions, or running as UID / GID, or the medium = 'Memory'. release: v1.9 - file: test/e2e/common/empty_dir.go + file: test/e2e/common/storage/empty_dir.go - testname: EmptyDir, medium default, volume mode 0777 codename: '[k8s.io] [sig-storage] EmptyDir volumes should support (root,0777,default) [LinuxOnly] [NodeConformance] [Conformance]' @@ -1005,7 +1005,7 @@ MUST be readable. This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID. release: v1.9 - file: test/e2e/common/empty_dir.go + file: test/e2e/common/storage/empty_dir.go - testname: EmptyDir, medium memory, volume mode 0777 codename: '[k8s.io] [sig-storage] EmptyDir volumes should support (root,0777,tmpfs) [LinuxOnly] [NodeConformance] [Conformance]' @@ -1015,7 +1015,7 @@ since Windows does not support setting specific file permissions, or running as UID / GID, or the medium = 'Memory'. release: v1.9 - file: test/e2e/common/empty_dir.go + file: test/e2e/common/storage/empty_dir.go - testname: EmptyDir, medium default, volume mode default codename: '[k8s.io] [sig-storage] EmptyDir volumes volume on default medium should have the correct mode [LinuxOnly] [NodeConformance] [Conformance]' @@ -1023,7 +1023,7 @@ set as -rwxrwxrwx and mount type set to tmpfs. This test is marked LinuxOnly since Windows does not support setting specific file permissions. release: v1.9 - file: test/e2e/common/empty_dir.go + file: test/e2e/common/storage/empty_dir.go - testname: EmptyDir, medium memory, volume mode default codename: '[k8s.io] [sig-storage] EmptyDir volumes volume on tmpfs should have the correct mode [LinuxOnly] [NodeConformance] [Conformance]' @@ -1032,7 +1032,7 @@ is marked LinuxOnly since Windows does not support setting specific file permissions, or the medium = 'Memory'. release: v1.9 - file: test/e2e/common/empty_dir.go + file: test/e2e/common/storage/empty_dir.go - testname: Projected Volume, multiple projections codename: '[k8s.io] [sig-storage] Projected combined should project all components that make up the projection API [Projection][NodeConformance] [Conformance]' @@ -1041,7 +1041,7 @@ Pod MUST be able to read the secrets, configMap values and the cpu and memory limits as well as cpu and memory requests from the mounted DownwardAPIVolumeFiles. release: v1.9 - file: test/e2e/common/projected_combined.go + file: test/e2e/common/storage/projected_combined.go - testname: Projected Volume, ConfigMap, create, update and delete codename: '[k8s.io] [sig-storage] Projected configMap optional updates should be reflected in volume [NodeConformance] [Conformance]' @@ -1053,7 +1053,7 @@ be able to read the updated configMap value. Delete the configMap in the delete container. Pod MUST fail to read the configMap from the delete container. release: v1.9 - file: test/e2e/common/projected_configmap.go + file: test/e2e/common/storage/projected_configmap.go - testname: Projected Volume, ConfigMap, volume mode default codename: '[k8s.io] [sig-storage] Projected configMap should be consumable from pods in volume [NodeConformance] [Conformance]' @@ -1061,7 +1061,7 @@ a configMap with default permission mode. Pod MUST be able to read the content of the ConfigMap successfully and the mode on the volume MUST be -rw-r--r--. release: v1.9 - file: test/e2e/common/projected_configmap.go + file: test/e2e/common/storage/projected_configmap.go - testname: Projected Volume, ConfigMap, non-root user codename: '[k8s.io] [sig-storage] Projected configMap should be consumable from pods in volume as non-root [NodeConformance] [Conformance]' @@ -1069,7 +1069,7 @@ a configMap as non-root user with uid 1000. Pod MUST be able to read the content of the ConfigMap successfully and the mode on the volume MUST be -rw-r--r--. release: v1.9 - file: test/e2e/common/projected_configmap.go + file: test/e2e/common/storage/projected_configmap.go - testname: Projected Volume, ConfigMap, volume mode 0400 codename: '[k8s.io] [sig-storage] Projected configMap should be consumable from pods in volume with defaultMode set [LinuxOnly] [NodeConformance] [Conformance]' @@ -1079,7 +1079,7 @@ test is marked LinuxOnly since Windows does not support setting specific file permissions. release: v1.9 - file: test/e2e/common/projected_configmap.go + file: test/e2e/common/storage/projected_configmap.go - testname: Projected Volume, ConfigMap, mapped codename: '[k8s.io] [sig-storage] Projected configMap should be consumable from pods in volume with mappings [NodeConformance] [Conformance]' @@ -1088,7 +1088,7 @@ path. Pod MUST be able to read the content of the ConfigMap from the custom location successfully and the mode on the volume MUST be -rw-r--r--. release: v1.9 - file: test/e2e/common/projected_configmap.go + file: test/e2e/common/storage/projected_configmap.go - testname: Projected Volume, ConfigMap, mapped, volume mode 0400 codename: '[k8s.io] [sig-storage] Projected configMap should be consumable from pods in volume with mappings and Item mode set [LinuxOnly] [NodeConformance] [Conformance]' @@ -1099,7 +1099,7 @@ test is marked LinuxOnly since Windows does not support setting specific file permissions. release: v1.9 - file: test/e2e/common/projected_configmap.go + file: test/e2e/common/storage/projected_configmap.go - testname: Projected Volume, ConfigMap, mapped, non-root user codename: '[k8s.io] [sig-storage] Projected configMap should be consumable from pods in volume with mappings as non-root [NodeConformance] [Conformance]' @@ -1108,7 +1108,7 @@ custom path. Pod MUST be able to read the content of the ConfigMap from the custom location successfully and the mode on the volume MUST be -r--r--r--. release: v1.9 - file: test/e2e/common/projected_configmap.go + file: test/e2e/common/storage/projected_configmap.go - testname: Projected Volume, ConfigMap, multiple volume paths codename: '[k8s.io] [sig-storage] Projected configMap should be consumable in multiple volumes in the same pod [NodeConformance] [Conformance]' @@ -1117,7 +1117,7 @@ be able to read the content of the configMap successfully from the two volume mounts. release: v1.9 - file: test/e2e/common/projected_configmap.go + file: test/e2e/common/storage/projected_configmap.go - testname: Projected Volume, ConfigMap, update codename: '[k8s.io] [sig-storage] Projected configMap updates should be reflected in volume [NodeConformance] [Conformance]' @@ -1126,7 +1126,7 @@ create the configMap with value-1. Pod MUST be able to update the value in the confgiMap to value-2. release: v1.9 - file: test/e2e/common/projected_configmap.go + file: test/e2e/common/storage/projected_configmap.go - testname: Projected Volume, DownwardAPI, CPU limits codename: '[k8s.io] [sig-storage] Projected downwardAPI should provide container''s cpu limit [NodeConformance] [Conformance]' @@ -1134,7 +1134,7 @@ pod name, cpu and memory limits and cpu and memory requests. Pod MUST be able to read the cpu limits from the mounted DownwardAPIVolumeFiles. release: v1.9 - file: test/e2e/common/projected_downwardapi.go + file: test/e2e/common/storage/projected_downwardapi.go - testname: Projected Volume, DownwardAPI, CPU request codename: '[k8s.io] [sig-storage] Projected downwardAPI should provide container''s cpu request [NodeConformance] [Conformance]' @@ -1142,7 +1142,7 @@ pod name, cpu and memory limits and cpu and memory requests. Pod MUST be able to read the cpu request from the mounted DownwardAPIVolumeFiles. release: v1.9 - file: test/e2e/common/projected_downwardapi.go + file: test/e2e/common/storage/projected_downwardapi.go - testname: Projected Volume, DownwardAPI, memory limits codename: '[k8s.io] [sig-storage] Projected downwardAPI should provide container''s memory limit [NodeConformance] [Conformance]' @@ -1150,7 +1150,7 @@ pod name, cpu and memory limits and cpu and memory requests. Pod MUST be able to read the memory limits from the mounted DownwardAPIVolumeFiles. release: v1.9 - file: test/e2e/common/projected_downwardapi.go + file: test/e2e/common/storage/projected_downwardapi.go - testname: Projected Volume, DownwardAPI, memory request codename: '[k8s.io] [sig-storage] Projected downwardAPI should provide container''s memory request [NodeConformance] [Conformance]' @@ -1158,7 +1158,7 @@ pod name, cpu and memory limits and cpu and memory requests. Pod MUST be able to read the memory request from the mounted DownwardAPIVolumeFiles. release: v1.9 - file: test/e2e/common/projected_downwardapi.go + file: test/e2e/common/storage/projected_downwardapi.go - testname: Projected Volume, DownwardAPI, CPU limit, node allocatable codename: '[k8s.io] [sig-storage] Projected downwardAPI should provide node allocatable (cpu) as default cpu limit if the limit is not set [NodeConformance] [Conformance]' @@ -1167,7 +1167,7 @@ resources for requests and limits are NOT specified for the container. Pod MUST be able to read the default cpu limits from the mounted DownwardAPIVolumeFiles. release: v1.9 - file: test/e2e/common/projected_downwardapi.go + file: test/e2e/common/storage/projected_downwardapi.go - testname: Projected Volume, DownwardAPI, memory limit, node allocatable codename: '[k8s.io] [sig-storage] Projected downwardAPI should provide node allocatable (memory) as default memory limit if the limit is not set [NodeConformance] [Conformance]' @@ -1176,7 +1176,7 @@ resources for requests and limits are NOT specified for the container. Pod MUST be able to read the default memory limits from the mounted DownwardAPIVolumeFiles. release: v1.9 - file: test/e2e/common/projected_downwardapi.go + file: test/e2e/common/storage/projected_downwardapi.go - testname: Projected Volume, DownwardAPI, pod name codename: '[k8s.io] [sig-storage] Projected downwardAPI should provide podname only [NodeConformance] [Conformance]' @@ -1184,7 +1184,7 @@ pod name, cpu and memory limits and cpu and memory requests. Pod MUST be able to read the pod name from the mounted DownwardAPIVolumeFiles. release: v1.9 - file: test/e2e/common/projected_downwardapi.go + file: test/e2e/common/storage/projected_downwardapi.go - testname: Projected Volume, DownwardAPI, volume mode 0400 codename: '[k8s.io] [sig-storage] Projected downwardAPI should set DefaultMode on files [LinuxOnly] [NodeConformance] [Conformance]' @@ -1195,7 +1195,7 @@ test is marked LinuxOnly since Windows does not support setting specific file permissions. release: v1.9 - file: test/e2e/common/projected_downwardapi.go + file: test/e2e/common/storage/projected_downwardapi.go - testname: Projected Volume, DownwardAPI, volume mode 0400 codename: '[k8s.io] [sig-storage] Projected downwardAPI should set mode on item file [LinuxOnly] [NodeConformance] [Conformance]' @@ -1206,7 +1206,7 @@ test is marked LinuxOnly since Windows does not support setting specific file permissions. release: v1.9 - file: test/e2e/common/projected_downwardapi.go + file: test/e2e/common/storage/projected_downwardapi.go - testname: Projected Volume, DownwardAPI, update annotation codename: '[k8s.io] [sig-storage] Projected downwardAPI should update annotations on modification [NodeConformance] [Conformance]' @@ -1216,7 +1216,7 @@ Annotations are then updated. Pod MUST be able to read the updated values for the Annotations. release: v1.9 - file: test/e2e/common/projected_downwardapi.go + file: test/e2e/common/storage/projected_downwardapi.go - testname: Projected Volume, DownwardAPI, update labels codename: '[k8s.io] [sig-storage] Projected downwardAPI should update labels on modification [NodeConformance] [Conformance]' @@ -1225,7 +1225,7 @@ MUST be able to read the labels from the mounted DownwardAPIVolumeFiles. Labels are then updated. Pod MUST be able to read the updated values for the Labels. release: v1.9 - file: test/e2e/common/projected_downwardapi.go + file: test/e2e/common/storage/projected_downwardapi.go - testname: Projected Volume, Secrets, create, update delete codename: '[k8s.io] [sig-storage] Projected secret optional updates should be reflected in volume [NodeConformance] [Conformance]' @@ -1237,7 +1237,7 @@ the updated secret value. Delete the secret in the delete container. Pod MUST fail to read the secret from the delete container. release: v1.9 - file: test/e2e/common/projected_secret.go + file: test/e2e/common/storage/projected_secret.go - testname: Projected Volume, Secrets, volume mode default codename: '[k8s.io] [sig-storage] Projected secret should be consumable from pods in volume [NodeConformance] [Conformance]' @@ -1245,7 +1245,7 @@ secret with a specified key with default permission mode. Pod MUST be able to read the content of the key successfully and the mode MUST be -rw-r--r-- by default. release: v1.9 - file: test/e2e/common/projected_secret.go + file: test/e2e/common/storage/projected_secret.go - testname: Project Volume, Secrets, non-root, custom fsGroup codename: '[k8s.io] [sig-storage] Projected secret should be consumable from pods in volume as non-root with defaultMode and fsGroup set [LinuxOnly] [NodeConformance] @@ -1257,7 +1257,7 @@ marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID. release: v1.9 - file: test/e2e/common/projected_secret.go + file: test/e2e/common/storage/projected_secret.go - testname: Projected Volume, Secrets, volume mode 0400 codename: '[k8s.io] [sig-storage] Projected secret should be consumable from pods in volume with defaultMode set [LinuxOnly] [NodeConformance] [Conformance]' @@ -1267,7 +1267,7 @@ -r--------. This test is marked LinuxOnly since Windows does not support setting specific file permissions. release: v1.9 - file: test/e2e/common/projected_secret.go + file: test/e2e/common/storage/projected_secret.go - testname: Projected Volume, Secrets, mapped codename: '[k8s.io] [sig-storage] Projected secret should be consumable from pods in volume with mappings [NodeConformance] [Conformance]' @@ -1276,7 +1276,7 @@ to a custom path. Pod MUST be able to read the content of the key successfully and the mode MUST be -r--------on the mapped volume. release: v1.9 - file: test/e2e/common/projected_secret.go + file: test/e2e/common/storage/projected_secret.go - testname: Projected Volume, Secrets, mapped, volume mode 0400 codename: '[k8s.io] [sig-storage] Projected secret should be consumable from pods in volume with mappings and Item Mode set [LinuxOnly] [NodeConformance] [Conformance]' @@ -1286,7 +1286,7 @@ and the mode MUST be -r-------- on the mapped volume. This test is marked LinuxOnly since Windows does not support setting specific file permissions. release: v1.9 - file: test/e2e/common/projected_secret.go + file: test/e2e/common/storage/projected_secret.go - testname: Projected Volume, Secrets, mapped, multiple paths codename: '[k8s.io] [sig-storage] Projected secret should be consumable in multiple volumes in a pod [NodeConformance] [Conformance]' @@ -1295,7 +1295,7 @@ Pod MUST be able to read the content of the key successfully from the two volume mounts and the mode MUST be -r-------- on the mapped volumes. release: v1.9 - file: test/e2e/common/projected_secret.go + file: test/e2e/common/storage/projected_secret.go - testname: Secrets Volume, create, update and delete codename: '[k8s.io] [sig-storage] Secrets optional updates should be reflected in volume [NodeConformance] [Conformance]' @@ -1307,7 +1307,7 @@ be able to read the updated secret value. Delete the secret in the delete container. Pod MUST fail to read the secret from the delete container. release: v1.9 - file: test/e2e/common/secrets_volume.go + file: test/e2e/common/storage/secrets_volume.go - testname: Secrets Volume, volume mode default, secret with same name in different namespace codename: '[k8s.io] [sig-storage] Secrets should be able to mount in a volume regardless @@ -1319,7 +1319,7 @@ are associated with namespace where pod is created. The file mode of the secret MUST be -rw-r--r-- by default. release: v1.12 - file: test/e2e/common/secrets_volume.go + file: test/e2e/common/storage/secrets_volume.go - testname: Secrets Volume, default codename: '[k8s.io] [sig-storage] Secrets should be consumable from pods in volume [NodeConformance] [Conformance]' @@ -1328,7 +1328,7 @@ from the container runtime and the file mode of the secret MUST be -rw-r--r-- by default. release: v1.9 - file: test/e2e/common/secrets_volume.go + file: test/e2e/common/storage/secrets_volume.go - testname: Secrets Volume, volume mode 0440, fsGroup 1001 and uid 1000 codename: '[k8s.io] [sig-storage] Secrets should be consumable from pods in volume as non-root with defaultMode and fsGroup set [LinuxOnly] [NodeConformance] [Conformance]' @@ -1339,7 +1339,7 @@ default. This test is marked LinuxOnly since Windows does not support setting specific file permissions, or running as UID / GID. release: v1.9 - file: test/e2e/common/secrets_volume.go + file: test/e2e/common/storage/secrets_volume.go - testname: Secrets Volume, volume mode 0400 codename: '[k8s.io] [sig-storage] Secrets should be consumable from pods in volume with defaultMode set [LinuxOnly] [NodeConformance] [Conformance]' @@ -1349,7 +1349,7 @@ MUST be -r-------- by default. This test is marked LinuxOnly since Windows does not support setting specific file permissions. release: v1.9 - file: test/e2e/common/secrets_volume.go + file: test/e2e/common/storage/secrets_volume.go - testname: Secrets Volume, mapping codename: '[k8s.io] [sig-storage] Secrets should be consumable from pods in volume with mappings [NodeConformance] [Conformance]' @@ -1358,7 +1358,7 @@ the mounted volume from the specified custom path. The file mode of the secret MUST be -rw-r--r-- by default. release: v1.9 - file: test/e2e/common/secrets_volume.go + file: test/e2e/common/storage/secrets_volume.go - testname: Secrets Volume, mapping, volume mode 0400 codename: '[k8s.io] [sig-storage] Secrets should be consumable from pods in volume with mappings and Item Mode set [LinuxOnly] [NodeConformance] [Conformance]' @@ -1368,7 +1368,7 @@ The file mode of the secret MUST be -r--r--r--. This test is marked LinuxOnly since Windows does not support setting specific file permissions. release: v1.9 - file: test/e2e/common/secrets_volume.go + file: test/e2e/common/storage/secrets_volume.go - testname: Secrets Volume, mapping multiple volume paths codename: '[k8s.io] [sig-storage] Secrets should be consumable in multiple volumes in a pod [NodeConformance] [Conformance]' @@ -1376,7 +1376,7 @@ into the container in to two different custom paths. Pod MUST be able to read the secret from the both the mounted volumes from the two specified custom paths. release: v1.9 - file: test/e2e/common/secrets_volume.go + file: test/e2e/common/storage/secrets_volume.go - testname: Secrets Volume, immutability codename: '[k8s.io] [sig-storage] Secrets should be immutable if `immutable` field is set [Conformance]' @@ -1386,7 +1386,7 @@ fail. Try to update the secret`s metadata (labels), the update must succeed. Try to delete the secret, the deletion must succeed. release: v1.21 - file: test/e2e/common/secrets_volume.go + file: test/e2e/common/storage/secrets_volume.go - testname: Admission webhook, list mutating webhooks codename: '[sig-api-machinery] AdmissionWebhook [Privileged:ClusterAdmin] listing mutating webhooks should work [Conformance]' diff --git a/test/e2e/common/BUILD b/test/e2e/common/BUILD index 6b0aadafeb2..0cb9f01afac 100644 --- a/test/e2e/common/BUILD +++ b/test/e2e/common/BUILD @@ -8,35 +8,23 @@ load( go_library( name = "go_default_library", srcs = [ - "configmap.go", - "configmap_volume.go", "container.go", "container_probe.go", "docker_containers.go", - "downward_api.go", - "downwardapi_volume.go", - "empty_dir.go", + "downwardapi.go", "expansion.go", "framework.go", - "host_path.go", + "imports.go", "init_container.go", "kubelet.go", "kubelet_etc_hosts.go", "lease.go", "lifecycle_hook.go", - "networking.go", "node_lease.go", "pods.go", - "podtemplates.go", "privileged.go", - "projected_combined.go", - "projected_configmap.go", - "projected_downwardapi.go", - "projected_secret.go", "runtime.go", - "runtimeclass.go", "secrets.go", - "secrets_volume.go", "security_context.go", "sysctl.go", "util.go", @@ -46,14 +34,11 @@ go_library( deps = [ "//pkg/api/v1/pod:go_default_library", "//pkg/client/conditions:go_default_library", - "//pkg/features:go_default_library", "//pkg/kubelet:go_default_library", "//pkg/kubelet/events:go_default_library", "//pkg/kubelet/images:go_default_library", - "//pkg/kubelet/runtimeclass/testing:go_default_library", "//staging/src/k8s.io/api/coordination/v1:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library", - "//staging/src/k8s.io/api/node/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library", @@ -70,11 +55,13 @@ go_library( "//staging/src/k8s.io/apimachinery/pkg/util/uuid:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library", - "//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library", "//staging/src/k8s.io/client-go/dynamic:go_default_library", "//staging/src/k8s.io/client-go/kubernetes:go_default_library", "//staging/src/k8s.io/client-go/tools/cache:go_default_library", "//staging/src/k8s.io/client-go/tools/watch:go_default_library", + "//test/e2e/common/network:go_default_library", + "//test/e2e/common/node:go_default_library", + "//test/e2e/common/storage:go_default_library", "//test/e2e/framework:go_default_library", "//test/e2e/framework/events:go_default_library", "//test/e2e/framework/network:go_default_library", @@ -104,6 +91,11 @@ filegroup( filegroup( name = "all-srcs", - srcs = [":package-srcs"], + srcs = [ + ":package-srcs", + "//test/e2e/common/network:all-srcs", + "//test/e2e/common/node:all-srcs", + "//test/e2e/common/storage:all-srcs", + ], tags = ["automanaged"], ) diff --git a/test/e2e/common/downward_api.go b/test/e2e/common/downwardapi.go similarity index 100% rename from test/e2e/common/downward_api.go rename to test/e2e/common/downwardapi.go diff --git a/test/e2e/common/imports.go b/test/e2e/common/imports.go new file mode 100644 index 00000000000..e916c9dea62 --- /dev/null +++ b/test/e2e/common/imports.go @@ -0,0 +1,24 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package common + +import ( + // ensure these packages are scanned by ginkgo for e2e tests + _ "k8s.io/kubernetes/test/e2e/common/network" + _ "k8s.io/kubernetes/test/e2e/common/node" + _ "k8s.io/kubernetes/test/e2e/common/storage" +) diff --git a/test/e2e/common/network/BUILD b/test/e2e/common/network/BUILD new file mode 100644 index 00000000000..63f7d3b14c3 --- /dev/null +++ b/test/e2e/common/network/BUILD @@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "framework.go", + "networking.go", + ], + importpath = "k8s.io/kubernetes/test/e2e/common/network", + visibility = ["//visibility:public"], + deps = [ + "//staging/src/k8s.io/api/core/v1:go_default_library", + "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library", + "//test/e2e/framework:go_default_library", + "//test/e2e/framework/network:go_default_library", + "//vendor/github.com/onsi/ginkgo:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/test/e2e/common/network/OWNERS b/test/e2e/common/network/OWNERS new file mode 100644 index 00000000000..28e83cd675f --- /dev/null +++ b/test/e2e/common/network/OWNERS @@ -0,0 +1,4 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +labels: +- sig/network diff --git a/test/e2e/common/network/framework.go b/test/e2e/common/network/framework.go new file mode 100644 index 00000000000..e2b3d7d3052 --- /dev/null +++ b/test/e2e/common/network/framework.go @@ -0,0 +1,24 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package network + +import "k8s.io/kubernetes/test/e2e/framework" + +// SIGDescribe annotates the test with the SIG label. +func SIGDescribe(text string, body func()) bool { + return framework.KubeDescribe("[sig-network] "+text, body) +} diff --git a/test/e2e/common/networking.go b/test/e2e/common/network/networking.go similarity index 99% rename from test/e2e/common/networking.go rename to test/e2e/common/network/networking.go index 7044ac0361b..55dc0d3e00a 100644 --- a/test/e2e/common/networking.go +++ b/test/e2e/common/network/networking.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package common +package network import ( "github.com/onsi/ginkgo" @@ -24,7 +24,7 @@ import ( e2enetwork "k8s.io/kubernetes/test/e2e/framework/network" ) -var _ = SIGNetworkDescribe("Networking", func() { +var _ = SIGDescribe("Networking", func() { f := framework.NewDefaultFramework("pod-network-test") ginkgo.Describe("Granular Checks: Pods", func() { diff --git a/test/e2e/common/node/BUILD b/test/e2e/common/node/BUILD new file mode 100644 index 00000000000..702a5ab0bfa --- /dev/null +++ b/test/e2e/common/node/BUILD @@ -0,0 +1,46 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "configmap.go", + "framework.go", + "podtemplates.go", + "runtimeclass.go", + ], + importpath = "k8s.io/kubernetes/test/e2e/common/node", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kubelet/events:go_default_library", + "//pkg/kubelet/runtimeclass/testing:go_default_library", + "//staging/src/k8s.io/api/core/v1:go_default_library", + "//staging/src/k8s.io/api/node/v1:go_default_library", + "//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library", + "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//staging/src/k8s.io/apimachinery/pkg/fields:go_default_library", + "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library", + "//staging/src/k8s.io/apimachinery/pkg/util/uuid:go_default_library", + "//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library", + "//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library", + "//test/e2e/framework:go_default_library", + "//test/e2e/framework/events:go_default_library", + "//test/e2e/framework/node:go_default_library", + "//test/e2e/framework/pod:go_default_library", + "//test/utils/image:go_default_library", + "//vendor/github.com/onsi/ginkgo:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/test/e2e/common/node/OWNERS b/test/e2e/common/node/OWNERS new file mode 100644 index 00000000000..796ef76252d --- /dev/null +++ b/test/e2e/common/node/OWNERS @@ -0,0 +1,4 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +labels: +- sig/node diff --git a/test/e2e/common/configmap.go b/test/e2e/common/node/configmap.go similarity index 96% rename from test/e2e/common/configmap.go rename to test/e2e/common/node/configmap.go index 4f0d708707a..b9655fcbb87 100644 --- a/test/e2e/common/configmap.go +++ b/test/e2e/common/node/configmap.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package common +package node import ( "context" @@ -31,7 +31,7 @@ import ( "github.com/onsi/ginkgo" ) -var _ = SIGNodeDescribe("ConfigMap", func() { +var _ = SIGDescribe("ConfigMap", func() { f := framework.NewDefaultFramework("configmap") /* @@ -238,6 +238,21 @@ var _ = SIGNodeDescribe("ConfigMap", func() { }) }) +func newConfigMap(f *framework.Framework, name string) *v1.ConfigMap { + return &v1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: f.Namespace.Name, + Name: name, + }, + Data: map[string]string{ + "data-1": "value-1", + "data-2": "value-2", + "data-3": "value-3", + }, + } +} + +// TODO: Unify with newConfigMap func newEnvFromConfigMap(f *framework.Framework, name string) *v1.ConfigMap { return &v1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ diff --git a/test/e2e/common/node/framework.go b/test/e2e/common/node/framework.go new file mode 100644 index 00000000000..307feda8bf1 --- /dev/null +++ b/test/e2e/common/node/framework.go @@ -0,0 +1,24 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package node + +import "k8s.io/kubernetes/test/e2e/framework" + +// SIGDescribe annotates the test with the SIG label. +func SIGDescribe(text string, body func()) bool { + return framework.KubeDescribe("[sig-node] "+text, body) +} diff --git a/test/e2e/common/podtemplates.go b/test/e2e/common/node/podtemplates.go similarity index 99% rename from test/e2e/common/podtemplates.go rename to test/e2e/common/node/podtemplates.go index aeab52aa9de..8c3388bf107 100644 --- a/test/e2e/common/podtemplates.go +++ b/test/e2e/common/node/podtemplates.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package common +package node import ( "context" @@ -38,7 +38,7 @@ const ( podTemplateRetryTimeout = 1 * time.Minute ) -var _ = SIGNodeDescribe("PodTemplates", func() { +var _ = SIGDescribe("PodTemplates", func() { f := framework.NewDefaultFramework("podtemplate") /* Release: v1.19 diff --git a/test/e2e/common/runtimeclass.go b/test/e2e/common/node/runtimeclass.go similarity index 99% rename from test/e2e/common/runtimeclass.go rename to test/e2e/common/node/runtimeclass.go index 37b90beb094..c782c3a097b 100644 --- a/test/e2e/common/runtimeclass.go +++ b/test/e2e/common/node/runtimeclass.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package common +package node import ( "context" @@ -39,7 +39,7 @@ import ( "github.com/onsi/ginkgo" ) -var _ = SIGNodeDescribe("RuntimeClass", func() { +var _ = SIGDescribe("RuntimeClass", func() { f := framework.NewDefaultFramework("runtimeclass") ginkgo.It("should reject a Pod requesting a non-existent RuntimeClass [NodeFeature:RuntimeHandler]", func() { diff --git a/test/e2e/common/secrets.go b/test/e2e/common/secrets.go index cfc887542a3..81df86635b4 100644 --- a/test/e2e/common/secrets.go +++ b/test/e2e/common/secrets.go @@ -233,6 +233,21 @@ var _ = ginkgo.Describe("[sig-api-machinery] Secrets", func() { }) }) +func secretForTest(namespace, name string) *v1.Secret { + return &v1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: namespace, + Name: name, + }, + Data: map[string][]byte{ + "data-1": []byte("value-1\n"), + "data-2": []byte("value-2\n"), + "data-3": []byte("value-3\n"), + }, + } +} + +// TODO: Unify with secretForTest. func newEnvFromSecret(namespace, name string) *v1.Secret { return &v1.Secret{ ObjectMeta: metav1.ObjectMeta{ diff --git a/test/e2e/common/storage/BUILD b/test/e2e/common/storage/BUILD new file mode 100644 index 00000000000..afdd9e3fa39 --- /dev/null +++ b/test/e2e/common/storage/BUILD @@ -0,0 +1,49 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "configmap_volume.go", + "downwardapi_volume.go", + "empty_dir.go", + "framework.go", + "host_path.go", + "projected_combined.go", + "projected_configmap.go", + "projected_downwardapi.go", + "projected_secret.go", + "secrets_volume.go", + "util.go", + ], + importpath = "k8s.io/kubernetes/test/e2e/common/storage", + visibility = ["//visibility:public"], + deps = [ + "//pkg/features:go_default_library", + "//staging/src/k8s.io/api/core/v1:go_default_library", + "//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library", + "//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library", + "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//staging/src/k8s.io/apimachinery/pkg/util/uuid:go_default_library", + "//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library", + "//test/e2e/framework:go_default_library", + "//test/e2e/framework/pod:go_default_library", + "//test/e2e/framework/skipper:go_default_library", + "//test/utils/image:go_default_library", + "//vendor/github.com/onsi/ginkgo:go_default_library", + "//vendor/github.com/onsi/gomega:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/test/e2e/common/storage/OWNERS b/test/e2e/common/storage/OWNERS new file mode 100644 index 00000000000..c625bd43801 --- /dev/null +++ b/test/e2e/common/storage/OWNERS @@ -0,0 +1,4 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +labels: +- sig/storage diff --git a/test/e2e/common/configmap_volume.go b/test/e2e/common/storage/configmap_volume.go similarity index 99% rename from test/e2e/common/configmap_volume.go rename to test/e2e/common/storage/configmap_volume.go index 2d480d67f8f..999987551f2 100644 --- a/test/e2e/common/configmap_volume.go +++ b/test/e2e/common/storage/configmap_volume.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package common +package storage import ( "context" @@ -33,7 +33,7 @@ import ( imageutils "k8s.io/kubernetes/test/utils/image" ) -var _ = SIGStorageDescribe("ConfigMap", func() { +var _ = SIGDescribe("ConfigMap", func() { f := framework.NewDefaultFramework("configmap") /* diff --git a/test/e2e/common/downwardapi_volume.go b/test/e2e/common/storage/downwardapi_volume.go similarity index 99% rename from test/e2e/common/downwardapi_volume.go rename to test/e2e/common/storage/downwardapi_volume.go index 1244c823b8f..bb442fcf613 100644 --- a/test/e2e/common/downwardapi_volume.go +++ b/test/e2e/common/storage/downwardapi_volume.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package common +package storage import ( "fmt" @@ -33,7 +33,7 @@ import ( "github.com/onsi/gomega" ) -var _ = SIGStorageDescribe("Downward API volume", func() { +var _ = SIGDescribe("Downward API volume", func() { // How long to wait for a log pod to be displayed const podLogTimeout = 3 * time.Minute f := framework.NewDefaultFramework("downward-api") diff --git a/test/e2e/common/empty_dir.go b/test/e2e/common/storage/empty_dir.go similarity index 99% rename from test/e2e/common/empty_dir.go rename to test/e2e/common/storage/empty_dir.go index aac16bbf6c0..ff72f155a07 100644 --- a/test/e2e/common/empty_dir.go +++ b/test/e2e/common/storage/empty_dir.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package common +package storage import ( "context" @@ -42,7 +42,7 @@ var ( nonRootUID = int64(1001) ) -var _ = SIGStorageDescribe("EmptyDir volumes", func() { +var _ = SIGDescribe("EmptyDir volumes", func() { f := framework.NewDefaultFramework("emptydir") ginkgo.Context("when FSGroup is specified [LinuxOnly] [NodeFeature:FSGroup]", func() { diff --git a/test/e2e/common/storage/framework.go b/test/e2e/common/storage/framework.go new file mode 100644 index 00000000000..e3c72cc91a9 --- /dev/null +++ b/test/e2e/common/storage/framework.go @@ -0,0 +1,24 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package storage + +import "k8s.io/kubernetes/test/e2e/framework" + +// SIGDescribe annotates the test with the SIG label. +func SIGDescribe(text string, body func()) bool { + return framework.KubeDescribe("[sig-storage] "+text, body) +} diff --git a/test/e2e/common/host_path.go b/test/e2e/common/storage/host_path.go similarity index 98% rename from test/e2e/common/host_path.go rename to test/e2e/common/storage/host_path.go index 1b792d0f7d4..81abbf73bd9 100644 --- a/test/e2e/common/host_path.go +++ b/test/e2e/common/storage/host_path.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package common +package storage import ( "fmt" @@ -31,7 +31,7 @@ import ( //TODO : Consolidate this code with the code for emptyDir. //This will require some smart. -var _ = SIGStorageDescribe("HostPath", func() { +var _ = SIGDescribe("HostPath", func() { f := framework.NewDefaultFramework("hostpath") ginkgo.BeforeEach(func() { diff --git a/test/e2e/common/projected_combined.go b/test/e2e/common/storage/projected_combined.go similarity index 98% rename from test/e2e/common/projected_combined.go rename to test/e2e/common/storage/projected_combined.go index c260a348320..6d4969382fe 100644 --- a/test/e2e/common/projected_combined.go +++ b/test/e2e/common/storage/projected_combined.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package common +package storage import ( "context" @@ -29,7 +29,7 @@ import ( "github.com/onsi/ginkgo" ) -var _ = SIGStorageDescribe("Projected combined", func() { +var _ = SIGDescribe("Projected combined", func() { f := framework.NewDefaultFramework("projected") // Test multiple projections diff --git a/test/e2e/common/projected_configmap.go b/test/e2e/common/storage/projected_configmap.go similarity index 99% rename from test/e2e/common/projected_configmap.go rename to test/e2e/common/storage/projected_configmap.go index ae362452233..37f51279da7 100644 --- a/test/e2e/common/projected_configmap.go +++ b/test/e2e/common/storage/projected_configmap.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package common +package storage import ( "context" @@ -33,7 +33,7 @@ import ( "github.com/onsi/gomega" ) -var _ = SIGStorageDescribe("Projected configMap", func() { +var _ = SIGDescribe("Projected configMap", func() { f := framework.NewDefaultFramework("projected") /* diff --git a/test/e2e/common/projected_downwardapi.go b/test/e2e/common/storage/projected_downwardapi.go similarity index 99% rename from test/e2e/common/projected_downwardapi.go rename to test/e2e/common/storage/projected_downwardapi.go index 8f43bc54fc0..3e89d990277 100644 --- a/test/e2e/common/projected_downwardapi.go +++ b/test/e2e/common/storage/projected_downwardapi.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package common +package storage import ( "fmt" @@ -32,7 +32,7 @@ import ( "github.com/onsi/gomega" ) -var _ = SIGStorageDescribe("Projected downwardAPI", func() { +var _ = SIGDescribe("Projected downwardAPI", func() { f := framework.NewDefaultFramework("projected") // How long to wait for a log pod to be displayed diff --git a/test/e2e/common/projected_secret.go b/test/e2e/common/storage/projected_secret.go similarity index 99% rename from test/e2e/common/projected_secret.go rename to test/e2e/common/storage/projected_secret.go index 44127400d54..af23f516b7e 100644 --- a/test/e2e/common/projected_secret.go +++ b/test/e2e/common/storage/projected_secret.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package common +package storage import ( "context" @@ -32,7 +32,7 @@ import ( "github.com/onsi/gomega" ) -var _ = SIGStorageDescribe("Projected secret", func() { +var _ = SIGDescribe("Projected secret", func() { f := framework.NewDefaultFramework("projected") /* diff --git a/test/e2e/common/secrets_volume.go b/test/e2e/common/storage/secrets_volume.go similarity index 99% rename from test/e2e/common/secrets_volume.go rename to test/e2e/common/storage/secrets_volume.go index 07e90d19d4d..d138f54b18e 100644 --- a/test/e2e/common/secrets_volume.go +++ b/test/e2e/common/storage/secrets_volume.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package common +package storage import ( "context" @@ -33,7 +33,7 @@ import ( "github.com/onsi/gomega" ) -var _ = SIGStorageDescribe("Secrets", func() { +var _ = SIGDescribe("Secrets", func() { f := framework.NewDefaultFramework("secrets") /* diff --git a/test/e2e/common/storage/util.go b/test/e2e/common/storage/util.go new file mode 100644 index 00000000000..7b6051e396d --- /dev/null +++ b/test/e2e/common/storage/util.go @@ -0,0 +1,74 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package storage + +import ( + "fmt" + "os" + + v1 "k8s.io/api/core/v1" + "k8s.io/kubernetes/test/e2e/framework" +) + +var ( + // non-Administrator Windows user used in tests. This is the Windows equivalent of the Linux non-root UID usage. + nonAdminTestUserName = "ContainerUser" + // non-root UID used in tests. + nonRootTestUserID = int64(1000) +) + +// setPodNonRootUser configures the Pod to run as a non-root user. +// For Windows, it sets the RunAsUserName field to ContainerUser, and for Linux, it sets the RunAsUser field to 1000. +func setPodNonRootUser(pod *v1.Pod) { + if framework.NodeOSDistroIs("windows") { + pod.Spec.SecurityContext.WindowsOptions = &v1.WindowsSecurityContextOptions{RunAsUserName: &nonAdminTestUserName} + } else { + pod.Spec.SecurityContext.RunAsUser = &nonRootTestUserID + } +} + +// getFileModeRegex returns a file mode related regex which should be matched by the mounttest pods' output. +// If the given mask is nil, then the regex will contain the default OS file modes, which are 0644 for Linux and 0775 for Windows. +func getFileModeRegex(filePath string, mask *int32) string { + var ( + linuxMask int32 + windowsMask int32 + ) + if mask == nil { + linuxMask = int32(0644) + windowsMask = int32(0775) + } else { + linuxMask = *mask + windowsMask = *mask + } + + linuxOutput := fmt.Sprintf("mode of file \"%s\": %v", filePath, os.FileMode(linuxMask)) + windowsOutput := fmt.Sprintf("mode of Windows file \"%v\": %s", filePath, os.FileMode(windowsMask)) + + return fmt.Sprintf("(%s|%s)", linuxOutput, windowsOutput) +} + +// createMounts creates a v1.VolumeMount list with a single element. +func createMounts(volumeName, volumeMountPath string, readOnly bool) []v1.VolumeMount { + return []v1.VolumeMount{ + { + Name: volumeName, + MountPath: volumeMountPath, + ReadOnly: readOnly, + }, + } +} diff --git a/test/e2e/common/util.go b/test/e2e/common/util.go index d84e91761ad..28e0204f04d 100644 --- a/test/e2e/common/util.go +++ b/test/e2e/common/util.go @@ -20,7 +20,6 @@ import ( "bytes" "context" "fmt" - "os" "text/template" "time" @@ -48,8 +47,6 @@ const ( ) var ( - // non-Administrator Windows user used in tests. This is the Windows equivalent of the Linux non-root UID usage. - nonAdminTestUserName = "ContainerUser" // non-root UID used in tests. nonRootTestUserID = int64(1000) ) @@ -212,45 +209,3 @@ func rcByNamePort(name string, replicas int32, image string, containerArgs []str Ports: []v1.ContainerPort{{ContainerPort: int32(port), Protocol: protocol}}, }, gracePeriod) } - -// setPodNonRootUser configures the Pod to run as a non-root user. -// For Windows, it sets the RunAsUserName field to ContainerUser, and for Linux, it sets the RunAsUser field to 1000. -func setPodNonRootUser(pod *v1.Pod) { - if framework.NodeOSDistroIs("windows") { - pod.Spec.SecurityContext.WindowsOptions = &v1.WindowsSecurityContextOptions{RunAsUserName: &nonAdminTestUserName} - } else { - pod.Spec.SecurityContext.RunAsUser = &nonRootTestUserID - } -} - -// getFileModeRegex returns a file mode related regex which should be matched by the mounttest pods' output. -// If the given mask is nil, then the regex will contain the default OS file modes, which are 0644 for Linux and 0775 for Windows. -func getFileModeRegex(filePath string, mask *int32) string { - var ( - linuxMask int32 - windowsMask int32 - ) - if mask == nil { - linuxMask = int32(0644) - windowsMask = int32(0775) - } else { - linuxMask = *mask - windowsMask = *mask - } - - linuxOutput := fmt.Sprintf("mode of file \"%s\": %v", filePath, os.FileMode(linuxMask)) - windowsOutput := fmt.Sprintf("mode of Windows file \"%v\": %s", filePath, os.FileMode(windowsMask)) - - return fmt.Sprintf("(%s|%s)", linuxOutput, windowsOutput) -} - -// createMounts creates a v1.VolumeMount list with a single element. -func createMounts(volumeName, volumeMountPath string, readOnly bool) []v1.VolumeMount { - return []v1.VolumeMount{ - { - Name: volumeName, - MountPath: volumeMountPath, - ReadOnly: readOnly, - }, - } -}