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