2017-07-20 22:26:42 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -x
|
2010-10-28 21:31:22 +00:00
|
|
|
|
|
|
|
basedir=`echo $0 | sed 's/[^/]*$//g'`.
|
|
|
|
. $basedir/common.sh
|
|
|
|
|
|
|
|
rbd_test_init
|
|
|
|
|
|
|
|
|
2010-10-28 22:40:27 +00:00
|
|
|
create_multiple() {
|
|
|
|
for i in `seq 1 10`; do
|
|
|
|
rbd_create_image $i
|
|
|
|
done
|
|
|
|
|
|
|
|
for i in `seq 1 10`; do
|
|
|
|
rbd_add $i
|
|
|
|
done
|
|
|
|
for i in `seq 1 10`; do
|
|
|
|
devname=/dev/rbd`eval echo \\$rbd$i`
|
|
|
|
echo $devname
|
|
|
|
done
|
|
|
|
for i in `seq 1 10`; do
|
|
|
|
devid=`eval echo \\$rbd$i`
|
|
|
|
rbd_remove $devid
|
|
|
|
done
|
|
|
|
for i in `seq 1 10`; do
|
|
|
|
rbd_rm_image $i
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
test_dbench() {
|
|
|
|
rbd_create_image 0
|
|
|
|
rbd_add 0
|
|
|
|
|
|
|
|
devname=/dev/rbd$rbd0
|
|
|
|
|
|
|
|
mkfs -t ext3 $devname
|
2010-12-29 23:36:22 +00:00
|
|
|
mount -t ext3 $devname $mnt
|
2010-10-28 22:40:27 +00:00
|
|
|
|
2010-12-29 23:36:22 +00:00
|
|
|
dbench -D $mnt -t 30 5
|
2010-10-28 22:40:27 +00:00
|
|
|
sync
|
|
|
|
|
2010-12-29 23:36:22 +00:00
|
|
|
umount $mnt
|
2010-10-28 22:40:27 +00:00
|
|
|
rbd_remove $rbd0
|
|
|
|
rbd_rm_image 0
|
|
|
|
}
|
|
|
|
|
|
|
|
create_multiple
|
|
|
|
test_dbench
|
2010-10-28 21:31:22 +00:00
|
|
|
|