]> git.proxmox.com Git - ceph.git/blob - ceph/qa/workunits/rados/test.sh
import 15.2.0 Octopus source
[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 list_parallel \
33 open_pools_parallel \
34 delete_pools_parallel
35 do
36 if [ $parallel -eq 1 ]; then
37 r=`printf '%25s' $f`
38 ff=`echo $f | awk '{print $1}'`
39 bash -o pipefail -exc "ceph_test_rados_$f $color 2>&1 | tee ceph_test_rados_$ff.log | sed \"s/^/$r: /\"" &
40 pid=$!
41 echo "test $f on pid $pid"
42 pids[$f]=$pid
43 else
44 ceph_test_rados_$f
45 fi
46 done
47
48 ret=0
49 if [ $parallel -eq 1 ]; then
50 for t in "${!pids[@]}"
51 do
52 pid=${pids[$t]}
53 if ! wait $pid
54 then
55 echo "error in $t ($pid)"
56 ret=1
57 fi
58 done
59 fi
60
61 exit $ret