summaryrefslogtreecommitdiffstats
path: root/tests/ts/swapon
diff options
context:
space:
mode:
authorKarel Zak2009-10-13 15:37:49 +0200
committerKarel Zak2009-10-13 15:37:49 +0200
commitd4e0f2f2ad93124c01695c072e7a514ff8e27d2c (patch)
tree020b80fd4631fa93887d8370c594431417a70da5 /tests/ts/swapon
parentswapon: more robust progname probing (diff)
downloadkernel-qcow2-util-linux-d4e0f2f2ad93124c01695c072e7a514ff8e27d2c.tar.gz
kernel-qcow2-util-linux-d4e0f2f2ad93124c01695c072e7a514ff8e27d2c.tar.xz
kernel-qcow2-util-linux-d4e0f2f2ad93124c01695c072e7a514ff8e27d2c.zip
tests: swapon workaround for libtool wrapper
The swapon command behaviour depends on program name (argv[0] = swapon | swapoff). It means we cannot use the libtool wrapper script in our regression tests. It seems better to call the binaries directly with proper LD_LIBRARY_PATH. This is probably less portable, but good enough for our tests. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests/ts/swapon')
-rwxr-xr-xtests/ts/swapon/devname3
-rwxr-xr-xtests/ts/swapon/label3
-rwxr-xr-xtests/ts/swapon/uuid3
3 files changed, 6 insertions, 3 deletions
diff --git a/tests/ts/swapon/devname b/tests/ts/swapon/devname
index f6edd537e..6ad6b2fc2 100755
--- a/tests/ts/swapon/devname
+++ b/tests/ts/swapon/devname
@@ -32,7 +32,8 @@ $TS_CMD_MKSWAP $DEVICE > /dev/null 2>> $TS_OUTPUT \
ts_device_has "TYPE" "swap" $DEVICE || ts_die "Cannot found swap on $DEVICE" $DEVICE
-$TS_CMD_SWAPON $DEVICE 2>&1 >> $TS_OUTPUT
+LD_LIBRARY_PATH="$U_L_LIBRARY_PATH" \
+ $TS_CMD_SWAPON $DEVICE 2>&1 >> $TS_OUTPUT
grep -q $DEVICE /proc/swaps || ts_die "Cannot found $DEVICE in /proc/swaps" $DEVICE
diff --git a/tests/ts/swapon/label b/tests/ts/swapon/label
index 299572c84..5a5e2650d 100755
--- a/tests/ts/swapon/label
+++ b/tests/ts/swapon/label
@@ -36,7 +36,8 @@ ts_device_has "LABEL" $LABEL $DEVICE \
ts_udev_dev_support "by-label" $LABEL || ts_skip "udev ignores /dev/loop*" $DEVICE
-$TS_CMD_SWAPON -L $LABEL 2>&1 >> $TS_OUTPUT
+LD_LIBRARY_PATH="$U_L_LIBRARY_PATH" \
+ $TS_CMD_SWAPON -L $LABEL 2>&1 >> $TS_OUTPUT
grep -q $DEVICE /proc/swaps || ts_die "Cannot found $DEVICE in /proc/swaps" $DEVICE
diff --git a/tests/ts/swapon/uuid b/tests/ts/swapon/uuid
index 3a9c1318a..373afd3cd 100755
--- a/tests/ts/swapon/uuid
+++ b/tests/ts/swapon/uuid
@@ -36,7 +36,8 @@ UUID=$(ts_uuid_by_devname $DEVICE)
ts_udev_dev_support "by-uuid" $UUID || ts_skip "udev ignores /dev/loop*" $DEVICE
-$TS_CMD_SWAPON -U $UUID 2>&1 >> $TS_OUTPUT
+LD_LIBRARY_PATH="$U_L_LIBRARY_PATH" \
+ $TS_CMD_SWAPON -U $UUID 2>&1 >> $TS_OUTPUT
grep -q $DEVICE /proc/swaps || ts_die "Cannot found $DEVICE in /proc/swaps" $DEVICE