]> err.no Git - util-linux/commitdiff
tests: use losetup -s
authorKarel Zak <kzak@redhat.com>
Thu, 25 Oct 2007 22:55:36 +0000 (00:55 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 25 Oct 2007 23:02:45 +0000 (01:02 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/functions.sh
tests/ts-cramfs-mkfs

index 7b555f5fece9643975af0bbca3d3795d14e5f93e..660e4adfea97e8eba07ceffaf2666a707ea63a2e 100644 (file)
@@ -173,15 +173,13 @@ function ts_restore_cache {
 
 function ts_device_init {
        local IMAGE="$TS_OUTDIR/$TS_NAME.img"
-       local IMAGE_RE=$( echo "$IMAGE" | sed 's:/:\\/:g' )
        local DEV=""
 
        ts_backup_cache
 
        dd if=/dev/zero of="$IMAGE" bs=1M count=5 &> /dev/null
 
-       $TS_CMD_LOSETUP -f "$IMAGE" 2>&1 >> $TS_OUTPUT
-       DEV=$( $TS_CMD_LOSETUP -a | $AWK 'BEGIN {FS=":"} /'$IMAGE_RE'/ { print $1 }' )
+       DEV=$($TS_CMD_LOSETUP -s -f "$IMAGE")
 
        if [ -z "$DEV" ]; then
                ts_device_deinit $DEV
index 4185184cfaed3ad9a040199f5dd1e96ef34cea9c..d228967639abd74573b4323792d666f7397cac21 100755 (executable)
@@ -28,7 +28,6 @@ set -o pipefail
 
 IMAGE="$TS_OUTDIR/cramfs-loop.img"
 IMAGE_DATA="$TS_OUTDIR/cramfs-data"
-IMAGE_RE=$( echo $IMAGE | sed 's:/:\\/:g' )
 LABEL="testCramfs"
 TS_MOUNTPOINT="$TS_OUTDIR/cramfs-mnt"
 
@@ -63,8 +62,7 @@ echo >> $TS_OUTPUT
 
 ts_log "create loop device from image"
 ts_backup_cache
-DEVICE=$( $TS_CMD_LOSETUP -f )
-$TS_CMD_LOSETUP $DEVICE $IMAGE 2>&1 >> $TS_OUTPUT
+DEVICE=$( $TS_CMD_LOSETUP -s -f $IMAGE)
 
 ts_log "check the image"
 ts_device_has "TYPE" "cramfs" $DEVICE