]> git.proxmox.com Git - ceph.git/blob - ceph/qa/workunits/rados/test.sh
33bdd8ed0b16f38f780e63eba7c05e2fee06adea
[ceph.git] / ceph / qa / workunits / rados / test.sh
1 #!/bin/bash -ex
2
3 parallel=1
4 [ "$1" = "--serial" ] && parallel=0
5
6 color=""
7 [ -t 1 ] && color="--gtest_color=yes"
8
9 function cleanup() {
10 pkill -P $$ || true
11 }
12 trap cleanup EXIT ERR HUP INT QUIT
13
14 declare -A pids
15
16 for f in \
17 api_aio api_io api_list api_lock api_misc \
18 api_tier api_pool api_snapshots api_stat api_watch_notify api_cmd \
19 api_c_write_operations \
20 api_c_read_operations \
21 list_parallel \
22 open_pools_parallel \
23 delete_pools_parallel \
24 watch_notify
25 do
26 if [ $parallel -eq 1 ]; then
27 r=`printf '%25s' $f`
28 bash -o pipefail -exc "ceph_test_rados_$f $color 2>&1 | tee ceph_test_rados_$f.log | sed \"s/^/$r: /\"" &
29 pid=$!
30 echo "test $f on pid $pid"
31 pids[$f]=$pid
32 else
33 ceph_test_rados_$f
34 fi
35 done
36
37 ret=0
38 if [ $parallel -eq 1 ]; then
39 for t in "${!pids[@]}"
40 do
41 pid=${pids[$t]}
42 if ! wait $pid
43 then
44 echo "error in $t ($pid)"
45 ret=1
46 fi
47 done
48 fi
49
50 exit $ret