]> err.no Git - util-linux/commitdiff
tests: swapon workaround for libtool wrapper
authorKarel Zak <kzak@redhat.com>
Tue, 13 Oct 2009 13:37:49 +0000 (15:37 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 13 Oct 2009 13:37:49 +0000 (15:37 +0200)
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>
tests/commands.sh.in
tests/functions.sh
tests/ts/swapon/devname
tests/ts/swapon/label
tests/ts/swapon/uuid

index 55585e7b6d047c81ca0968628e12171948b9e64a..70084cd063803b52b1df5d0caa2e8e4c3f8d293e 100644 (file)
@@ -18,11 +18,13 @@ TS_HELPER_PARTITIONS="$TOPDIR/shlibs/blkid/samples/partitions"
 TS_ECMD_BLKID="@BLKID@"
 TS_ECMD_VOLID="@VOLID@"
 
+U_L_LIBRARY_PATH="$TOPDIR/shlibs/blkid/src/.libs:$TOPDIR/shlibs/uuid/src/.libs"
+
 # paths to commands
 TS_CMD_MOUNT=${TS_CMD_MOUNT:-"$TOPDIR/mount/mount"}
 TS_CMD_UMOUNT=${TS_CMD_UMOUNT:-"$TOPDIR/mount/umount"}
-TS_CMD_SWAPON=${TS_CMD_SWAPON:-"$TOPDIR/mount/swapon"}
-TS_CMD_SWAPOFF=${TS_CMD_SWAPOFF:-"$TOPDIR/mount/swapoff"}
+TS_CMD_SWAPON=${TS_CMD_SWAPON:-"$TOPDIR/mount/.libs/swapon"}
+TS_CMD_SWAPOFF=${TS_CMD_SWAPOFF:-"$TOPDIR/mount/.libs/swapoff"}
 TS_CMD_LOSETUP=${TS_CMD_LOSETUP:-"$TOPDIR/mount/losetup"}
 
 TS_CMD_MTABLOCK=${TS_CMD_MTABLOCK:-"$TOPDIR/mount/mtab_lock_test"}
index 50ef12d8ced43133cf6202778e5cc287dc83f1cc..e8a2ceb69ec6b82baa6ae2d80f9a2f7e37035baf 100644 (file)
@@ -365,7 +365,8 @@ function ts_swapoff {
                ln -sf $TS_CMD_SWAPON $TS_CMD_SWAPOFF
                REMSWAPOFF="true"
        fi
-       $TS_CMD_SWAPOFF $DEV 2>&1 >> $TS_OUTPUT
+       LD_LIBRARY_PATH="$U_L_LIBRARY_PATH" \
+                       $TS_CMD_SWAPOFF $DEV 2>&1 >> $TS_OUTPUT
        if [ -n "$REMSWAPOFF" ]; then
                rm -f $TS_CMD_SWAPOFF
        fi
index f6edd537ea9bd3fa7c66fdbafd6347debb2666eb..6ad6b2fc2c8425e55717164370dda9931b4e8b2b 100755 (executable)
@@ -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
 
index 299572c841d5120fb0457e220921d963d588b8a1..5a5e2650d7369b31defe1f434baa688c061fb2dc 100755 (executable)
@@ -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
 
index 3a9c1318a342763f35d4b305df5ea83edbe207e3..373afd3cd3752da4b6cea37fc31a4884e890e7f4 100755 (executable)
@@ -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