e83cdd
From bf69beb6f3824b1ebed221c8255d1f5c9efd136a Mon Sep 17 00:00:00 2001
e83cdd
From: Lubomir Rintel <lkundrak@v3.sk>
e83cdd
Date: Wed, 26 Jun 2019 16:42:04 +0200
e83cdd
Subject: [PATCH] test/TEST-17-LVM-THIN: fail setup if we run out of space in
e83cdd
 the thin pool
e83cdd
e83cdd
This condition is rather difficult to detect -- the writes will just remain
e83cdd
queued and get lost on shutdown, resulting in a corrupt filesystem.
e83cdd
e83cdd
(cherry picked from commit 91c15babdf0215df59325f3086acfdf0ba247bfa)
e83cdd
---
e83cdd
 test/TEST-17-LVM-THIN/create-root.sh | 5 +++--
e83cdd
 test/TEST-17-LVM-THIN/test.sh        | 2 +-
e83cdd
 2 files changed, 4 insertions(+), 3 deletions(-)
e83cdd
e83cdd
diff --git a/test/TEST-17-LVM-THIN/create-root.sh b/test/TEST-17-LVM-THIN/create-root.sh
e83cdd
index 117d1341..0e52f879 100755
e83cdd
--- a/test/TEST-17-LVM-THIN/create-root.sh
e83cdd
+++ b/test/TEST-17-LVM-THIN/create-root.sh
e83cdd
@@ -27,6 +27,7 @@ cp -a -t /sysroot /source/* && \
e83cdd
 umount /sysroot && \
e83cdd
 sleep 1 && \
e83cdd
 lvm lvchange -a n /dev/dracut/root && \
e83cdd
-sleep 1 && \
e83cdd
-echo "dracut-root-block-created" >/dev/sda1
e83cdd
+sleep 1
e83cdd
+dmsetup status |grep out_of_data_space || \
e83cdd
+    echo "dracut-root-block-created" >/dev/sda1
e83cdd
 poweroff -f
e83cdd
diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh
e83cdd
index af349246..1b36a216 100755
e83cdd
--- a/test/TEST-17-LVM-THIN/test.sh
e83cdd
+++ b/test/TEST-17-LVM-THIN/test.sh
e83cdd
@@ -56,7 +56,7 @@ test_setup() {
e83cdd
     (
e83cdd
 	export initdir=$TESTDIR/overlay
e83cdd
 	. $basedir/dracut-init.sh
e83cdd
-	inst_multiple sfdisk mke2fs poweroff cp umount
e83cdd
+	inst_multiple sfdisk mke2fs poweroff cp umount grep dmsetup
e83cdd
 	inst_hook initqueue 01 ./create-root.sh
e83cdd
         inst_hook initqueue/finished 01 ./finished-false.sh
e83cdd
 	inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
e83cdd