2017-07-20 22:26:42 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -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 \
|
librados: move C++ APIs into libradospp
the goal is to decouple C++ API from C API, and to version them
differently, as they are targeting different consumers.
this allows us to change the C++ API and bumping up its soversion
without requiring consumer to recompile the librados client for
using the new librados. in this way, C++ API can move faster than
C API. for example, if bufferlist interface is changed for better
performance, and this breaks existing API/ABI, we can bump up
the C++ library's soversion, and and the C library's version unchanged
but ship the new librados's C binding. so the librados client linked
against librados's C library will be able to take advantage of
the improvement in C++ library. while the librados client
linked against C++ library won't break at runtime due to unresolved
symbol or changed structure layout.
this is massive change, the genereal idea is to
* split librados.cc into two source files: librados_c.cc and
librados_cxx.cc, the former for implementing C APIs, the later
for C++ APIs.
* extract the C++ API in librados into librados-cxx, the library
name will be libradospp. but we can change it before nautilus
is released.
* link these librados libraries with static libraries which it
depends on, so "-Wl,--exclude-libs,ALL" link flags can help
hide the non-public symbols.
* extract the tests exercising librados' C++ API into a different
source file named *_cxx.cc. for instance, to move the C++ tests
in aio.cc into aio_cxx.cc
* extract the shared helper functions which do not use any librados
or librados-cxx APIs into test_shared{.cc,h}. the "shared" here
means, *shared* by C++ and C tests.
* extract the test fixtures, i.e., the subclasses of testing::Test,
for testing C++ APIs into testcase_cxx.cc.
* update qa/workunits/rados/test.sh accordingly to add the splitted
tests
* update the consumers of librados to link against librados-cxx
instead, if they are using the C++ API.
Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-01-09 09:19:28 +00:00
|
|
|
api_aio api_aio_pp \
|
|
|
|
api_io api_io_pp \
|
|
|
|
api_asio api_list \
|
|
|
|
api_lock api_lock_pp \
|
|
|
|
api_misc api_misc_pp \
|
|
|
|
api_tier_pp \
|
|
|
|
api_pool \
|
|
|
|
api_snapshots api_snapshots_pp \
|
|
|
|
api_stat api_stat_pp \
|
|
|
|
api_watch_notify api_watch_notify_pp \
|
|
|
|
api_cmd api_cmd_pp \
|
|
|
|
api_service api_service_pp \
|
2016-02-01 16:26:00 +00:00
|
|
|
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`
|
2018-04-18 19:38:26 +00:00
|
|
|
ff=`echo $f | awk '{print $1}'`
|
|
|
|
bash -o pipefail -exc "ceph_test_rados_$f $color 2>&1 | tee ceph_test_rados_$ff.log | sed \"s/^/$r: /\"" &
|
2016-03-17 18:51:56 +00:00
|
|
|
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
|