mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-11-04 07:49:35 +00:00 
			
		
		
		
	Add empty dir and host related conformance annotations
Signed-off-by: Brad Topol <btopol@us.ibm.com>
This commit is contained in:
		@@ -67,58 +67,141 @@ var _ = Describe("[sig-storage] EmptyDir volumes", func() {
 | 
				
			|||||||
		})
 | 
							})
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
							    Testname: volume-emptydir-mode-tmpfs
 | 
				
			||||||
 | 
							    Description: For a Pod created with an 'emptyDir' Volume with 'medium'
 | 
				
			||||||
 | 
								of 'Memory', ensure the volume has 0777 unix file permissions and tmpfs
 | 
				
			||||||
 | 
								mount type.
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
	framework.ConformanceIt("volume on tmpfs should have the correct mode", func() {
 | 
						framework.ConformanceIt("volume on tmpfs should have the correct mode", func() {
 | 
				
			||||||
		doTestVolumeMode(f, testImageRootUid, v1.StorageMediumMemory)
 | 
							doTestVolumeMode(f, testImageRootUid, v1.StorageMediumMemory)
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
							    Testname: volume-emptydir-root-0644-tmpfs
 | 
				
			||||||
 | 
							    Description: For a Pod created with an 'emptyDir' Volume with 'medium'
 | 
				
			||||||
 | 
								of 'Memory', ensure a root owned file with 0644 unix file permissions
 | 
				
			||||||
 | 
								is created correctly, has tmpfs mount type, and enforces the permissions.
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
	framework.ConformanceIt("should support (root,0644,tmpfs)", func() {
 | 
						framework.ConformanceIt("should support (root,0644,tmpfs)", func() {
 | 
				
			||||||
		doTest0644(f, testImageRootUid, v1.StorageMediumMemory)
 | 
							doTest0644(f, testImageRootUid, v1.StorageMediumMemory)
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
							    Testname: volume-emptydir-root-0666-tmpfs
 | 
				
			||||||
 | 
							    Description: For a Pod created with an 'emptyDir' Volume with 'medium'
 | 
				
			||||||
 | 
								of 'Memory', ensure a root owned file with 0666 unix file permissions
 | 
				
			||||||
 | 
								is created correctly, has tmpfs mount type, and enforces the permissions.
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
	framework.ConformanceIt("should support (root,0666,tmpfs)", func() {
 | 
						framework.ConformanceIt("should support (root,0666,tmpfs)", func() {
 | 
				
			||||||
		doTest0666(f, testImageRootUid, v1.StorageMediumMemory)
 | 
							doTest0666(f, testImageRootUid, v1.StorageMediumMemory)
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
							    Testname: volume-emptydir-root-0777-tmpfs
 | 
				
			||||||
 | 
							    Description: For a Pod created with an 'emptyDir' Volume with 'medium'
 | 
				
			||||||
 | 
								of 'Memory', ensure a root owned file with 0777 unix file permissions
 | 
				
			||||||
 | 
								is created correctly, has tmpfs mount type, and enforces the permissions.
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
	framework.ConformanceIt("should support (root,0777,tmpfs)", func() {
 | 
						framework.ConformanceIt("should support (root,0777,tmpfs)", func() {
 | 
				
			||||||
		doTest0777(f, testImageRootUid, v1.StorageMediumMemory)
 | 
							doTest0777(f, testImageRootUid, v1.StorageMediumMemory)
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
							    Testname: volume-emptydir-user-0644-tmpfs
 | 
				
			||||||
 | 
							    Description: For a Pod created with an 'emptyDir' Volume with 'medium'
 | 
				
			||||||
 | 
								of 'Memory', ensure a user owned file with 0644 unix file permissions
 | 
				
			||||||
 | 
								is created correctly, has tmpfs mount type, and enforces the permissions.
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
	framework.ConformanceIt("should support (non-root,0644,tmpfs)", func() {
 | 
						framework.ConformanceIt("should support (non-root,0644,tmpfs)", func() {
 | 
				
			||||||
		doTest0644(f, testImageNonRootUid, v1.StorageMediumMemory)
 | 
							doTest0644(f, testImageNonRootUid, v1.StorageMediumMemory)
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
							    Testname: volume-emptydir-user-0666-tmpfs
 | 
				
			||||||
 | 
							    Description: For a Pod created with an 'emptyDir' Volume with 'medium'
 | 
				
			||||||
 | 
								of 'Memory', ensure a user owned file with 0666 unix file permissions
 | 
				
			||||||
 | 
								is created correctly, has tmpfs mount type, and enforces the permissions.
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
	framework.ConformanceIt("should support (non-root,0666,tmpfs)", func() {
 | 
						framework.ConformanceIt("should support (non-root,0666,tmpfs)", func() {
 | 
				
			||||||
		doTest0666(f, testImageNonRootUid, v1.StorageMediumMemory)
 | 
							doTest0666(f, testImageNonRootUid, v1.StorageMediumMemory)
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
							    Testname: volume-emptydir-user-0777-tmpfs
 | 
				
			||||||
 | 
							    Description: For a Pod created with an 'emptyDir' Volume with 'medium'
 | 
				
			||||||
 | 
								of 'Memory', ensure a user owned file with 0777 unix file permissions
 | 
				
			||||||
 | 
								is created correctly, has tmpfs mount type, and enforces the permissions.
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
	framework.ConformanceIt("should support (non-root,0777,tmpfs)", func() {
 | 
						framework.ConformanceIt("should support (non-root,0777,tmpfs)", func() {
 | 
				
			||||||
		doTest0777(f, testImageNonRootUid, v1.StorageMediumMemory)
 | 
							doTest0777(f, testImageNonRootUid, v1.StorageMediumMemory)
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
							    Testname: volume-emptydir-mode
 | 
				
			||||||
 | 
							    Description: For a Pod created with an 'emptyDir' Volume, ensure the
 | 
				
			||||||
 | 
								volume has 0777 unix file permissions.
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
	framework.ConformanceIt("volume on default medium should have the correct mode", func() {
 | 
						framework.ConformanceIt("volume on default medium should have the correct mode", func() {
 | 
				
			||||||
		doTestVolumeMode(f, testImageRootUid, v1.StorageMediumDefault)
 | 
							doTestVolumeMode(f, testImageRootUid, v1.StorageMediumDefault)
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
							    Testname: volume-emptydir-root-0644
 | 
				
			||||||
 | 
							    Description: For a Pod created with an 'emptyDir' Volume, ensure a
 | 
				
			||||||
 | 
								root owned file with 0644 unix file permissions is created and enforced
 | 
				
			||||||
 | 
								correctly.
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
	framework.ConformanceIt("should support (root,0644,default)", func() {
 | 
						framework.ConformanceIt("should support (root,0644,default)", func() {
 | 
				
			||||||
		doTest0644(f, testImageRootUid, v1.StorageMediumDefault)
 | 
							doTest0644(f, testImageRootUid, v1.StorageMediumDefault)
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
							    Testname: volume-emptydir-root-0666
 | 
				
			||||||
 | 
							    Description: For a Pod created with an 'emptyDir' Volume, ensure a
 | 
				
			||||||
 | 
								root owned file with 0666 unix file permissions is created and enforced
 | 
				
			||||||
 | 
								correctly.
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
	framework.ConformanceIt("should support (root,0666,default)", func() {
 | 
						framework.ConformanceIt("should support (root,0666,default)", func() {
 | 
				
			||||||
		doTest0666(f, testImageRootUid, v1.StorageMediumDefault)
 | 
							doTest0666(f, testImageRootUid, v1.StorageMediumDefault)
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
							    Testname: volume-emptydir-root-0777
 | 
				
			||||||
 | 
							    Description: For a Pod created with an 'emptyDir' Volume, ensure a
 | 
				
			||||||
 | 
								root owned file with 0777 unix file permissions is created and enforced
 | 
				
			||||||
 | 
								correctly.
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
	framework.ConformanceIt("should support (root,0777,default)", func() {
 | 
						framework.ConformanceIt("should support (root,0777,default)", func() {
 | 
				
			||||||
		doTest0777(f, testImageRootUid, v1.StorageMediumDefault)
 | 
							doTest0777(f, testImageRootUid, v1.StorageMediumDefault)
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
							    Testname: volume-emptydir-user-0644
 | 
				
			||||||
 | 
							    Description: For a Pod created with an 'emptyDir' Volume, ensure a
 | 
				
			||||||
 | 
								user owned file with 0644 unix file permissions is created and enforced
 | 
				
			||||||
 | 
								correctly.
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
	framework.ConformanceIt("should support (non-root,0644,default)", func() {
 | 
						framework.ConformanceIt("should support (non-root,0644,default)", func() {
 | 
				
			||||||
		doTest0644(f, testImageNonRootUid, v1.StorageMediumDefault)
 | 
							doTest0644(f, testImageNonRootUid, v1.StorageMediumDefault)
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
							    Testname: volume-emptydir-user-0666
 | 
				
			||||||
 | 
							    Description: For a Pod created with an 'emptyDir' Volume, ensure a
 | 
				
			||||||
 | 
								user owned file with 0666 unix file permissions is created and enforced
 | 
				
			||||||
 | 
								correctly.
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
	framework.ConformanceIt("should support (non-root,0666,default)", func() {
 | 
						framework.ConformanceIt("should support (non-root,0666,default)", func() {
 | 
				
			||||||
		doTest0666(f, testImageNonRootUid, v1.StorageMediumDefault)
 | 
							doTest0666(f, testImageNonRootUid, v1.StorageMediumDefault)
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
							    Testname: volume-emptydir-user-0777
 | 
				
			||||||
 | 
							    Description: For a Pod created with an 'emptyDir' Volume, ensure a
 | 
				
			||||||
 | 
								user owned file with 0777 unix file permissions is created and enforced
 | 
				
			||||||
 | 
								correctly.
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
	framework.ConformanceIt("should support (non-root,0777,default)", func() {
 | 
						framework.ConformanceIt("should support (non-root,0777,default)", func() {
 | 
				
			||||||
		doTest0777(f, testImageNonRootUid, v1.StorageMediumDefault)
 | 
							doTest0777(f, testImageNonRootUid, v1.StorageMediumDefault)
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -40,6 +40,12 @@ var _ = Describe("[sig-storage] HostPath", func() {
 | 
				
			|||||||
		_ = os.Remove("/tmp/test-file")
 | 
							_ = os.Remove("/tmp/test-file")
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
							    Testname: volume-hostpath-mode
 | 
				
			||||||
 | 
							    Description: For a Pod created with a 'HostPath' Volume, ensure the
 | 
				
			||||||
 | 
								volume is a directory with 0777 unix file permissions and that is has
 | 
				
			||||||
 | 
								the sticky bit (mode flag t) set.
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
	framework.ConformanceIt("should give a volume the correct mode", func() {
 | 
						framework.ConformanceIt("should give a volume the correct mode", func() {
 | 
				
			||||||
		source := &v1.HostPathVolumeSource{
 | 
							source := &v1.HostPathVolumeSource{
 | 
				
			||||||
			Path: "/tmp",
 | 
								Path: "/tmp",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -48,6 +48,11 @@ var _ = framework.KubeDescribe("KubeletManagedEtcHosts", func() {
 | 
				
			|||||||
		f: f,
 | 
							f: f,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
							    Testname: kubelet-managed-etc-hosts
 | 
				
			||||||
 | 
							    Description: Make sure Kubelet correctly manages /etc/hosts and mounts
 | 
				
			||||||
 | 
								it into the container.
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
	framework.ConformanceIt("should test kubelet managed /etc/hosts file ", func() {
 | 
						framework.ConformanceIt("should test kubelet managed /etc/hosts file ", func() {
 | 
				
			||||||
		By("Setting up the test")
 | 
							By("Setting up the test")
 | 
				
			||||||
		config.setup()
 | 
							config.setup()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user