]> git.proxmox.com Git - ceph.git/blame - ceph/qa/workunits/rados/test.sh
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / qa / workunits / rados / test.sh
CommitLineData
7c673cae
FG
1#!/bin/bash -ex
2
3parallel=1
4[ "$1" = "--serial" ] && parallel=0
5
6color=""
7[ -t 1 ] && color="--gtest_color=yes"
8
9function cleanup() {
10 pkill -P $$ || true
11}
12trap cleanup EXIT ERR HUP INT QUIT
13
14declare -A pids
15
16for 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
25do
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
35done
36
37ret=0
38if [ $parallel -eq 1 ]; then
39for t in "${!pids[@]}"
40do
41 pid=${pids[$t]}
42 if ! wait $pid
43 then
44 echo "error in $t ($pid)"
45 ret=1
46 fi
47done
48fi
49
50exit $ret