Skip to content

Commit 7ecdfb6

Browse files
nixpanicbatrick
authored andcommitted
e2e: report an error if writing persistent data fails
Use `dd` to sync the data, do not wait for unmounting to flush outstanding I/O (and ignore failed writes). See-also: https://tracker.ceph.com/issues/73997?#note-27 Co-authored-by: Patrick Donnelly <pdonnell@ibm.com> Signed-off-by: Niels de Vos <ndevos@ibm.com>
1 parent a699193 commit 7ecdfb6

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

e2e/utils.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,12 @@ func checkDataPersist(pvcPath, appPath string, f *framework.Framework) error {
817817
// write data to PVC
818818
filePath := app.Spec.Containers[0].VolumeMounts[0].MountPath + "/test"
819819

820-
_, stdErr, err := execCommandInPod(f, fmt.Sprintf("echo %s > %s", data, filePath), app.Namespace, &opt)
820+
_, stdErr, err := execCommandInPod(
821+
f,
822+
fmt.Sprintf("echo -n '%s' | dd of=%s status=none conv=fsync", data, filePath),
823+
app.Namespace,
824+
&opt,
825+
)
821826
if err != nil {
822827
return fmt.Errorf("failed to exec command in pod: %w", err)
823828
}

0 commit comments

Comments
 (0)