diff options
author | Karel Zak | 2013-04-12 16:36:33 +0200 |
---|---|---|
committer | Karel Zak | 2013-04-12 16:36:33 +0200 |
commit | 618ec053fe2d1353eb1c15ebf98c1f4ef9b08ed1 (patch) | |
tree | e749c7c352768ed4492c1f6a3a2ed097d91bf9e2 /tests/ts/fdisk/align-512-512-topology | |
parent | libmount: add debug message to guess FS function (diff) | |
download | kernel-qcow2-util-linux-618ec053fe2d1353eb1c15ebf98c1f4ef9b08ed1.tar.gz kernel-qcow2-util-linux-618ec053fe2d1353eb1c15ebf98c1f4ef9b08ed1.tar.xz kernel-qcow2-util-linux-618ec053fe2d1353eb1c15ebf98c1f4ef9b08ed1.zip |
tests: consolidate scsi_debug usage
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests/ts/fdisk/align-512-512-topology')
-rwxr-xr-x | tests/ts/fdisk/align-512-512-topology | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/tests/ts/fdisk/align-512-512-topology b/tests/ts/fdisk/align-512-512-topology index 2a83e0839..9354e45c7 100755 --- a/tests/ts/fdisk/align-512-512-topology +++ b/tests/ts/fdisk/align-512-512-topology @@ -27,19 +27,9 @@ TS_DESC="align 512/512 +topology" ts_init "$*" ts_skip_nonroot -modprobe --dry-run --quiet scsi_debug -[ "$?" == 0 ] || ts_skip "missing scsi_debug module" -rmmod scsi_debug &> /dev/null -modprobe scsi_debug dev_size_mb=50 sector_size=512 -[ "$?" == 0 ] || ts_die "Cannot init device" - -sleep 3 - -DEVNAME=$(grep scsi_debug /sys/block/*/device/model | awk -F '/' '{print $4}') -[ "x${DEVNAME}" == "x" ] && ts_die "Cannot find device" - -DEVICE="/dev/${DEVNAME}" +DEVICE=$(ts_scsi_debug_init dev_size_mb=50 sector_size=512) +DEVNAME=$(basename $DEVICE) ts_log "Create partitions" $TS_CMD_FDISK ${DEVICE} >> $TS_OUTPUT 2>&1 <<EOF @@ -82,6 +72,6 @@ cat /sys/block/${DEVNAME}/${DEVNAME}{1,2,3,4,5,6,7}/alignment_offset >> $TS_OUTP rmmod scsi_debug -ts_fdisk_clean +ts_fdisk_clean $DEVICE ts_finalize |