test: avoid potential data inconsistency on zapping disk

Data inconsistency might happen if the disk is accessed just after disk
zapping because direct I/O is not synchronous by itself.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
(cherry picked from commit 3bbffd1e4d)
This commit is contained in:
Satoru Takeuchi authored and mergify-bot committed 2022-03-18 13:34:43 +00:00
1 parent 864bd39c8f
commit 361cc22c55
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -50,7 +50,7 @@ function purge_ceph_vms {
vagrant ssh "$i" -c "cat << 'EOF' > /tmp/purge-ceph.sh
sudo rm -rf /var/lib/rook
for disk in \$(sudo blkid | awk '/ROOK/ {print \$1}' | sed 's/[0-9]://' | uniq); do
sudo dd if=/dev/zero of=\$disk bs=1M count=20 oflag=direct
sudo dd if=/dev/zero of=\$disk bs=1M count=20 oflag=direct,dsync
done
EOF"
vagrant ssh "$i" -c "bash /tmp/purge-ceph.sh"