summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorManuel Teira Paz <mteira@apache.org>2009-03-17 09:14:40 +0000
committerManuel Teira Paz <mteira@apache.org>2009-03-17 09:14:40 +0000
commit2bfe48b0409677dcaabaf4a9311e9c7d3fd010eb (patch)
tree6d5ca4682b9a99424a311503d2c08cb77dc85bc7 /cpp/src
parente090a2337ae5d2ea35a8061f7d70cb4ad679b0c5 (diff)
downloadqpid-python-2bfe48b0409677dcaabaf4a9311e9c7d3fd010eb.tar.gz
Fix some bashishms in test scripts
Replace usage of seq (not widely available) with a while loop. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@755161 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rwxr-xr-xcpp/src/tests/replication_test32
-rwxr-xr-xcpp/src/tests/run_header_test3
2 files changed, 24 insertions, 11 deletions
diff --git a/cpp/src/tests/replication_test b/cpp/src/tests/replication_test
index 605ee1376c..6e0c1c8d3b 100755
--- a/cpp/src/tests/replication_test
+++ b/cpp/src/tests/replication_test
@@ -22,21 +22,20 @@
# Run a test of the replication feature
MY_DIR=`dirname \`which $0\``
PYTHON_DIR=${MY_DIR}/../../../python
-
trap stop_brokers INT TERM QUIT
stop_brokers() {
- if [[ $BROKER_A ]] ; then
+ if [ x$BROKER_A != x ]; then
../qpidd -q --port $BROKER_A
unset BROKER_A
fi
- if [[ $BROKER_B ]] ; then
+ if [ x$BROKER_B != x ]; then
../qpidd -q --port $BROKER_B
unset BROKER_B
fi
}
-if test -d ${PYTHON_DIR} && test -e ../.libs/replicating_listener.so && test -e ../.libs/replication_exchange.so ; then
+if test -d ${PYTHON_DIR} && test -f ../.libs/replicating_listener.so && test -f ../.libs/replication_exchange.so; then
rm -f queue-*.repl replication-*.log #cleanup from any earlier runs
../qpidd --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module ../.libs/replicating_listener.so --replication-queue replication --create-replication-queue true --log-enable info+ --log-to-file replication-source.log --log-to-stderr 0 > qpidd.port
@@ -44,7 +43,8 @@ if test -d ${PYTHON_DIR} && test -e ../.libs/replicating_listener.so && test -e
../qpidd --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module ../.libs/replication_exchange.so --log-enable info+ --log-to-file replication-dest.log --log-to-stderr 0 > qpidd.port
BROKER_B=`cat qpidd.port`
- export PYTHONPATH=$PYTHON_DIR
+ PYTHONPATH=$PYTHON_DIR
+ export PYTHONPATH
echo "Running replication test between localhost:$BROKER_A and localhost:$BROKER_B"
$PYTHON_DIR/commands/qpid-config -a "localhost:$BROKER_B" add exchange replication replication
@@ -62,10 +62,22 @@ if test -d ${PYTHON_DIR} && test -e ../.libs/replicating_listener.so && test -e
$PYTHON_DIR/commands/qpid-config -a "localhost:$BROKER_B" add queue queue-c
#queue-d deliberately not declared on DR; this error case should be handled
- #publish and consume from test queus on broker A:
- for i in `seq 1 10`; do echo Message $i for A >> queue-a-input.repl; done
- for i in `seq 1 20`; do echo Message $i for B >> queue-b-input.repl; done
- for i in `seq 1 15`; do echo Message $i for C >> queue-c-input.repl; done
+ #publish and consume from test queues on broker A:
+ i=1
+ while [ $i -le 10 ]; do
+ echo Message $i for A >> queue-a-input.repl
+ i=`expr $i + 1`
+ done
+ i=1
+ while [ $i -le 20 ]; do
+ echo Message $i for B >> queue-b-input.repl
+ i=`expr $i + 1`
+ done
+ i=1
+ while [ $i -le 15 ]; do
+ echo Message $i for C >> queue-c-input.repl
+ i=`expr $i + 1`
+ done
./sender --port $BROKER_A --routing-key queue-a --send-eos 1 < queue-a-input.repl
./sender --port $BROKER_A --routing-key queue-b --send-eos 1 < queue-b-input.repl
@@ -96,7 +108,7 @@ if test -d ${PYTHON_DIR} && test -e ../.libs/replicating_listener.so && test -e
grep 'queue-d does not exist' replication-dest.log > /dev/null || echo "WARNING: Expected error to be logged!"
- if [[ $FAIL ]]; then
+ if [ x$FAIL != x ]; then
echo replication test failed: expectations not met!
exit 1
else
diff --git a/cpp/src/tests/run_header_test b/cpp/src/tests/run_header_test
index 39d4a24f84..414fecd28f 100755
--- a/cpp/src/tests/run_header_test
+++ b/cpp/src/tests/run_header_test
@@ -29,7 +29,8 @@ test -f qpidd.port && QPID_PORT=`cat qpidd.port`
if test -d ${PYTHON_DIR} ; then
./header_test -p $QPID_PORT
- export PYTHONPATH=$PYTHON_DIR:$PYTHONPATH
+ PYTHONPATH=$PYTHON_DIR:$PYTHONPATH
+ export PYTHONPATH
$srcdir/header_test.py "localhost" $QPID_PORT
else
echo "Skipping header test as python libs not found"