From 51de999dfb521bc539eb0f09ea576b6d07879cdc Mon Sep 17 00:00:00 2001 From: Brad Topol Date: Thu, 2 Nov 2017 09:45:11 -0700 Subject: [PATCH] Add empty dir and host related conformance annotations Signed-off-by: Brad Topol --- test/e2e/common/empty_dir.go | 83 ++++++++++++++++++++++++++++ test/e2e/common/host_path.go | 6 ++ test/e2e/common/kubelet_etc_hosts.go | 5 ++ 3 files changed, 94 insertions(+) diff --git a/test/e2e/common/empty_dir.go b/test/e2e/common/empty_dir.go index 2f881d616bb..bc6ad4b6cc2 100644 --- a/test/e2e/common/empty_dir.go +++ b/test/e2e/common/empty_dir.go @@ -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() { 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() { 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() { 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() { 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() { 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() { 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() { 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() { 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() { 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() { 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() { 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() { 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() { 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() { doTest0777(f, testImageNonRootUid, v1.StorageMediumDefault) }) diff --git a/test/e2e/common/host_path.go b/test/e2e/common/host_path.go index ffcde4c9359..4592d094255 100644 --- a/test/e2e/common/host_path.go +++ b/test/e2e/common/host_path.go @@ -40,6 +40,12 @@ var _ = Describe("[sig-storage] HostPath", func() { _ = 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() { source := &v1.HostPathVolumeSource{ Path: "/tmp", diff --git a/test/e2e/common/kubelet_etc_hosts.go b/test/e2e/common/kubelet_etc_hosts.go index 0f4fdac897d..94438865270 100644 --- a/test/e2e/common/kubelet_etc_hosts.go +++ b/test/e2e/common/kubelet_etc_hosts.go @@ -48,6 +48,11 @@ var _ = framework.KubeDescribe("KubeletManagedEtcHosts", func() { 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() { By("Setting up the test") config.setup()