summaryrefslogtreecommitdiff
path: root/cpp/src/tests
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2012-09-11 18:52:32 +0000
committerAlan Conway <aconway@apache.org>2012-09-11 18:52:32 +0000
commit4c88320dbbbbc35c9c755a78cc15d9b81e865f52 (patch)
tree8d7e67ffb8965f234f1502a2be01bddf44ede8b7 /cpp/src/tests
parentfa4485993c1a0c2b691918ddfaa6748fa4b50971 (diff)
downloadqpid-python-4c88320dbbbbc35c9c755a78cc15d9b81e865f52.tar.gz
NO-JIRA: Removed replication_test, unused test for defunct feature.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1383536 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests')
-rw-r--r--cpp/src/tests/Makefile.am4
-rwxr-xr-xcpp/src/tests/clustered_replication_test111
-rwxr-xr-xcpp/src/tests/reliable_replication_test84
-rwxr-xr-xcpp/src/tests/replication_test182
-rw-r--r--cpp/src/tests/test_env.ps1.in2
-rw-r--r--cpp/src/tests/test_env.sh.in2
6 files changed, 1 insertions, 384 deletions
diff --git a/cpp/src/tests/Makefile.am b/cpp/src/tests/Makefile.am
index f9eed9270b..2a66aefc03 100644
--- a/cpp/src/tests/Makefile.am
+++ b/cpp/src/tests/Makefile.am
@@ -303,7 +303,7 @@ system_tests = qpid-client-test quick_perftest quick_topictest run_header_test q
run_msg_group_tests
TESTS += start_broker $(system_tests) python_tests stop_broker \
run_ha_tests run_federation_tests run_federation_sys_tests \
- run_acl_tests run_cli_tests replication_test dynamic_log_level_test \
+ run_acl_tests run_cli_tests dynamic_log_level_test \
run_queue_flow_limit_tests ipv6_test
EXTRA_DIST += \
@@ -327,7 +327,6 @@ EXTRA_DIST += \
MessageUtils.h \
TestMessageStore.h \
TxMocks.h \
- replication_test \
run_perftest \
ring_queue_test \
run_ring_queue_test \
@@ -373,7 +372,6 @@ EXTRA_DIST+= \
multiq_perftest \
topic_perftest \
run_failover_soak \
- reliable_replication_test \
federated_cluster_test_with_node_failure \
sasl_test_setup.sh \
run_msg_group_tests_soak \
diff --git a/cpp/src/tests/clustered_replication_test b/cpp/src/tests/clustered_replication_test
deleted file mode 100755
index 5a9f143eb4..0000000000
--- a/cpp/src/tests/clustered_replication_test
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/bin/bash
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Test reliability of the replication feature in the face of link
-# failures:
-source ./test_env.sh
-
-trap stop_brokers INT EXIT
-
-fail() {
- echo $1
- exit 1
-}
-
-stop_brokers() {
- if [[ $PRIMARY1 ]] ; then
- $QPIDD_EXEC --no-module-dir -q --port $PRIMARY1
- unset PRIMARY1
- fi
- if [[ $PRIMARY2 ]] ; then
- $QPIDD_EXEC --no-module-dir -q --port $PRIMARY2
- unset PRIMARY2
- fi
- if [[ $DR1 ]] ; then
- $QPIDD_EXEC --no-module-dir -q --port $DR1
- unset DR1
- fi
- if [[ $DR2 ]] ; then
- $QPIDD_EXEC --no-module-dir -q --port $DR2
- unset DR2
- fi
-}
-
-if test -d $PYTHON_DIR; then
- . cpg_check.sh
- cpg_enabled || exit 0
-
- #todo: these cluster names need to be unique to prevent clashes
- PRIMARY_CLUSTER=PRIMARY_$(hostname)_$$
- DR_CLUSTER=DR_$(hostname)_$$
-
- GENERAL_OPTS="--auth no --no-module-dir --no-data-dir --daemon --port 0 --log-to-stderr false"
- PRIMARY_OPTS="--load-module $REPLICATING_LISTENER_LIB --create-replication-queue true --replication-queue REPLICATION_QUEUE --load-module $CLUSTER_LIB --cluster-name $PRIMARY_CLUSTER"
- DR_OPTS="--load-module $REPLICATION_EXCHANGE_LIB --load-module $CLUSTER_LIB --cluster-name $DR_CLUSTER"
-
- rm -f repl*.tmp #cleanup any files left from previous run
-
- #start first node of primary cluster and set up test queue
- echo Starting primary cluster
- PRIMARY1=$(with_ais_group $QPIDD_EXEC $GENERAL_OPTS $PRIMARY_OPTS --log-to-file repl.primary.1.tmp) || fail "Could not start PRIMARY1"
- $PYTHON_COMMANDS/qpid-config -b "localhost:$PRIMARY1" add queue test-queue --generate-queue-events 2
- $PYTHON_COMMANDS/qpid-config -b "localhost:$PRIMARY1" add queue control-queue --generate-queue-events 1
-
- #send 10 messages, consume 5 of them
- for i in `seq 1 10`; do echo Message$i; done | ./sender --port $PRIMARY1
- ./receiver --port $PRIMARY1 --messages 5 > /dev/null
-
- #add new node to primary cluster, testing correct transfer of state:
- echo Adding node to primary cluster
- PRIMARY2=$(with_ais_group $QPIDD_EXEC $GENERAL_OPTS $PRIMARY_OPTS --log-to-file repl.primary.2.tmp) || fail "Could not start PRIMARY2 "
-
- #start DR cluster, set up test queue there and establish replication bridge
- echo Starting DR cluster
- DR1=$(with_ais_group $QPIDD_EXEC $GENERAL_OPTS $DR_OPTS --log-to-file repl.dr.1.tmp) || fail "Could not start DR1"
- DR2=$(with_ais_group $QPIDD_EXEC $GENERAL_OPTS $DR_OPTS --log-to-file repl.dr.2.tmp) || fail "Could not start DR2"
-
- $PYTHON_COMMANDS/qpid-config -b "localhost:$DR1" add queue test-queue
- $PYTHON_COMMANDS/qpid-config -b "localhost:$DR1" add queue control-queue
- $PYTHON_COMMANDS/qpid-config -b "localhost:$DR1" add exchange replication REPLICATION_EXCHANGE
- $PYTHON_COMMANDS/qpid-route queue add localhost:$DR2 localhost:$PRIMARY2 REPLICATION_EXCHANGE REPLICATION_QUEUE || fail "Could not add route."
-
- #send more messages to primary
- for i in `seq 11 20`; do echo Message$i; done | ./sender --port $PRIMARY1 --send-eos 1
-
- #wait for replication events to all be processed:
- echo Waiting for replication to complete
- echo Done | ./sender --port $PRIMARY1 --routing-key control-queue --send-eos 1
- ./receiver --queue control-queue --port $DR1 > /dev/null
-
- #verify contents of test queue on dr cluster:
- echo Verifying...
- ./receiver --port $DR2 > repl.out.tmp
- for i in `seq 6 20`; do echo Message$i; done | diff repl.out.tmp - || FAIL=1
-
- if [[ $FAIL ]]; then
- echo Clustered replication test failed: expectations not met!
- exit 1
- else
- echo Clustered replication test passed
- rm -f repl*.tmp
- fi
-
-fi
diff --git a/cpp/src/tests/reliable_replication_test b/cpp/src/tests/reliable_replication_test
deleted file mode 100755
index c660f751e5..0000000000
--- a/cpp/src/tests/reliable_replication_test
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/bash
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Test reliability of the replication feature in the face of link
-# failures:
-
-source ./test_env.sh
-
-trap stop_brokers EXIT
-
-stop_brokers() {
- if [[ $BROKER_A ]] ; then
- $QPIDD_EXEC --no-module-dir -q --port $BROKER_A
- unset BROKER_A
- fi
- if [[ $BROKER_B ]] ; then
- $QPIDD_EXEC --no-module-dir -q --port $BROKER_B
- unset BROKER_B
- fi
-}
-
-setup() {
- rm -f replication-source.log replication-dest.log
- $QPIDD_EXEC --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $REPLICATING_LISTENER_LIB --replication-queue replication --create-replication-queue true --log-enable trace+ --log-to-file replication-source.log --log-to-stderr 0 > qpidd-repl.port
- BROKER_A=`cat qpidd-repl.port`
-
- $QPIDD_EXEC --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $REPLICATION_EXCHANGE_LIB --log-enable info+ --log-to-file replication-dest.log --log-to-stderr 0 > qpidd-repl.port
- BROKER_B=`cat qpidd-repl.port`
-
- echo "Testing replication from port $BROKER_A to port $BROKER_B"
-
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_B" add exchange replication replication
- $PYTHON_COMMANDS/qpid-route --ack 500 queue add "localhost:$BROKER_B" "localhost:$BROKER_A" replication replication
-
- #create test queue (only replicate enqueues for this test):
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_A" add queue queue-a --generate-queue-events 1
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_B" add queue queue-a
-}
-
-send() {
- ./sender --port $BROKER_A --routing-key queue-a --send-eos 1 < replicated.expected
-}
-
-receive() {
- rm -f replicated.actual
- ./receiver --port $BROKER_B --queue queue-a > replicated.actual
-}
-
-bounce_link() {
- $PYTHON_COMMANDS/qpid-route link del "localhost:$BROKER_B" "localhost:$BROKER_A"
- $PYTHON_COMMANDS/qpid-route --ack 500 queue add "localhost:$BROKER_B" "localhost:$BROKER_A" replication replication
-}
-
-if test -d ${PYTHON_DIR} && test -e $REPLICATING_LISTENER_LIB && test -e $REPLICATION_EXCHANGE_LIB ; then
- setup
- for i in `seq 1 100000`; do echo Message $i; done > replicated.expected
- send &
- receive &
- for i in `seq 1 3`; do sleep 1; bounce_link; done;
- wait
- #check that received list is identical to sent list
- diff replicated.actual replicated.expected || exit 1
- rm -f replication.actual replication.expected replication-source.log replication-dest.log qpidd-repl.port
- true
-fi
-
diff --git a/cpp/src/tests/replication_test b/cpp/src/tests/replication_test
deleted file mode 100755
index f8b2136396..0000000000
--- a/cpp/src/tests/replication_test
+++ /dev/null
@@ -1,182 +0,0 @@
-#!/bin/bash
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Run a test of the replication feature
-
-source ./test_env.sh
-
-trap stop_brokers INT TERM QUIT
-
-stop_brokers() {
- if [ x$BROKER_A != x ]; then
- $QPIDD_EXEC --no-module-dir -q --port $BROKER_A
- unset BROKER_A
- fi
- if [ x$BROKER_B != x ]; then
- $QPIDD_EXEC --no-module-dir -q --port $BROKER_B
- unset BROKER_B
- fi
-}
-
-if test -d ${PYTHON_DIR} && test -f "$REPLICATING_LISTENER_LIB" && test -f "$REPLICATION_EXCHANGE_LIB"; then
- rm -f queue-*.repl replication-*.log #cleanup from any earlier runs
-
- $QPIDD_EXEC --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $REPLICATING_LISTENER_LIB --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_EXEC --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $REPLICATION_EXCHANGE_LIB --log-enable info+ --log-to-file replication-dest.log --log-to-stderr 0 > qpidd.port
- BROKER_B=`cat qpidd.port`
- echo "Running replication test between localhost:$BROKER_A and localhost:$BROKER_B"
-
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_B" add exchange replication replication
- $PYTHON_COMMANDS/qpid-route --ack 5 queue add "localhost:$BROKER_B" "localhost:$BROKER_A" replication replication
-
- #create test queues
-
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_A" add queue queue-a --generate-queue-events 2
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_A" add queue queue-b --generate-queue-events 2
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_A" add queue queue-c --generate-queue-events 1
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_A" add queue queue-d --generate-queue-events 2
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_A" add queue queue-e --generate-queue-events 1
-
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_B" add queue queue-a
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_B" add queue queue-b
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_B" add queue queue-c
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_B" add queue queue-e
- #queue-d deliberately not declared on DR; this error case should be handled
-
- #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
- ./sender --port $BROKER_A --routing-key queue-c --send-eos 1 < queue-c-input.repl
- echo dummy | ./sender --port $BROKER_A --routing-key queue-d --send-eos 1
-
- ./receiver --port $BROKER_A --queue queue-a --messages 5 > /dev/null
- ./receiver --port $BROKER_A --queue queue-b --messages 10 > /dev/null
- ./receiver --port $BROKER_A --queue queue-c --messages 10 > /dev/null
- ./receiver --port $BROKER_A --queue queue-d > /dev/null
-
-
- # What we are doing is putting a message on the end of repliaction queue & waiting for it on remote side
- # making sure all the messages have been flushed from the replication queue.
- echo dummy | ./sender --port $BROKER_A --routing-key queue-e --send-eos 1
- ./receiver --port $BROKER_B --queue queue-e --messages 1 > /dev/null
-
- #shutdown broker A then check that broker Bs versions of the queues are as expected
- $QPIDD_EXEC --no-module-dir -q --port $BROKER_A
- unset BROKER_A
-
- #validate replicated queues:
- ./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
-
-
- 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
- diff queue-b-backup.repl queue-b-expected.repl || FAIL=1
- diff queue-c-backup.repl queue-c-input.repl || FAIL=1
-
- grep 'queue-d does not exist' replication-dest.log > /dev/null || echo "WARNING: Expected error to be logged!"
-
- stop_brokers
-
- # now check offsets working (enqueue based on position being set, not queue abs position)
-
- $QPIDD_EXEC --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $REPLICATING_LISTENER_LIB --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_EXEC --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $REPLICATION_EXCHANGE_LIB --log-enable info+ --log-to-file replication-dest.log --log-to-stderr 0 > qpidd.port
- BROKER_B=`cat qpidd.port`
-
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_B" add exchange replication replication
- $PYTHON_COMMANDS/qpid-route --ack 5 queue add "localhost:$BROKER_B" "localhost:$BROKER_A" replication replication
-
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_A" add queue queue-e --generate-queue-events 2
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_B" add queue queue-e
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_A" add queue queue-d --generate-queue-events 1
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_B" add queue queue-d
-
- i=1
- while [ $i -le 10 ]; do
- echo Message $i for A >> queue-e-input.repl
- i=`expr $i + 1`
- done
-
- ./sender --port $BROKER_A --routing-key queue-e --send-eos 1 < queue-e-input.repl
- ./receiver --port $BROKER_A --queue queue-e --messages 10 > /dev/null
-
- # What we are doing is putting a message on the end of repliaction queue & waiting for it on remote side
- # making sure all the messages have been flushed from the replication queue.
- echo dummy | ./sender --port $BROKER_A --routing-key queue-d --send-eos 1
- ./receiver --port $BROKER_B --queue queue-d --messages 1 > /dev/null
-
- # now check offsets working
- $QPIDD_EXEC --no-module-dir -q --port $BROKER_B
- unset BROKER_B
- $QPIDD_EXEC --daemon --port 0 --no-data-dir --no-module-dir --auth no --load-module $REPLICATION_EXCHANGE_LIB --log-enable info+ --log-to-file replication-dest.log --log-to-stderr 0 > qpidd.port
- BROKER_B=`cat qpidd.port`
-
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_B" add queue queue-e
- $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_B" add exchange replication replication
- $PYTHON_COMMANDS/qpid-route --ack 5 queue add "localhost:$BROKER_B" "localhost:$BROKER_A" replication replication
- # now send another 15
- i=11
- while [ $i -le 15 ]; do
- echo Message $i for A >> queue-e1-input.repl
- i=`expr $i + 1`
- done
- ./sender --port $BROKER_A --routing-key queue-e --send-eos 1 < queue-e1-input.repl
-
- ./receiver --port $BROKER_B --queue queue-e > queue-e-backup.repl
- diff queue-e-backup.repl queue-e1-input.repl || FAIL=1
-
- stop_brokers
-
- if [ x$FAIL != x ]; then
- echo replication test failed: expectations not met!
- exit 1
- else
- echo queue state replicated as expected
- rm -f queue-*.repl replication-*.log
- fi
-
-else
- echo "Skipping replication test, plugins not built or python utils not located"
-fi
-
diff --git a/cpp/src/tests/test_env.ps1.in b/cpp/src/tests/test_env.ps1.in
index 60ba4305a5..5fa3a0ac31 100644
--- a/cpp/src/tests/test_env.ps1.in
+++ b/cpp/src/tests/test_env.ps1.in
@@ -62,8 +62,6 @@ $env:TEST_STORE_LIB="$testmoduledir\test_store.so"
#exportmodule() { test -f $moduledir/$2 && eval "export $1=$moduledir/$2"; }
#exportmodule ACL_LIB acl.so
#exportmodule CLUSTER_LIB cluster.so
-#exportmodule REPLICATING_LISTENER_LIB replicating_listener.so
-#exportmodule REPLICATION_EXCHANGE_LIB replication_exchange.so
#exportmodule SSLCONNECTOR_LIB sslconnector.so
#exportmodule SSL_LIB ssl.so
#exportmodule WATCHDOG_LIB watchdog.so
diff --git a/cpp/src/tests/test_env.sh.in b/cpp/src/tests/test_env.sh.in
index cee36843ae..02c34af649 100644
--- a/cpp/src/tests/test_env.sh.in
+++ b/cpp/src/tests/test_env.sh.in
@@ -65,8 +65,6 @@ exportmodule() { test -f $moduledir/$2 && eval "export $1=$moduledir/$2"; }
exportmodule ACL_LIB acl.so
exportmodule CLUSTER_LIB cluster.so
exportmodule HA_LIB ha.so
-exportmodule REPLICATING_LISTENER_LIB replicating_listener.so
-exportmodule REPLICATION_EXCHANGE_LIB replication_exchange.so
exportmodule SSLCONNECTOR_LIB sslconnector.so
exportmodule SSL_LIB ssl.so
exportmodule WATCHDOG_LIB watchdog.so