diff options
author | Ruediger Meier | 2014-05-11 08:50:28 +0200 |
---|---|---|
committer | Ruediger Meier | 2014-05-13 17:38:12 +0200 |
commit | f45df374ffc311220bd395da985b121eccfb4045 (patch) | |
tree | 6f9daba1ecfcd2523a6d70085d0e2997270a61e2 /tests/ts/libmount/context | |
parent | tests: cleanup ts_scsi_debug_init (diff) | |
download | kernel-qcow2-util-linux-f45df374ffc311220bd395da985b121eccfb4045.tar.gz kernel-qcow2-util-linux-f45df374ffc311220bd395da985b121eccfb4045.tar.xz kernel-qcow2-util-linux-f45df374ffc311220bd395da985b121eccfb4045.zip |
tests: ts_scsi_debug_init must not run in a subshell
ts_skip and ts_die won't work from subshell. Now we simply use
TS_DEVICE which is globally set in that function.
I've made sure that we never change TS_DEVICE variable after
we've got it. So we could use it again for cleanup on exit in
ts_{finalize,die,skip} functions.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/ts/libmount/context')
-rwxr-xr-x | tests/ts/libmount/context | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/ts/libmount/context b/tests/ts/libmount/context index 35e1a014e..8267b135d 100755 --- a/tests/ts/libmount/context +++ b/tests/ts/libmount/context @@ -26,11 +26,12 @@ TS_NOEXIST="$TS_OUTDIR/${TS_TESTNAME}-${TS_SUBNAME}-noex" ts_log "Init device" umount $MOUNTPOINT &> /dev/null -DEVICE=$(ts_scsi_debug_init dev_size_mb=100) -DEVNAME=$(basename $DEVICE) +# set global variable TS_DEVICE +ts_scsi_debug_init dev_size_mb=100 +DEVNAME=$(basename $TS_DEVICE) ts_log "Create partitions" -$TS_CMD_FDISK ${DEVICE} &> /dev/null <<EOF +$TS_CMD_FDISK ${TS_DEVICE} &> /dev/null <<EOF n p 1 @@ -40,7 +41,7 @@ w q EOF -DEVICE="${DEVICE}1" +DEVICE="${TS_DEVICE}1" sleep 1 udevadm settle |