diff --git a/test/e2e/pd.go b/test/e2e/pd.go index dfabb8393a7..55b9759d951 100644 --- a/test/e2e/pd.go +++ b/test/e2e/pd.go @@ -118,11 +118,7 @@ var _ = framework.KubeDescribe("Pod Disks", func() { framework.ExpectNoError(f.WaitForPodRunningSlow(host1Pod.Name)) - v, err := f.ReadFileViaContainer(host1Pod.Name, containerName, testFile) - framework.ExpectNoError(err) - framework.Logf("Read value: %v", v) - - Expect(strings.TrimSpace(v)).To(Equal(strings.TrimSpace(testFileContents))) + verifyPDContentsViaContainer(f, host1Pod.Name, containerName, map[string]string{testFile: testFileContents}) // Verify that disk is removed from node 1's VolumeInUse list framework.ExpectNoError(waitForPDInVolumesInUse(nodeClient, diskName, host0Name, nodeStatusTimeout, false /* shouldExist */)) @@ -182,11 +178,7 @@ var _ = framework.KubeDescribe("Pod Disks", func() { framework.ExpectNoError(f.WaitForPodRunningSlow(host1Pod.Name)) - v, err := f.ReadFileViaContainer(host1Pod.Name, containerName, testFile) - framework.ExpectNoError(err) - framework.Logf("Read value: %v", v) - - Expect(strings.TrimSpace(v)).To(Equal(strings.TrimSpace(testFileContents))) + verifyPDContentsViaContainer(f, host1Pod.Name, containerName, map[string]string{testFile: testFileContents}) // Verify that disk is removed from node 1's VolumeInUse list framework.ExpectNoError(waitForPDInVolumesInUse(nodeClient, diskName, host0Name, nodeStatusTimeout, false /* shouldExist */))