Merge pull request #121293 from AkihiroSuda/e2e-KubeletInUserNamespace
e2e: add [Environment:NotInUserNS] tag to sysctl tests
This commit is contained in:
		
							
								
								
									
										5
									
								
								test/conformance/testdata/conformance.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								test/conformance/testdata/conformance.yaml
									
									
									
									
										vendored
									
									
								
							@@ -2466,10 +2466,11 @@
 | 
				
			|||||||
  file: test/e2e/common/node/sysctl.go
 | 
					  file: test/e2e/common/node/sysctl.go
 | 
				
			||||||
- testname: Sysctl, test sysctls
 | 
					- testname: Sysctl, test sysctls
 | 
				
			||||||
  codename: '[sig-node] Sysctls [LinuxOnly] [NodeConformance] should support sysctls
 | 
					  codename: '[sig-node] Sysctls [LinuxOnly] [NodeConformance] should support sysctls
 | 
				
			||||||
    [MinimumKubeletVersion:1.21] [Conformance]'
 | 
					    [MinimumKubeletVersion:1.21] [Environment:NotInUserNS] [Conformance]'
 | 
				
			||||||
  description: 'Pod is created with kernel.shm_rmid_forced sysctl. Kernel.shm_rmid_forced
 | 
					  description: 'Pod is created with kernel.shm_rmid_forced sysctl. Kernel.shm_rmid_forced
 | 
				
			||||||
    must be set to 1 [LinuxOnly]: This test is marked as LinuxOnly since Windows does
 | 
					    must be set to 1 [LinuxOnly]: This test is marked as LinuxOnly since Windows does
 | 
				
			||||||
    not support sysctls'
 | 
					    not support sysctls [Environment:NotInUserNS]: The test fails in UserNS (as expected):
 | 
				
			||||||
 | 
					    `open /proc/sys/kernel/shm_rmid_forced: permission denied`'
 | 
				
			||||||
  release: v1.21
 | 
					  release: v1.21
 | 
				
			||||||
  file: test/e2e/common/node/sysctl.go
 | 
					  file: test/e2e/common/node/sysctl.go
 | 
				
			||||||
- testname: Environment variables, expansion
 | 
					- testname: Environment variables, expansion
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -73,8 +73,9 @@ var _ = SIGDescribe("Sysctls [LinuxOnly] [NodeConformance]", func() {
 | 
				
			|||||||
	  Testname: Sysctl, test sysctls
 | 
						  Testname: Sysctl, test sysctls
 | 
				
			||||||
	  Description: Pod is created with kernel.shm_rmid_forced sysctl. Kernel.shm_rmid_forced must be set to 1
 | 
						  Description: Pod is created with kernel.shm_rmid_forced sysctl. Kernel.shm_rmid_forced must be set to 1
 | 
				
			||||||
	  [LinuxOnly]: This test is marked as LinuxOnly since Windows does not support sysctls
 | 
						  [LinuxOnly]: This test is marked as LinuxOnly since Windows does not support sysctls
 | 
				
			||||||
 | 
						  [Environment:NotInUserNS]: The test fails in UserNS (as expected): `open /proc/sys/kernel/shm_rmid_forced: permission denied`
 | 
				
			||||||
	*/
 | 
						*/
 | 
				
			||||||
	framework.ConformanceIt("should support sysctls [MinimumKubeletVersion:1.21]", func(ctx context.Context) {
 | 
						framework.ConformanceIt("should support sysctls [MinimumKubeletVersion:1.21] [Environment:NotInUserNS]", func(ctx context.Context) {
 | 
				
			||||||
		pod := testPod()
 | 
							pod := testPod()
 | 
				
			||||||
		pod.Spec.SecurityContext = &v1.PodSecurityContext{
 | 
							pod.Spec.SecurityContext = &v1.PodSecurityContext{
 | 
				
			||||||
			Sysctls: []v1.Sysctl{
 | 
								Sysctls: []v1.Sysctl{
 | 
				
			||||||
@@ -182,8 +183,9 @@ var _ = SIGDescribe("Sysctls [LinuxOnly] [NodeConformance]", func() {
 | 
				
			|||||||
	  Testname: Sysctl, test sysctls supports slashes
 | 
						  Testname: Sysctl, test sysctls supports slashes
 | 
				
			||||||
	  Description: Pod is created with kernel/shm_rmid_forced sysctl. Support slashes as sysctl separator. The '/' separator is also accepted in place of a '.'
 | 
						  Description: Pod is created with kernel/shm_rmid_forced sysctl. Support slashes as sysctl separator. The '/' separator is also accepted in place of a '.'
 | 
				
			||||||
	  [LinuxOnly]: This test is marked as LinuxOnly since Windows does not support sysctls
 | 
						  [LinuxOnly]: This test is marked as LinuxOnly since Windows does not support sysctls
 | 
				
			||||||
 | 
						  [Environment:NotInUserNS]: The test fails in UserNS (as expected): `open /proc/sys/kernel/shm_rmid_forced: permission denied`
 | 
				
			||||||
	*/
 | 
						*/
 | 
				
			||||||
	ginkgo.It("should support sysctls with slashes as separator [MinimumKubeletVersion:1.23]", func(ctx context.Context) {
 | 
						ginkgo.It("should support sysctls with slashes as separator [MinimumKubeletVersion:1.23] [Environment:NotInUserNS]", func(ctx context.Context) {
 | 
				
			||||||
		pod := testPod()
 | 
							pod := testPod()
 | 
				
			||||||
		pod.Spec.SecurityContext = &v1.PodSecurityContext{
 | 
							pod.Spec.SecurityContext = &v1.PodSecurityContext{
 | 
				
			||||||
			Sysctls: []v1.Sysctl{
 | 
								Sysctls: []v1.Sysctl{
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user