]> err.no Git - util-linux/commitdiff
tests: cleanup ts/swapon
authorKarel Zak <kzak@redhat.com>
Mon, 19 Jan 2009 23:24:23 +0000 (00:24 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 11 Feb 2009 22:32:58 +0000 (23:32 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/functions.sh
tests/ts/swapon/devname
tests/ts/swapon/label
tests/ts/swapon/uuid

index 6dbbeb7760967bc9261a216fbc5b7165b6fc5cd5..83af33cd15eaac1e4c6ece6a3b7c4500945b6bbb 100644 (file)
@@ -88,7 +88,7 @@ function ts_init {
        TS_VERBOSE=$(ts_has_option "verbose" "$*")
        TS_HAS_VOLUMEID="no"
 
-       BLKID_FILE="$TS_OUTDIR/${TS_NS}.blkidtab"
+       BLKID_FILE="$TS_OUTDIR/${TS_TESTNAME}.blkidtab"
 
        [ -d "$TS_OUTDIR" ]  || mkdir -p "$TS_OUTDIR"
        [ -d "$TS_DIFFDIR" ] || mkdir -p "$TS_DIFFDIR"
@@ -183,19 +183,19 @@ function ts_die {
 }
 
 function ts_device_init {
-       local IMAGE="$TS_OUTDIR/${TS_NS}.img"
-       local DEV=""
+       local img="$TS_OUTDIR/${TS_TESTNAME}.img"
+       local dev=""
 
-       dd if=/dev/zero of="$IMAGE" bs=1M count=5 &> /dev/null
+       dd if=/dev/zero of="$img" bs=1M count=5 &> /dev/null
 
-       DEV=$($TS_CMD_LOSETUP -s -f "$IMAGE")
+       dev=$($TS_CMD_LOSETUP -s -f "$img")
 
-       if [ -z "$DEV" ]; then
-               ts_device_deinit $DEV
+       if [ -z "$dev" ]; then
+               ts_device_deinit $dev
                return 1                # error
        fi
 
-       echo $DEV
+       echo $dev
        return 0                        # succes
 }
 
index 954af8617d668b065e996c249a7073e701051de4..f6edd537ea9bd3fa7c66fdbafd6347debb2666eb 100755 (executable)
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
-. ./commands.sh
-. ./functions.sh
-
-TS_COMPONENT="swapon"
-TS_DESC="devname"
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="by devname"
 
+. $TS_TOPDIR/functions.sh
 ts_init "$*"
 ts_skip_nonroot
 
index 3ea30a961bb13f12d037b8ed01336ca5b544ce9b..299572c841d5120fb0457e220921d963d588b8a1 100755 (executable)
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
-. ./commands.sh
-. ./functions.sh
-
-TS_COMPONENT="swapon"
-TS_DESC="label"
-
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="by label"
 LABEL="testSwapLabel"
 
+. $TS_TOPDIR/functions.sh
 ts_init "$*"
 ts_skip_nonroot
 
index 3b181fa06b009c6497aa627e1a560e3a8376a2e5..3a9c1318a342763f35d4b305df5ea83edbe207e3 100755 (executable)
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
-. ./commands.sh
-. ./functions.sh
-
-TS_COMPONENT="swapon"
-TS_DESC="uuid"
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="by uuid"
 
+. $TS_TOPDIR/functions.sh
 ts_init "$*"
 ts_skip_nonroot