4 if [ ! -e Makefile
-o ! -d bin
]; then
5 echo 'run this from the build dir'
9 if [ ! -d /tmp
/ceph-disk-virtualenv
-o ! -d /tmp
/ceph-detect-init-virtualenv
]; then
10 echo '/tmp/*-virtualenv directories not built. Please run "make check" first.'
14 if [ `uname` = FreeBSD
]; then
15 # otherwise module prettytable will not be found
16 export PYTHONPATH
=/usr
/local
/lib
/python2.7
/site-packages
18 KERNCORE
="kern.corefile"
19 COREPATTERN
="core.%N.%P"
21 export PYTHONPATH
=/usr
/lib
/python2.7
/dist-packages
23 KERNCORE
="kernel.core_pattern"
24 COREPATTERN
="core.%e.%p.%t"
28 if [ -n "$precore" ]; then
29 sudo sysctl
-w ${KERNCORE}=${precore}
34 trap finish TERM HUP INT
40 if [[ "$1" = "--dry-run" ]]; then
46 if [ "$1" = "" ]; then
52 location
="../qa/standalone"
57 precore
="$(sysctl -n $KERNCORE)"
58 # If corepattern already set, avoid having to use sudo
59 if [ "$precore" = "$COREPATTERN" ]; then
62 sudo sysctl
-w ${KERNCORE}=${COREPATTERN}
64 # Clean out any cores in core target directory (currently .)
65 if ls $
(dirname $
(sysctl
-n $KERNCORE)) |
grep -q '^core\|core$' ; then
66 mkdir found.cores.$$
2> /dev
/null || true
67 for i
in $
(ls $
(dirname $
(sysctl
-n $KERNCORE)) |
grep '^core\|core$'); do
70 echo "Stray cores put in $(pwd)/found.cores.$$"
74 for f
in $
(cd $location ; find .
-perm $exec_mode -type f
)
76 f
=$
(echo $f |
sed 's/\.\///')
77 # This is tested with misc/test-ceph-helpers.sh
78 if [[ "$f" = "ceph-helpers.sh" ]]; then
81 if [[ "$all" = "false" ]]; then
83 for c
in "${!select[@]}"
85 # Get command and any arguments of subset of tests ro tun
86 allargs
="${select[$c]}"
87 arg1
=$
(echo "$allargs" | cut
--delimiter " " --field 1)
88 # Get user args for this selection for use below
89 userargs
="$(echo $allargs | cut -s --delimiter " " --field 2-)"
90 if [[ "$arg1" = $
(basename $f) ]]; then
94 if [[ "$arg1" = "$f" ]]; then
99 if [[ "$found" = "false" ]]; then
103 # Don't run test-failure.sh unless explicitly specified
104 if [ "$all" = "true" -a "$f" = "special/test-failure.sh" ]; then
108 cmd
="$location/$f $userargs"
109 count
=$
(expr $count + 1)
111 if [[ "$dryrun" != "true" ]]; then
112 if ! PATH
=$PATH:bin \
117 echo "$f .............. FAILED"
118 errors
=$
(expr $errors + 1)
122 if [ -n "$precore" ]; then
123 sudo sysctl
-w ${KERNCORE}=${precore}
126 if [ "$errors" != "0" ]; then
127 echo "$errors TESTS FAILED, $count TOTAL TESTS"
131 echo "ALL $count TESTS PASSED"