tests: use losetup -s

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2007-10-26 00:55:36 +02:00
parent 8d26614050
commit 32f7216b4c
2 changed files with 2 additions and 6 deletions

View 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

View File

@ -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