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