2016-02-02 22:45:04 +00:00
|
|
|
#!/bin/bash -ex
|
2011-08-17 19:35:39 +00:00
|
|
|
|
2016-02-01 16:26:00 +00:00
|
|
|
parallel=1
|
|
|
|
[ "$1" = "--serial" ] && parallel=0
|
2011-08-17 19:35:39 +00:00
|
|
|
|
2016-02-01 16:26:00 +00:00
|
|
|
color=""
|
|
|
|
[ -t 1 ] && color="--gtest_color=yes"
|
|
|
|
|
|
|
|
function cleanup() {
|
|
|
|
pkill -P $$ || true
|
|
|
|
}
|
|
|
|
trap cleanup EXIT ERR HUP INT QUIT
|
|
|
|
|
2017-02-05 15:11:13 +00:00
|
|
|
declare -A pids
|
|
|
|
|
2016-02-01 16:26:00 +00:00
|
|
|
for f in \
|
|
|
|
api_aio api_io api_list api_lock api_misc \
|
|
|
|
api_tier api_pool api_snapshots api_stat api_watch_notify api_cmd \
|
|
|
|
api_c_write_operations \
|
|
|
|
api_c_read_operations \
|
|
|
|
list_parallel \
|
|
|
|
open_pools_parallel \
|
|
|
|
delete_pools_parallel \
|
|
|
|
watch_notify
|
|
|
|
do
|
|
|
|
if [ $parallel -eq 1 ]; then
|
|
|
|
r=`printf '%25s' $f`
|
2016-03-17 18:51:56 +00:00
|
|
|
bash -o pipefail -exc "ceph_test_rados_$f $color 2>&1 | tee ceph_test_rados_$f.log | sed \"s/^/$r: /\"" &
|
|
|
|
pid=$!
|
|
|
|
echo "test $f on pid $pid"
|
2017-02-05 15:11:13 +00:00
|
|
|
pids[$f]=$pid
|
2016-02-01 16:26:00 +00:00
|
|
|
else
|
|
|
|
ceph_test_rados_$f
|
|
|
|
fi
|
|
|
|
done
|
2012-10-16 23:49:44 +00:00
|
|
|
|
2016-03-17 18:51:56 +00:00
|
|
|
ret=0
|
|
|
|
if [ $parallel -eq 1 ]; then
|
2017-02-05 15:11:13 +00:00
|
|
|
for t in "${!pids[@]}"
|
2016-03-17 18:51:56 +00:00
|
|
|
do
|
2017-02-05 15:11:13 +00:00
|
|
|
pid=${pids[$t]}
|
|
|
|
if ! wait $pid
|
2016-03-17 18:51:56 +00:00
|
|
|
then
|
2017-02-05 15:11:13 +00:00
|
|
|
echo "error in $t ($pid)"
|
2016-03-17 18:51:56 +00:00
|
|
|
ret=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit $ret
|