diff options
Diffstat (limited to 'qpid/cpp/src/tests/replication_test')
| -rwxr-xr-x | qpid/cpp/src/tests/replication_test | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/qpid/cpp/src/tests/replication_test b/qpid/cpp/src/tests/replication_test index 931078c047..9b6e5cfb29 100755 --- a/qpid/cpp/src/tests/replication_test +++ b/qpid/cpp/src/tests/replication_test @@ -19,7 +19,7 @@ # under the License. # -# Run the federation tests. +# Run a test of the replication feature MY_DIR=`dirname \`which $0\`` PYTHON_DIR=${MY_DIR}/../../../python @@ -37,15 +37,18 @@ stop_brokers() { } if test -d ${PYTHON_DIR} && test -e ../.libs/replicating_listener.so && test -e ../.libs/replication_exchange.so ; then - ../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 > qpidd.port + 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 BROKER_A=`cat qpidd.port` - ../qpidd --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module ../.libs/replication_exchange.so > qpidd.port + ../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 + 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 - $PYTHON_DIR/commands/qpid-route queue add "localhost:$BROKER_B" "localhost:$BROKER_A" replication replication + $PYTHON_DIR/commands/qpid-route --ack 5 queue add "localhost:$BROKER_B" "localhost:$BROKER_A" replication replication #create test queues @@ -58,7 +61,6 @@ 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 #publish and consume from test queus on broker A: - rm -f queue-*.repl 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 @@ -79,6 +81,9 @@ if test -d ${PYTHON_DIR} && test -e ../.libs/replicating_listener.so && test -e ./receiver --port $BROKER_B --queue queue-a > queue-a-backup.repl ./receiver --port $BROKER_B --queue queue-b > queue-b-backup.repl ./receiver --port $BROKER_B --queue queue-c > queue-c-backup.repl + + stop_brokers + tail -5 queue-a-input.repl > queue-a-expected.repl tail -10 queue-b-input.repl > queue-b-expected.repl diff queue-a-backup.repl queue-a-expected.repl || FAIL=1 @@ -87,12 +92,12 @@ if test -d ${PYTHON_DIR} && test -e ../.libs/replicating_listener.so && test -e if [[ $FAIL ]]; then echo replication test failed: expectations not met! + exit 1 else echo queue state replicated as expected - rm queue-*.repl + rm -f queue-*.repl replication-*.log fi - stop_brokers else echo "Skipping replication test, plugins not built or python utils not located" fi |
