diff --git a/test/e2e/empty_dir.go b/test/e2e/empty_dir.go index 67dcc1bf74..6480ac247e 100644 --- a/test/e2e/empty_dir.go +++ b/test/e2e/empty_dir.go @@ -22,22 +22,13 @@ import ( "github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/api/latest" - "github.com/GoogleCloudPlatform/kubernetes/pkg/client" "github.com/GoogleCloudPlatform/kubernetes/pkg/util" . "github.com/onsi/ginkgo" ) var _ = Describe("emptyDir", func() { - var ( - c *client.Client - ) - - BeforeEach(func() { - var err error - c, err = loadClient() - expectNoError(err) - }) + f := NewFramework("emptydir") It("volume on tmpfs should have the correct mode", func() { volumePath := "/test-volume" @@ -50,7 +41,7 @@ var _ = Describe("emptyDir", func() { fmt.Sprintf("--fs_type=%v", volumePath), fmt.Sprintf("--file_mode=%v", volumePath), } - testContainerOutput("emptydir r/w on tmpfs", c, pod, []string{ + f.TestContainerOutput("emptydir r/w on tmpfs", pod, []string{ "mount type of \"/test-volume\": tmpfs", "mode of file \"/test-volume\": dtrwxrwxrwx", // we expect the sticky bit (mode flag t) to be set for the dir }) @@ -69,7 +60,7 @@ var _ = Describe("emptyDir", func() { fmt.Sprintf("--rw_new_file=%v", filePath), fmt.Sprintf("--file_mode=%v", filePath), } - testContainerOutput("emptydir r/w on tmpfs", c, pod, []string{ + f.TestContainerOutput("emptydir r/w on tmpfs", pod, []string{ "mount type of \"/test-volume\": tmpfs", "mode of file \"/test-volume/test-file\": -rw-r--r--", "content of file \"/test-volume/test-file\": mount-tester new file", diff --git a/test/e2e/framework.go b/test/e2e/framework.go index a5f8b0fec1..203a48ac65 100644 --- a/test/e2e/framework.go +++ b/test/e2e/framework.go @@ -94,3 +94,8 @@ func (f *Framework) afterEach() { func (f *Framework) WaitForPodRunning(podName string) error { return waitForPodRunningInNamespace(f.Client, podName, f.Namespace.Name) } + +// Runs the given pod and verifies that its output matches the desired output. +func (f *Framework) TestContainerOutput(scenarioName string, pod *api.Pod, expectedOutput []string) { + testContainerOutputInNamespace(scenarioName, f.Client, pod, expectedOutput, f.Namespace.Name) +}