diff --git a/test/e2e/common/empty_dir.go b/test/e2e/common/empty_dir.go index 2a5d0c1a474..ba404b0720f 100644 --- a/test/e2e/common/empty_dir.go +++ b/test/e2e/common/empty_dir.go @@ -19,10 +19,9 @@ package common import ( "fmt" "path" - "time" "github.com/onsi/ginkgo" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/uuid" "k8s.io/kubernetes/test/e2e/framework" @@ -290,8 +289,8 @@ var _ = ginkgo.Describe("[sig-storage] EmptyDir volumes", func() { framework.ExpectNoError(err, "failed to get pod %s", pod.Name) ginkgo.By("Reading file content from the nginx-container") - resultString, err = framework.LookForStringInFile(f.Namespace.Name, pod.Name, busyBoxMainContainerName, busyBoxMainVolumeFilePath, message, 30*time.Second) - framework.ExpectNoError(err, "failed to match expected string %s with %s", message, resultString) + result := f.ExecShellInContainer(pod.Name, busyBoxMainContainerName, fmt.Sprintf("cat %s", busyBoxMainVolumeFilePath)) + framework.ExpectEqual(result, message, "failed to match expected string %s with %s", message, resultString) }) })