diff --git a/test/e2e/framework/volume/fixtures.go b/test/e2e/framework/volume/fixtures.go index 9c324928499..34673e2df9b 100644 --- a/test/e2e/framework/volume/fixtures.go +++ b/test/e2e/framework/volume/fixtures.go @@ -615,14 +615,10 @@ func generateWriteFileCmd(content, fullPath string) []string { // CheckVolumeModeOfPath check mode of volume func CheckVolumeModeOfPath(f *framework.Framework, pod *v1.Pod, volMode v1.PersistentVolumeMode, path string) { - // in windows a symlink is created instead of mounting a volume - // we just check if the symlink exists - if framework.NodeOSDistroIs("windows") { - VerifyExecInPodSucceed(f, pod, fmt.Sprintf("ls %s", path)) - return - } - if volMode == v1.PersistentVolumeBlock { + // NOTE: gcepd-csi doesn't support a block volume in windows, this method won't + // be called because the test is skipped + // Check if block exists VerifyExecInPodSucceed(f, pod, fmt.Sprintf("test -b %s", path)) diff --git a/test/e2e/storage/testsuites/multivolume.go b/test/e2e/storage/testsuites/multivolume.go index 256ad70c675..7e3e8dea28e 100644 --- a/test/e2e/storage/testsuites/multivolume.go +++ b/test/e2e/storage/testsuites/multivolume.go @@ -510,7 +510,7 @@ func testAccessMultipleVolumes(f *framework.Framework, cs clientset.Interface, n // CreateSecPodWithNodeSelection make volumes accessible via /mnt/volume({i} + 1) index := i + 1 path := fmt.Sprintf("/mnt/volume%d", index) - ginkgo.By(fmt.Sprintf("Checking if the volume=%d exists as expected volume mode (%s)", index, *pvc.Spec.VolumeMode)) + ginkgo.By(fmt.Sprintf("Checking if the volume%d exists as expected volume mode (%s)", index, *pvc.Spec.VolumeMode)) e2evolume.CheckVolumeModeOfPath(f, pod, *pvc.Spec.VolumeMode, path) if readSeedBase > 0 { diff --git a/test/e2e/storage/utils/utils.go b/test/e2e/storage/utils/utils.go index b657c397763..50b1f6eca0f 100644 --- a/test/e2e/storage/utils/utils.go +++ b/test/e2e/storage/utils/utils.go @@ -543,13 +543,8 @@ func CheckReadFromPath(f *framework.Framework, pod *v1.Pod, volMode v1.Persisten sum := sha256.Sum256(genBinDataFromSeed(len, seed)) - if framework.NodeOSDistroIs("windows") { - e2evolume.VerifyExecInPodSucceed(f, pod, fmt.Sprintf("cat %s | sha256sum", pathForVolMode)) - e2evolume.VerifyExecInPodSucceed(f, pod, fmt.Sprintf("cat %s | sha256sum | grep -Fq %x", pathForVolMode, sum)) - } else { - e2evolume.VerifyExecInPodSucceed(f, pod, fmt.Sprintf("dd if=%s %s bs=%d count=1 | sha256sum", pathForVolMode, iflag, len)) - e2evolume.VerifyExecInPodSucceed(f, pod, fmt.Sprintf("dd if=%s %s bs=%d count=1 | sha256sum | grep -Fq %x", pathForVolMode, iflag, len, sum)) - } + e2evolume.VerifyExecInPodSucceed(f, pod, fmt.Sprintf("dd if=%s %s bs=%d count=1 | sha256sum", pathForVolMode, iflag, len)) + e2evolume.VerifyExecInPodSucceed(f, pod, fmt.Sprintf("dd if=%s %s bs=%d count=1 | sha256sum | grep -Fq %x", pathForVolMode, iflag, len, sum)) } // CheckWriteToPath that file can be properly written. @@ -573,13 +568,8 @@ func CheckWriteToPath(f *framework.Framework, pod *v1.Pod, volMode v1.Persistent encoded := base64.StdEncoding.EncodeToString(genBinDataFromSeed(len, seed)) - if framework.NodeOSDistroIs("windows") { - e2evolume.VerifyExecInPodSucceed(f, pod, fmt.Sprintf("echo %s | base64 -d | sha256sum", encoded)) - e2evolume.VerifyExecInPodSucceed(f, pod, fmt.Sprintf("echo %s | base64 -d > %s", encoded, pathForVolMode)) - } else { - e2evolume.VerifyExecInPodSucceed(f, pod, fmt.Sprintf("echo %s | base64 -d | sha256sum", encoded)) - e2evolume.VerifyExecInPodSucceed(f, pod, fmt.Sprintf("echo %s | base64 -d | dd of=%s %s bs=%d count=1", encoded, pathForVolMode, oflag, len)) - } + e2evolume.VerifyExecInPodSucceed(f, pod, fmt.Sprintf("echo %s | base64 -d | sha256sum", encoded)) + e2evolume.VerifyExecInPodSucceed(f, pod, fmt.Sprintf("echo %s | base64 -d | dd of=%s %s bs=%d count=1", encoded, pathForVolMode, oflag, len)) } // GetSectorSize returns the sector size of the device.