summaryrefslogtreecommitdiffstats
path: root/qa/rbd/rbd.sh
blob: 2b7ce8ee2e8c3fc7f1d5c9e99896746e83505b47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env bash
set -x

basedir=`echo $0 | sed 's/[^/]*$//g'`.
. $basedir/common.sh

rbd_test_init


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
	mount -t ext3 $devname $mnt

	dbench -D $mnt -t 30 5
	sync

	umount $mnt
	rbd_remove $rbd0
	rbd_rm_image 0
}

create_multiple
test_dbench