4 if [ ! -e Makefile
-o ! -d bin
]; then
5 echo 'run this from the build dir'
9 TEMP_DIR
=${TMPDIR:-/tmp}
10 if [ ! -d $TEMP_DIR/ceph-disk-virtualenv
-o ! -d $TEMP_DIR/ceph-detect-init-virtualenv
]; then
11 echo '/tmp/*-virtualenv directories not built. Please run "make check" first.'
15 if [ `uname` = FreeBSD
]; then
16 # otherwise module prettytable will not be found
17 export PYTHONPATH
=/usr
/local
/lib
/python2.7
/site-packages
19 KERNCORE
="kern.corefile"
20 COREPATTERN
="core.%N.%P"
22 export PYTHONPATH
=/usr
/lib
/python2.7
/dist-packages
24 KERNCORE
="kernel.core_pattern"
25 COREPATTERN
="core.%e.%p.%t"
29 if [ -n "$precore" ]; then
30 sudo sysctl
-w ${KERNCORE}=${precore}
35 trap finish TERM HUP INT
39 export LD_LIBRARY_PATH
="$(pwd)/lib"
43 if [[ "$1" = "--dry-run" ]]; then
49 if [ "$1" = "" ]; then
55 location
="../qa/standalone"
60 precore
="$(sysctl -n $KERNCORE)"
61 # If corepattern already set, avoid having to use sudo
62 if [ "$precore" = "$COREPATTERN" ]; then
65 sudo sysctl
-w ${KERNCORE}=${COREPATTERN}
67 # Clean out any cores in core target directory (currently .)
68 if ls $
(dirname $
(sysctl
-n $KERNCORE)) |
grep -q '^core\|core$' ; then
69 mkdir found.cores.$$
2> /dev
/null || true
70 for i
in $
(ls $
(dirname $
(sysctl
-n $KERNCORE)) |
grep '^core\|core$'); do
73 echo "Stray cores put in $(pwd)/found.cores.$$"
77 for f
in $
(cd $location ; find .
-perm $exec_mode -type f
)
79 f
=$
(echo $f |
sed 's/\.\///')
80 # This is tested with misc/test-ceph-helpers.sh
81 if [[ "$f" = "ceph-helpers.sh" ]]; then
84 if [[ "$all" = "false" ]]; then
86 for c
in "${!select[@]}"
88 # Get command and any arguments of subset of tests ro tun
89 allargs
="${select[$c]}"
90 arg1
=$
(echo "$allargs" | cut
--delimiter " " --field 1)
91 # Get user args for this selection for use below
92 userargs
="$(echo $allargs | cut -s --delimiter " " --field 2-)"
93 if [[ "$arg1" = $
(basename $f) ]]; then
97 if [[ "$arg1" = "$f" ]]; then
102 if [[ "$found" = "false" ]]; then
106 # Don't run test-failure.sh unless explicitly specified
107 if [ "$all" = "true" -a "$f" = "special/test-failure.sh" ]; then
111 cmd
="$location/$f $userargs"
112 count
=$
(expr $count + 1)
114 if [[ "$dryrun" != "true" ]]; then
115 if ! PATH
=$PATH:bin \
120 echo "$f .............. FAILED"
121 errors
=$
(expr $errors + 1)
125 if [ -n "$precore" ]; then
126 sudo sysctl
-w ${KERNCORE}=${precore}
129 if [ "$errors" != "0" ]; then
130 echo "$errors TESTS FAILED, $count TOTAL TESTS"
134 echo "ALL $count TESTS PASSED"