diff options
author | Karel Zak | 2017-12-07 12:31:41 +0100 |
---|---|---|
committer | Karel Zak | 2017-12-07 12:31:41 +0100 |
commit | f1254fae6da55d172c9f1e902db92231e51b48d5 (patch) | |
tree | 5c5d4af953cf45c618ae0340dffea9d833603166 | |
parent | libblkid: add debug messages when ignore useless devices (diff) | |
download | kernel-qcow2-util-linux-f1254fae6da55d172c9f1e902db92231e51b48d5.tar.gz kernel-qcow2-util-linux-f1254fae6da55d172c9f1e902db92231e51b48d5.tar.xz kernel-qcow2-util-linux-f1254fae6da55d172c9f1e902db92231e51b48d5.zip |
tests: add mdadm locks
Signed-off-by: Karel Zak <kzak@redhat.com>
-rwxr-xr-x | tests/ts/blkid/md-raid0-whole | 2 | ||||
-rwxr-xr-x | tests/ts/blkid/md-raid1-part | 4 | ||||
-rwxr-xr-x | tests/ts/blkid/md-raid1-whole | 5 | ||||
-rwxr-xr-x | tests/ts/fdisk/align-512-4K-md | 9 |
4 files changed, 19 insertions, 1 deletions
diff --git a/tests/ts/blkid/md-raid0-whole b/tests/ts/blkid/md-raid0-whole index cbfb1eb7c..45c6ee55b 100755 --- a/tests/ts/blkid/md-raid0-whole +++ b/tests/ts/blkid/md-raid0-whole @@ -41,6 +41,7 @@ DEVICE2=$TS_LODEV MD_DEVNAME=md8 MD_DEVICE=/dev/${MD_DEVNAME} +ts_lock "md" mdadm -q -S ${MD_DEVICE} &> /dev/null ts_log "Create RAID device" @@ -76,6 +77,7 @@ ts_log "Stop RAID device" mdadm -q -S ${MD_DEVICE} >> $TS_OUTPUT 2>&1 udevadm settle +ts_unlock "md" ts_log "Deinitialize devices" diff --git a/tests/ts/blkid/md-raid1-part b/tests/ts/blkid/md-raid1-part index 9f1276186..3fa6395b0 100755 --- a/tests/ts/blkid/md-raid1-part +++ b/tests/ts/blkid/md-raid1-part @@ -62,6 +62,8 @@ udevadm settle MD_DEVNAME=md8 MD_DEVICE=/dev/${MD_DEVNAME} +ts_lock "md" + ts_log "Create RAID1 device" mdadm -q -S ${MD_DEVICE} &> /dev/null mdadm -q --create ${MD_DEVICE} --metadata=0.90 --chunk=64 --level=1 \ @@ -79,6 +81,8 @@ $TS_CMD_BLKID -p -o udev ${TS_DEVICE}2 2>&1 | sort >> $TS_OUTPUT mdadm -q -S ${MD_DEVICE} >> $TS_OUTPUT 2>&1 +udevadm settle +ts_unlock "md" ts_fdisk_clean $TS_DEVICE # substitue UUIDs and major/minor number before comparison diff --git a/tests/ts/blkid/md-raid1-whole b/tests/ts/blkid/md-raid1-whole index 050adecd7..ddf4a6934 100755 --- a/tests/ts/blkid/md-raid1-whole +++ b/tests/ts/blkid/md-raid1-whole @@ -41,11 +41,15 @@ DEVICE2=$TS_LODEV MD_DEVNAME=md8 MD_DEVICE=/dev/${MD_DEVNAME} +ts_lock "md" + mdadm -q -S ${MD_DEVICE} &> /dev/null +udevadm settle ts_log "Create RAID device" mdadm -q --create ${MD_DEVICE} --metadata=0.90 --chunk=64 --level=1 \ --raid-devices=2 ${DEVICE1} ${DEVICE2} >> $TS_OUTPUT 2>&1 +udevadm settle ts_log "Create partitions on RAID device" $TS_CMD_FDISK ${MD_DEVICE} >> $TS_OUTPUT 2>&1 <<EOF @@ -76,6 +80,7 @@ ts_log "Stop RAID device" mdadm -q -S ${MD_DEVICE} >> $TS_OUTPUT 2>&1 udevadm settle +ts_unlock "md" ts_log "Deinitialize devices" diff --git a/tests/ts/fdisk/align-512-4K-md b/tests/ts/fdisk/align-512-4K-md index 04c3df68e..7f60a654f 100755 --- a/tests/ts/fdisk/align-512-4K-md +++ b/tests/ts/fdisk/align-512-4K-md @@ -56,14 +56,18 @@ udevadm settle ts_log "Alignment offsets:" cat /sys/block/${DEVNAME}/${DEVNAME}{1,2}/alignment_offset >> $TS_OUTPUT 2>&1 +ts_lock "md" + MD_DEVNAME=md8 MD_DEVICE=/dev/${MD_DEVNAME} mdadm -q -S ${MD_DEVICE} &> /dev/null +udevadm settle + mdadm -q --create ${MD_DEVICE} --metadata=0.90 --chunk=64 \ --level=0 --raid-devices=2 ${TS_DEVICE}1 ${TS_DEVICE}2 >> $TS_OUTPUT 2>&1 - udevadm settle + ts_log "Create partitions (MD)" $TS_CMD_FDISK ${MD_DEVICE} >> $TS_OUTPUT 2>&1 <<EOF n @@ -87,6 +91,9 @@ cat /sys/block/${MD_DEVNAME}/${MD_DEVNAME}p{1,2}/alignment_offset >> $TS_OUTPUT mdadm -q -S ${MD_DEVICE} >> $TS_OUTPUT 2>&1 +udevadm settle +ts_unlock "md" + ts_fdisk_clean $TS_DEVICE ts_fdisk_clean $MD_DEVICE |