summaryrefslogtreecommitdiffstats
path: root/tests/ts/fdisk/align-512-512-topology
diff options
context:
space:
mode:
authorRuediger Meier2014-05-11 08:50:28 +0200
committerRuediger Meier2014-05-13 17:38:12 +0200
commitf45df374ffc311220bd395da985b121eccfb4045 (patch)
tree6f9daba1ecfcd2523a6d70085d0e2997270a61e2 /tests/ts/fdisk/align-512-512-topology
parenttests: cleanup ts_scsi_debug_init (diff)
downloadkernel-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/fdisk/align-512-512-topology')
-rwxr-xr-xtests/ts/fdisk/align-512-512-topology10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/ts/fdisk/align-512-512-topology b/tests/ts/fdisk/align-512-512-topology
index f988b4e42..d291e2f97 100755
--- a/tests/ts/fdisk/align-512-512-topology
+++ b/tests/ts/fdisk/align-512-512-topology
@@ -30,12 +30,12 @@ ts_check_test_command "$TS_CMD_FDISK"
ts_skip_nonroot
-
-DEVICE=$(ts_scsi_debug_init dev_size_mb=50 sector_size=512)
-DEVNAME=$(basename $DEVICE)
+# set global variable TS_DEVICE
+ts_scsi_debug_init dev_size_mb=50 sector_size=512
+DEVNAME=$(basename $TS_DEVICE)
ts_log "Create partitions"
-$TS_CMD_FDISK ${DEVICE} >> $TS_OUTPUT 2>&1 <<EOF
+$TS_CMD_FDISK ${TS_DEVICE} >> $TS_OUTPUT 2>&1 <<EOF
n
p
1
@@ -75,6 +75,6 @@ cat /sys/block/${DEVNAME}/${DEVNAME}{1,2,3,4,5,6,7}/alignment_offset >> $TS_OUTP
rmmod scsi_debug
-ts_fdisk_clean $DEVICE
+ts_fdisk_clean $TS_DEVICE
ts_finalize