]> sourceware.org Git - lvm2.git/commitdiff
tests: properly quote heredoc
authorZdenek Kabelac <zkabelac@redhat.com>
Sat, 21 Jan 2017 18:21:08 +0000 (19:21 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Sat, 21 Jan 2017 18:28:06 +0000 (19:28 +0100)
Prepend \$ for vars which should remain in script.
Also drop --lazy umount.
Move inittest call up, so mntdir and mntusedir have proper full path.

test/shell/thin-autoumount-dmeventd.sh

index 363efe22991513d8f0f318adbeb17c2c07a62144..eacad0a9c47d4909d44b4c1b84323dd00630c309 100644 (file)
@@ -16,6 +16,8 @@ SKIP_WITH_LVMPOLLD=1
 
 export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
 
+. lib/inittest
+
 mntdir="${PREFIX}mnt with space"
 mntusedir="${PREFIX}mntuse"
 
@@ -32,8 +34,6 @@ is_lv_opened_()
        test $(get lv_field "$1" lv_device_open --binary) = "1"
 }
 
-. lib/inittest
-
 #
 # Main
 #
@@ -48,15 +48,17 @@ aux lvmconf "dmeventd/thin_command = \"$PWD/testcmd.sh\""
 cat <<- EOF >testcmd.sh
 #!/bin/sh
 
-echo "Data $DMEVENTD_THIN_POOL_DATA"
-echo "Metadata $DMEVENTD_THIN_POOL_METADATA"
+echo "Data: \$DMEVENTD_THIN_POOL_DATA"
+echo "Metadata: \$DMEVENTD_THIN_POOL_METADATA"
 
-lvextend --use-policies $1 || {
-       umount --lazy "$mntdir"  || true
-       umount --lazy "$mntusedir" || true
+$TESTDIR/lib/lvextend --use-policies \$1 || {
+       umount "$mntdir"  || true
+       umount "$mntusedir" || true
 }
 EOF
 chmod +x testcmd.sh
+# Show prepared script
+cat testcmd.sh
 
 aux prepare_dmeventd
 
This page took 0.037013 seconds and 5 git commands to generate.