AC_CHECK_PROGS([DOXYGEN], [doxygen])
AC_CHECK_PROGS([AWK], [awk])
AC_CHECK_PROGS([SED], [sed])
+AC_PATH_PROG([BASHPATH], [bash])
# Checks for compiler characteristics.
AC_PROG_GCC_TRADITIONAL
LDFLAGS="$ENV_LDFLAGS $COVERAGE_LDFLAGS $OS_LDFLAGS"
# substitute what we need:
+AC_SUBST([BASHPATH])
AC_SUBST([INITDDIR])
AC_SUBST([SYSTEMDDIR])
INITWRAPPERSDIR=$(eval echo ${INITWRAPPERSDIR})
MAINTAINERCLEANFILES = Makefile.in
+EXTRA_DIST = cmap-dispatch-deadlock.sh.in \
+ shm_leak_audit.sh.in
+
TEST_AGENTS = cpg_test_agent \
sam_test_agent \
votequorum_test_agent
noinst_SCRIPTS = $(SHELL_TESTS)
endif
+cmap-dispatch-deadlock.sh: cmap-dispatch-deadlock.sh.in
+ sed -e 's#@''BASHPATH@#${BASHPATH}#g' $< > $@
+ chmod 755 $@
+
+shm_leak_audit.sh: shm_leak_audit.sh.in
+ sed -e 's#@''BASHPATH@#${BASHPATH}#g' $< > $@
+ chmod 755 $@
+
AM_CPPFLAGS = -I$(top_builddir)/include \
-I$(top_srcdir)/include \
-I$(top_builddir)/include/corosync
$(top_builddir)/lib/libvotequorum.la \
$(top_builddir)/common_lib/libcorosync_common.la
+clean-local:
+ rm -f shm_leak_audit.sh cmap-dispatch-deadlock.sh
+
lint:
-splint $(LINT_FLAGS) $(CFLAGS) *.c
+++ /dev/null
-#!/bin/bash
-
-export TIMEOUT=600
-export PID=$$
-up_to=200
-
-rec_plist() {
- if [ "$2" == "" ];then
- pl="`ps ax -o pid= -o ppid= -o comm=`"
- else
- pl=$2
- fi
-
- list=`echo "$pl" | egrep "^ *[0-9]+ +$1" | awk '{ print $1 }'`
- tmplist=$list
- for i in $tmplist;do
- [ "$i" != "$1" ] && [ "$i" != "$$" ] && list="$list "`rec_plist $i "$pl"`
- done
-
- echo $list
-}
-
-rec_pkill() {
- kill -9 `rec_plist "$1"` 2> /dev/null
-}
-
-exit_timeout() {
- echo "ERR: Timeout. Test failed $PID"
- rec_pkill "$$"
- exit 1
-}
-
-corosync-cmapctl -s test.abd "str" "test" || exit 2
-
-trap exit_timeout SIGUSR1
-(sleep $TIMEOUT ; kill -SIGUSR1 $PID) &
-
-wait_list=""
-
-for e in {1..40};do
- (for a in `seq 1 $up_to`;do corosync-cmapctl -s test.abd "str" $a ; done) &
- wait_list="$wait_list $!"
-done
-
-notify_list=""
-
-for i in {1..2};do
- sleep 600000 | corosync-cmapctl -t test > /dev/null &
- notify_list="$notify_list $!"
-done
-
-wait $wait_list
-
-rec_pkill "$$"
-
-echo "OK"
-exit 0
--- /dev/null
+#!@BASHPATH@
+
+export TIMEOUT=600
+export PID=$$
+up_to=200
+
+rec_plist() {
+ if [ "$2" == "" ];then
+ pl="`ps ax -o pid= -o ppid= -o comm=`"
+ else
+ pl=$2
+ fi
+
+ list=`echo "$pl" | egrep "^ *[0-9]+ +$1" | awk '{ print $1 }'`
+ tmplist=$list
+ for i in $tmplist;do
+ [ "$i" != "$1" ] && [ "$i" != "$$" ] && list="$list "`rec_plist $i "$pl"`
+ done
+
+ echo $list
+}
+
+rec_pkill() {
+ kill -9 `rec_plist "$1"` 2> /dev/null
+}
+
+exit_timeout() {
+ echo "ERR: Timeout. Test failed $PID"
+ rec_pkill "$$"
+ exit 1
+}
+
+corosync-cmapctl -s test.abd "str" "test" || exit 2
+
+trap exit_timeout SIGUSR1
+(sleep $TIMEOUT ; kill -SIGUSR1 $PID) &
+
+wait_list=""
+
+for e in {1..40};do
+ (for a in `seq 1 $up_to`;do corosync-cmapctl -s test.abd "str" $a ; done) &
+ wait_list="$wait_list $!"
+done
+
+notify_list=""
+
+for i in {1..2};do
+ sleep 600000 | corosync-cmapctl -t test > /dev/null &
+ notify_list="$notify_list $!"
+done
+
+wait $wait_list
+
+rec_pkill "$$"
+
+echo "OK"
+exit 0
+++ /dev/null
-#!/bin/bash
-
-
-service corosync status >/dev/null
-CS_STATUS=$?
-
-if [ $CS_STATUS -eq 0 ]
-then
- # corosync running
- active=$(corosync-cmapctl runtime.connections.active | cut -d= -f2)
- if [ $active -lt 2 ]
- then
- FILES=$(ls /dev/shm/qb-*)
- for f in $FILES
- do
- if [[ "$f" =~ "blackbox" ]]
- then
- true
- else
- echo $f
- fi
- done
- else
- pids=$(corosync-cmapctl runtime.connections. | grep client_pid | cut -d= -f2)
-
- FILES=$(ls /dev/shm/qb-*)
- for f in $FILES
- do
- found=0
- for p in $pids
- do
- if [[ "$f" =~ "$p" ]]
- then
- found=1
- elif [[ "$f" =~ "blackbox" ]]
- then
- found=1
- fi
- done
- if [ $found -eq 0 ]
- then
- echo $f
- fi
- done
- fi
-else
- FILES=$(ls /dev/shm/qb-*)
- for f in $FILES
- do
- echo $f
- done
-fi
-
-exit 0
-
--- /dev/null
+#!@BASHPATH@
+
+
+service corosync status >/dev/null
+CS_STATUS=$?
+
+if [ $CS_STATUS -eq 0 ]
+then
+ # corosync running
+ active=$(corosync-cmapctl runtime.connections.active | cut -d= -f2)
+ if [ $active -lt 2 ]
+ then
+ FILES=$(ls /dev/shm/qb-*)
+ for f in $FILES
+ do
+ if [[ "$f" =~ "blackbox" ]]
+ then
+ true
+ else
+ echo $f
+ fi
+ done
+ else
+ pids=$(corosync-cmapctl runtime.connections. | grep client_pid | cut -d= -f2)
+
+ FILES=$(ls /dev/shm/qb-*)
+ for f in $FILES
+ do
+ found=0
+ for p in $pids
+ do
+ if [[ "$f" =~ "$p" ]]
+ then
+ found=1
+ elif [[ "$f" =~ "blackbox" ]]
+ then
+ found=1
+ fi
+ done
+ if [ $found -eq 0 ]
+ then
+ echo $f
+ fi
+ done
+ fi
+else
+ FILES=$(ls /dev/shm/qb-*)
+ for f in $FILES
+ do
+ echo $f
+ done
+fi
+
+exit 0
+
-e 's#@''INITDDIR@#$(INITDDIR)#g' \
-e 's#@''INITWRAPPERSDIR@#$(INITWRAPPERSDIR)#g' \
-e 's#@''LOCALSTATEDIR@#$(localstatedir)#g' \
+ -e 's#@''BASHPATH@#${BASHPATH}#g' \
> $@-t
mv $@-t $@
-#!/bin/bash
+#!@BASHPATH@
# Authors:
# Angus Salkeld <asalkeld@redhat.com>
-#!/bin/bash
+#!@BASHPATH@
# Authors:
# Andrew Beekhof <abeekhof@redhat.com>
testsam_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libsam.la
ploadstart: ploadstart.sh
- cp $^ $@
+ sed -e 's#@''BASHPATH@#${BASHPATH}#g' $< > $@
chmod 755 $@
LINT_FILES1:=$(filter-out sa_error.c, $(wildcard *.c))
-#!/bin/bash
+#!@BASHPATH@
set -e
corosync-blackbox.sh
corosync-xmlproc: corosync-xmlproc.sh
- sed -e 's#@''DATADIR@#${datadir}#g' $< > $@
+ sed -e 's#@''DATADIR@#${datadir}#g' \
+ -e 's#@''BASHPATH@#${BASHPATH}#g' \
+ $< > $@
corosync-blackbox: corosync-blackbox.sh
sed -e 's#@''LOCALSTATEDIR@#${localstatedir}#g' $< > $@
-#!/bin/bash
+#!@BASHPATH@
# Copyright (c) 2011 Red Hat, Inc.
#