summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2017-01-21 17:37:53 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2017-01-21 17:42:19 +0100
commit1a2b88516bd213a912ba6c5133a977a5003f3a16 (patch)
tree8307d2c137d66b2c4a7b6a399d7bbf6c71502c06
parent47c11c7b1c364a2d2fd257aaa191816e146d3602 (diff)
downloadlvm2-1a2b88516bd213a912ba6c5133a977a5003f3a16.tar.gz
tests: implement umount in script
Since dmeventd no longer umounts thin devices, such logic needs to be implemented by external script. Add some very simple one for the start.
-rw-r--r--test/shell/thin-autoumount-dmeventd.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/shell/thin-autoumount-dmeventd.sh b/test/shell/thin-autoumount-dmeventd.sh
index 40dd75f7e..363efe229 100644
--- a/test/shell/thin-autoumount-dmeventd.sh
+++ b/test/shell/thin-autoumount-dmeventd.sh
@@ -42,6 +42,22 @@ export MKE2FS_CONFIG="$TESTDIR/lib/mke2fs.conf"
aux have_thin 1 0 0 || skip
+aux lvmconf "dmeventd/thin_command = \"$PWD/testcmd.sh\""
+
+# Simple implementation of umount when lvextend fails
+cat <<- EOF >testcmd.sh
+#!/bin/sh
+
+echo "Data $DMEVENTD_THIN_POOL_DATA"
+echo "Metadata $DMEVENTD_THIN_POOL_METADATA"
+
+lvextend --use-policies $1 || {
+ umount --lazy "$mntdir" || true
+ umount --lazy "$mntusedir" || true
+}
+EOF
+chmod +x testcmd.sh
+
aux prepare_dmeventd
# Use autoextend percent 0 - so extension fails and triggers umount...