qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kgiu...@apache.org
Subject svn commit: r1333027 [5/13] - in /qpid/branches/qpid-3767/qpid: ./ cpp/ cpp/bindings/ cpp/bindings/qmf/ruby/ cpp/bindings/qpid/python/ cpp/bindings/qpid/ruby/ cpp/bindings/qpid/ruby/features/step_definitions/ cpp/bindings/qpid/ruby/lib/qpid/ cpp/docs/a...
Date Wed, 02 May 2012 13:10:03 GMT
Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster.cmake
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster.cmake?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster.cmake (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster.cmake Wed May  2 13:09:18 2012
@@ -55,7 +55,7 @@ add_test (clustered_replication_test ${C
 # CLEANFILES += cluster_test.acl cluster.ports
 
 # EXTRA_DIST +=					\
-# 	ais_check				\
+# 	cpg_check.sh.in				\
 # 	run_cluster_test			\
 # 	cluster_read_credit			\
 # 	test_watchdog				\

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster.mk
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster.mk?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster.mk (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster.mk Wed May  2 13:09:18 2012
@@ -25,12 +25,11 @@
 CLUSTER_TEST_SCRIPTS_LIST=			\
 	allhosts rsynchosts			\
 	qpid-build-rinstall qpid-src-rinstall	\
-	qpid-test-cluster			\
-	qpid-cluster-benchmark
+	qpid-test-cluster
 
 EXTRA_DIST +=					\
 	$(CLUSTER_TEST_SCRIPTS_LIST)		\
-	ais_check				\
+	cpg_check.sh.in				\
 	run_cluster_test			\
 	cluster_read_credit			\
 	test_watchdog				\
@@ -55,14 +54,12 @@ if HAVE_LIBCPG
 
 #
 # Cluster tests makefile fragment, to be included in Makefile.am
-# 
+#
 
 # NOTE: Programs using the openais library must be run with gid=ais
 # You should do "newgrp ais" before running the tests to run these.
-# 
-
+#
 
-# ais_check checks pre-requisites for cluster tests and runs them if ok.
 TESTS +=					\
 	run_cluster_test			\
 	cluster_read_credit			\

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_failover
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_failover?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_failover (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_failover Wed May  2 13:09:18 2012
@@ -11,8 +11,9 @@ echo $SEND $RECV
 
 seq 1000000 > $SEND
 
-qpid-receive -f -a 'q;{create:always}' -b $URL --connection-options "{reconnect:true}"  | tee $RECV &
-
-qpid-send -a 'q;{create:always}' -b $URL --connection-options "{reconnect:true}" --send-rate 10 --content-stdin < $SEND &
+qpid-send -a 'cluster_failover;{create:always}' -b $URL --connection-options "{reconnect:true}" --send-rate 10 --content-stdin < $SEND &
 
+while msg=$(qpid-receive -m1 -f -a 'cluster_failover;{create:always}' -b $URL --connection-options "{reconnect:true,heartbeat:1}"); do
+    echo -n $msg; date
+done
 wait

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_python_tests
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_python_tests?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_python_tests (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_python_tests Wed May  2 13:09:18 2012
@@ -20,7 +20,8 @@
 #
 
 # Skip if cluster services not running.
-. `dirname $0`/ais_check
+. cpg_check.sh
+cpg_enabled || exit 0
 
 FAILING=`dirname $0`/cluster_python_tests_failing.txt
 source `dirname $0`/python_tests

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_read_credit
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_read_credit?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_read_credit (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_read_credit Wed May  2 13:09:18 2012
@@ -21,7 +21,9 @@
 # Regression test for http://issues.apache.org/jira/browse/QPID-2086
 
 srcdir=`dirname $0`
-. $srcdir/ais_check
+source cpg_check.sh
+cpg_enabled || exit 0
+
 $srcdir/start_cluster 1 --cluster-read-max=2 || exit 1
 trap $srcdir/stop_cluster EXIT
 seq 1 10000 | ./sender --port `cat cluster.ports` --routing-key no-such-queue

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_test_logs.py
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_test_logs.py?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_test_logs.py (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_test_logs.py Wed May  2 13:09:18 2012
@@ -60,11 +60,13 @@ def filter_log(log):
         'task late',
         'task overran',
         'warning CLOSING .* unsent data',
-        'Inter-broker link ',
+        'Inter-broker link ',      # ignore link state changes
+        'Updated link key from ',  # ignore link state changes
         'Running in a cluster, marking store',
         'debug Sending keepalive signal to watchdog', # Watchdog timer thread
         'last broker standing joined by 1 replicas, updating queue policies.',
-        'Connection .* timed out: closing' # heartbeat connection close
+        'Connection .* timed out: closing', # heartbeat connection close
+        "org.apache.qpid.broker:bridge:"  # ignore bridge index
         ])
     # Regex to match a UUID
     uuid='\w\w\w\w\w\w\w\w-\w\w\w\w-\w\w\w\w-\w\w\w\w-\w\w\w\w\w\w\w\w\w\w\w\w'

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_tests.py
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_tests.py?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_tests.py (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_tests.py Wed May  2 13:09:18 2012
@@ -767,6 +767,124 @@ acl deny all all
         cluster.start()
         fetch(cluster[2])
 
+
+    def test_federation_failover(self):
+        """
+        Verify that federation operates across failures occuring in a cluster.
+        Specifically:
+        1) Destination cluster learns of membership changes in the source
+        cluster
+        2) Destination cluster replicates the current state of the source
+        cluster to newly-added members
+        """
+
+        TIMEOUT = 30
+        def verify(src_broker, src, dst_broker, dst, timeout=TIMEOUT):
+            """ Prove that traffic can pass from source fed broker to
+            destination fed broker
+            """
+            tot_time = 0
+            active = False
+            send_session = src_broker.connect().session()
+            sender = send_session.sender(src)
+            receive_session = dst_broker.connect().session()
+            receiver = receive_session.receiver(dst)
+            while not active and tot_time < timeout:
+                sender.send(Message("Hello from Source!"))
+                try:
+                    receiver.fetch(timeout = 1)
+                    receive_session.acknowledge()
+                    # Get this far without Empty exception, and the link is good!
+                    active = True
+                    while True:
+                        # Keep receiving msgs, as several may have accumulated
+                        receiver.fetch(timeout = 1)
+                        receive_session.acknowledge()
+                except Empty:
+                    if not active:
+                        tot_time += 1
+            receiver.close()
+            receive_session.close()
+            sender.close()
+            send_session.close()
+            self.assertTrue(active, "Bridge failed to become active")
+
+
+        # 2 node cluster source, 2 node cluster destination
+        src_cluster = self.cluster(2, expect=EXPECT_EXIT_FAIL)
+        src_cluster.ready();
+        dst_cluster = self.cluster(2, expect=EXPECT_EXIT_FAIL)
+        dst_cluster.ready();
+
+        cmd = self.popen(["qpid-config",
+                          "--broker", src_cluster[0].host_port(),
+                          "add", "queue", "srcQ"], EXPECT_EXIT_OK)
+        cmd.wait()
+
+        cmd = self.popen(["qpid-config",
+                          "--broker", dst_cluster[0].host_port(),
+                          "add", "exchange", "fanout", "destX"], EXPECT_EXIT_OK)
+        cmd.wait()
+
+        cmd = self.popen(["qpid-config",
+                          "--broker", dst_cluster[0].host_port(),
+                          "add", "queue", "destQ"], EXPECT_EXIT_OK)
+        cmd.wait()
+
+        cmd = self.popen(["qpid-config",
+                          "--broker", dst_cluster[0].host_port(),
+                          "bind", "destX", "destQ"], EXPECT_EXIT_OK)
+        cmd.wait()
+
+        # federate the srcQ to the destination exchange
+        dst_cluster[0].startQmf()
+        dst_broker = dst_cluster[0].qmf_session.getObjects(_class="broker")[0]
+        result = dst_broker.connect(src_cluster[0].host(), src_cluster[0].port(), False, "PLAIN",
+                                    "guest", "guest", "tcp")
+        self.assertEqual(result.status, 0, result);
+
+        link = dst_cluster[0].qmf_session.getObjects(_class="link")[0]
+        result = link.bridge(False, "srcQ", "destX", "", "", "", True, False, False, 10)
+        self.assertEqual(result.status, 0, result)
+
+        # check that traffic passes
+        verify(src_cluster[0], "srcQ", dst_cluster[0], "destQ")
+
+        # add src[2] broker to source cluster
+        src_cluster.start(expect=EXPECT_EXIT_FAIL);
+        src_cluster.ready();
+        verify(src_cluster[2], "srcQ", dst_cluster[0], "destQ")
+
+        # Kill src[0]. dst[0] should fail over to src[1]
+        src_cluster[0].kill()
+        for b in src_cluster[1:]: b.ready()
+        verify(src_cluster[1], "srcQ", dst_cluster[0], "destQ")
+
+        # Kill src[1], dst[0] should fail over to src[2]
+        src_cluster[1].kill()
+        for b in src_cluster[2:]: b.ready()
+        verify(src_cluster[2], "srcQ", dst_cluster[0], "destQ")
+
+        # Kill dest[0], force failover to dest[1]
+        dst_cluster[0].kill()
+        for b in dst_cluster[1:]: b.ready()
+        verify(src_cluster[2], "srcQ", dst_cluster[1], "destQ")
+
+        # Add dest[2]
+        # dest[1] syncs dest[2] to current remote state
+        dst_cluster.start(expect=EXPECT_EXIT_FAIL);
+        for b in dst_cluster[1:]: b.ready()
+        verify(src_cluster[2], "srcQ", dst_cluster[1], "destQ")
+
+        # Kill dest[1], force failover to dest[2]
+        dst_cluster[1].kill()
+        for b in dst_cluster[2:]: b.ready()
+        verify(src_cluster[2], "srcQ", dst_cluster[2], "destQ")
+
+        for i in range(2, len(src_cluster)): src_cluster[i].kill()
+        for i in range(2, len(dst_cluster)): dst_cluster[i].kill()
+
+
 # Some utility code for transaction tests
 XA_RBROLLBACK = 1
 XA_RBTIMEOUT = 2

Propchange: qpid/branches/qpid-3767/qpid/cpp/src/tests/cluster_tests.py
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/cpp/src/tests/cluster_tests.py:r1306564-1332660

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/clustered_replication_test
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/clustered_replication_test?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/clustered_replication_test (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/clustered_replication_test Wed May  2 13:09:18 2012
@@ -8,9 +8,9 @@
 # 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
@@ -34,11 +34,11 @@ stop_brokers() {
     if [[ $PRIMARY1 ]] ; then
         $QPIDD_EXEC --no-module-dir -q --port $PRIMARY1
         unset PRIMARY1
-    fi      
+    fi
     if [[ $PRIMARY2 ]] ; then
         $QPIDD_EXEC --no-module-dir -q --port $PRIMARY2
         unset PRIMARY2
-    fi      
+    fi
     if [[ $DR1 ]] ; then
         $QPIDD_EXEC --no-module-dir -q --port $DR1
         unset DR1
@@ -50,7 +50,8 @@ stop_brokers() {
 }
 
 if test -d $PYTHON_DIR; then
-    . $srcdir/ais_check
+    . cpg_check.sh
+    cpg_enabled || exit 0
 
     #todo: these cluster names need to be unique to prevent clashes
     PRIMARY_CLUSTER=PRIMARY_$(hostname)_$$
@@ -89,20 +90,20 @@ if test -d $PYTHON_DIR; then
     #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:        
+    #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...    
+    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 
+    else
         echo Clustered replication test passed
         rm -f repl*.tmp
     fi

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/federated_cluster_test
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/federated_cluster_test?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/federated_cluster_test (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/federated_cluster_test Wed May  2 13:09:18 2012
@@ -8,9 +8,9 @@
 # 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
@@ -35,7 +35,7 @@ stop_brokers() {
     if [[ $BROKER_A ]] ; then
         ../qpidd --no-module-dir -q --port $BROKER_A
         unset BROKER_A
-    fi      
+    fi
     if [[ $NODE_1 ]] ; then
         ../qpidd --no-module-dir -q --port $NODE_1
         unset NODE_1
@@ -92,7 +92,7 @@ run_test_pull_to_cluster_two_consumers()
     wait
     sort -g -k 2 fed1.out.tmp fed2.out.tmp > fed.out.tmp
     diff fed.in.tmp fed.out.tmp || fail "federated link to cluster failed: expectations not met!"
-        
+
     rm -f fed*.tmp #cleanup
 }
 
@@ -106,7 +106,7 @@ run_test_pull_to_cluster() {
 
     #verify all messages are received
     diff fed.in.tmp fed.out.tmp || fail "federated link to cluster failed: expectations not met!"
-        
+
     rm -f fed*.tmp #cleanup
 }
 
@@ -121,22 +121,23 @@ run_test_pull_from_cluster() {
     #verify all messages are received
     wait
     diff fed.in.tmp fed.out.tmp || fail "federated link from cluster failed: expectations not met!"
-        
+
     rm -f fed*.tmp #cleanup
 }
 
 
 if test -d ${PYTHON_DIR}; then
-    . $srcdir/ais_check
+    . cpg_check.sh
+    cpg_enabled || exit 0
 
     rm -f fed*.tmp #cleanup any files left from previous run
     start_brokers
     echo "brokers started"
     setup
     echo "setup completed"
-    run_test_pull_to_cluster_two_consumers    
+    run_test_pull_to_cluster_two_consumers
     echo "federated link to cluster verified"
-    run_test_pull_from_cluster    
+    run_test_pull_from_cluster
     echo "federated link from cluster verified"
     if [[ $TEST_NODE_FAILURE ]] ; then
         #kill first cluster node and retest
@@ -146,7 +147,7 @@ if test -d ${PYTHON_DIR}; then
         echo "retesting..."
         run_test_pull_to_cluster
         echo "federated link to cluster verified"
-        run_test_pull_from_cluster    
-        echo "federated link from cluster verified"    
+        run_test_pull_from_cluster
+        echo "federated link from cluster verified"
     fi
 fi

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/ha_tests.py
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/ha_tests.py?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/ha_tests.py (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/ha_tests.py Wed May  2 13:09:18 2012
@@ -19,27 +19,32 @@
 #
 
 import os, signal, sys, time, imp, re, subprocess, glob, random, logging, shutil, math
-from qpid.messaging import Message, NotFound, ConnectionError, Connection
+from qpid.messaging import Message, NotFound, ConnectionError, ReceiverError, Connection
 from qpid.datatypes import uuid4
 from brokertest import *
 from threading import Thread, Lock, Condition
 from logging import getLogger, WARN, ERROR, DEBUG
 from qpidtoollibs import BrokerAgent
 
-log = getLogger("qpid.ha-tests")
+log = getLogger(__name__)
 
 class HaBroker(Broker):
-    def __init__(self, test, args=[], broker_url=None, ha_cluster=True, **kwargs):
+    def __init__(self, test, args=[], broker_url=None, ha_cluster=True,
+                 ha_replicate="all", **kwargs):
         assert BrokerTest.ha_lib, "Cannot locate HA plug-in"
         args = copy(args)
-        args.extend(["--load-module", BrokerTest.ha_lib,
-                     # FIXME aconway 2012-02-13: workaround slow link failover.
-                     "--link-maintenace-interval=0.1",
-                     "--ha-cluster=%s"%ha_cluster])
+        args += ["--load-module", BrokerTest.ha_lib,
+                 "--log-enable=info+", "--log-enable=debug+:ha::",
+                 # FIXME aconway 2012-02-13: workaround slow link failover.
+                 "--link-maintenace-interval=0.1",
+                 "--ha-cluster=%s"%ha_cluster]
+        if ha_replicate is not None:
+            args += [ "--ha-replicate=%s"%ha_replicate ]
         if broker_url: args.extend([ "--ha-brokers", broker_url ])
         Broker.__init__(self, test, args, **kwargs)
         self.commands=os.getenv("PYTHON_COMMANDS")
         assert os.path.isdir(self.commands)
+        getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover.
 
     def promote(self):
         assert os.system("%s/qpid-ha promote -b %s"%(self.commands, self.host_port())) == 0
@@ -64,6 +69,23 @@ class HaBroker(Broker):
         assert os.system(
             "%s/qpid-config --broker=%s add queue %s --replicate %s"%(self.commands, self.host_port(), queue, replication)) == 0
 
+    def connect_admin(self, **kwargs):
+        return Broker.connect(self, client_properties={"qpid.ha-admin":1}, **kwargs)
+
+    def wait_backup(self, address):
+        """Wait for address to become valid on a backup broker."""
+        bs = self.connect_admin().session()
+        try: wait_address(bs, address)
+        finally: bs.connection.close()
+
+    def assert_browse_backup(self, queue, expected, **kwargs):
+        """Combines wait_backup and assert_browse_retry."""
+        bs = self.connect_admin().session()
+        try:
+            wait_address(bs, queue)
+            assert_browse_retry(bs, queue, expected, **kwargs)
+        finally: bs.connection.close()
+
 class HaCluster(object):
     _cluster_count = 0
 
@@ -72,9 +94,9 @@ class HaCluster(object):
         self.test = test
         self._brokers = [ HaBroker(test, name="broker%s-%s"%(HaCluster._cluster_count, i), **kwargs) for i in xrange(n)]
         HaCluster._cluster_count += 1
-        self[0].promote()
         self.url = ",".join([b.host_port() for b in self])
         for b in self: b.set_broker_url(self.url)
+        self[0].promote()
 
     def connect(self, i):
         """Connect with reconnect_urls"""
@@ -97,50 +119,29 @@ class HaCluster(object):
     def __getitem__(self,index): return self._brokers[index]
     def __iter__(self): return self._brokers.__iter__()
 
-
-def qr_node(value="all"): return "node:{x-declare:{arguments:{'qpid.replicate':%s}}}" % value
-
-class ShortTests(BrokerTest):
-    """Short HA functionality tests."""
-
-    # Wait for an address to become valid.
-    def wait(self, session, address):
-        def check():
-            try:
-                session.sender(address)
-                return True
-            except NotFound: return False
-        assert retry(check), "Timed out waiting for address %s"%(address)
-
-    # Wait for address to become valid on a backup broker.
-    def wait_backup(self, backup, address):
-        bs = self.connect_admin(backup).session()
-        self.wait(bs, address)
-        bs.connection.close()
-
-    # Combines wait_backup and assert_browse_retry
-    def assert_browse_backup(self, backup, queue, expected, **kwargs):
-        bs = self.connect_admin(backup).session()
-        self.wait(bs, queue)
-        self.assert_browse_retry(bs, queue, expected, **kwargs)
-        bs.connection.close()
-
-    def assert_missing(self, session, address):
+def wait_address(session, address):
+    """Wait for an address to become valid."""
+    def check():
         try:
-            session.receiver(address)
-            self.fail("Should not have been replicated: %s"%(address))
-        except NotFound: pass
+            session.sender(address)
+            return True
+        except NotFound: return False
+    assert retry(check), "Timed out waiting for address %s"%(address)
+
+def assert_missing(session, address):
+    """Assert that the address is _not_ valid"""
+    try:
+        session.receiver(address)
+        self.fail("Expected NotFound: %s"%(address))
+    except NotFound: pass
 
-    def connect_admin(self, backup, **kwargs):
-        """Connect to a backup broker as an admin connection"""
-        return backup.connect(client_properties={"qpid.ha-admin":1}, **kwargs)
+class ReplicationTests(BrokerTest):
+    """Correctness tests for  HA replication."""
 
     def test_replication(self):
         """Test basic replication of configuration and messages before and
         after backup has connected"""
 
-        getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover.
-
         def queue(name, replicate):
             return "%s;{create:always,node:{x-declare:{arguments:{'qpid.replicate':%s}}}}"%(name, replicate)
 
@@ -170,9 +171,8 @@ class ShortTests(BrokerTest):
 
         def verify(b, prefix, p):
             """Verify setup was replicated to backup b"""
-
             # Wait for configuration to replicate.
-            self.wait(b, prefix+"x");
+            wait_address(b, prefix+"x");
             self.assert_browse_retry(b, prefix+"q1", ["b", "1", "4"])
 
             self.assertEqual(p.receiver(prefix+"q1").fetch(timeout=0).content, "b")
@@ -180,7 +180,7 @@ class ShortTests(BrokerTest):
             self.assert_browse_retry(b, prefix+"q1", ["1", "4"])
 
             self.assert_browse_retry(b, prefix+"q2", []) # configuration only
-            self.assert_missing(b, prefix+"q3")
+            assert_missing(b, prefix+"q3")
             b.sender(prefix+"e1").send(Message(prefix+"e1")) # Verify binds with replicate=all
             self.assert_browse_retry(b, prefix+"q1", ["1", "4", prefix+"e1"])
             b.sender(prefix+"e2").send(Message(prefix+"e2")) # Verify binds with replicate=configuration
@@ -200,12 +200,12 @@ class ShortTests(BrokerTest):
         setup(p, "2", primary)
 
         # Verify the data on the backup
-        b = self.connect_admin(backup).session()
+        b = backup.connect_admin().session()
         verify(b, "1", p)
         verify(b, "2", p)
         # Test a series of messages, enqueue all then dequeue all.
         s = p.sender(queue("foo","all"))
-        self.wait(b, "foo")
+        wait_address(b, "foo")
         msgs = [str(i) for i in range(10)]
         for m in msgs: s.send(Message(m))
         self.assert_browse_retry(p, "foo", msgs)
@@ -227,12 +227,10 @@ class ShortTests(BrokerTest):
             self.assert_browse_retry(b, "foo", msgs[i+1:])
 
     def test_sync(self):
-        def queue(name, replicate):
-            return "%s;{create:always,%s}"%(name, qr_node(replicate))
         primary = HaBroker(self, name="primary")
         primary.promote()
         p = primary.connect().session()
-        s = p.sender(queue("q","all"))
+        s = p.sender("q;{create:always}")
         for m in [str(i) for i in range(0,10)]: s.send(m)
         s.sync()
         backup1 = HaBroker(self, name="backup1", broker_url=primary.host_port())
@@ -243,50 +241,39 @@ class ShortTests(BrokerTest):
         s.sync()
 
         msgs = [str(i) for i in range(30)]
-        b1 = self.connect_admin(backup1).session()
-        self.wait(b1, "q");
+        b1 = backup1.connect_admin().session()
+        wait_address(b1, "q");
         self.assert_browse_retry(b1, "q", msgs)
-        b2 = self.connect_admin(backup2).session()
-        self.wait(b2, "q");
+        b2 = backup2.connect_admin().session()
+        wait_address(b2, "q");
         self.assert_browse_retry(b2, "q", msgs)
 
     def test_send_receive(self):
         """Verify sequence numbers of messages sent by qpid-send"""
-        getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover.
-        primary = HaBroker(self, name="primary")
-        primary.promote()
-        backup1 = HaBroker(self, name="backup1", broker_url=primary.host_port())
-        backup2 = HaBroker(self, name="backup2", broker_url=primary.host_port())
+        brokers = HaCluster(self, 3)
         sender = self.popen(
             ["qpid-send",
-             "--broker", primary.host_port(),
-             "--address", "q;{create:always,%s}"%(qr_node("all")),
+             "--broker", brokers[0].host_port(),
+             "--address", "q;{create:always}",
              "--messages=1000",
              "--content-string=x"
              ])
         receiver = self.popen(
             ["qpid-receive",
-             "--broker", primary.host_port(),
-             "--address", "q;{create:always,%s}"%(qr_node("all")),
+             "--broker", brokers[0].host_port(),
+             "--address", "q;{create:always}",
              "--messages=990",
              "--timeout=10"
              ])
-        try:
-            self.assertEqual(sender.wait(), 0)
-            self.assertEqual(receiver.wait(), 0)
-            expect = [long(i) for i in range(991, 1001)]
-            sn = lambda m: m.properties["sn"]
-            self.assert_browse_retry(self.connect_admin(backup1).session(), "q", expect, transform=sn)
-            self.assert_browse_retry(self.connect_admin(backup2).session(), "q", expect, transform=sn)
-        except:
-            print self.browse(primary.connect().session(), "q", transform=sn)
-            print self.browse(self.connect_admin(backup1).session(), "q", transform=sn)
-            print self.browse(self.connect_admin(backup2).session(), "q", transform=sn)
-            raise
+        self.assertEqual(sender.wait(), 0)
+        self.assertEqual(receiver.wait(), 0)
+        expect = [long(i) for i in range(991, 1001)]
+        sn = lambda m: m.properties["sn"]
+        brokers[1].assert_browse_backup("q", expect, transform=sn)
+        brokers[2].assert_browse_backup("q", expect, transform=sn)
 
     def test_failover_python(self):
         """Verify that backups rejects connections and that fail-over works in python client"""
-        getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover.
         primary = HaBroker(self, name="primary", expect=EXPECT_EXIT_FAIL)
         primary.promote()
         backup = HaBroker(self, name="backup", broker_url=primary.host_port())
@@ -296,13 +283,13 @@ class ShortTests(BrokerTest):
             self.fail("Expected connection to backup to fail")
         except ConnectionError: pass
         # Check that admin connections are allowed to backup.
-        self.connect_admin(backup).close()
+        backup.connect_admin().close()
 
         # Test discovery: should connect to primary after reject by backup
         c = backup.connect(reconnect_urls=[primary.host_port(), backup.host_port()], reconnect=True)
         s = c.session()
-        sender = s.sender("q;{create:always,%s}"%(qr_node()))
-        self.wait_backup(backup, "q")
+        sender = s.sender("q;{create:always}")
+        backup.wait_backup("q")
         sender.send("foo")
         primary.kill()
         assert retry(lambda: not is_running(primary.pid))
@@ -316,14 +303,14 @@ class ShortTests(BrokerTest):
         primary.promote()
         backup = HaBroker(self, name="backup", broker_url=primary.host_port())
         url="%s,%s"%(primary.host_port(), backup.host_port())
-        primary.connect().session().sender("q;{create:always,%s}"%(qr_node()))
-        self.wait_backup(backup, "q")
+        primary.connect().session().sender("q;{create:always}")
+        backup.wait_backup("q")
 
         sender = NumberedSender(primary, url=url, queue="q", failover_updates = False)
         receiver = NumberedReceiver(primary, url=url, queue="q", failover_updates = False)
         receiver.start()
         sender.start()
-        self.wait_backup(backup, "q")
+        backup.wait_backup("q")
         assert retry(lambda: receiver.received > 10) # Wait for some messages to get thru
 
         primary.kill()
@@ -337,109 +324,107 @@ class ShortTests(BrokerTest):
     def test_backup_failover(self):
         """Verify that a backup broker fails over and recovers queue state"""
         brokers = HaCluster(self, 3)
-        brokers[0].connect().session().sender(
-            "q;{create:always,%s}"%(qr_node())).send("a")
-        for b in brokers[1:]: self.assert_browse_backup(b, "q", ["a"])
+        brokers[0].connect().session().sender("q;{create:always}").send("a")
+        for b in brokers[1:]: b.assert_browse_backup("q", ["a"], msg=b)
         brokers[0].expect = EXPECT_EXIT_FAIL
         brokers.kill(0)
         brokers[1].connect().session().sender("q").send("b")
-        self.assert_browse_backup(brokers[2], "q", ["a","b"])
+        brokers[2].assert_browse_backup("q", ["a","b"])
         s = brokers[1].connect().session()
         self.assertEqual("a", s.receiver("q").fetch().content)
         s.acknowledge()
-        self.assert_browse_backup(brokers[2], "q", ["b"])
+        brokers[2].assert_browse_backup("q", ["b"])
 
     def test_qpid_config_replication(self):
         """Set up replication via qpid-config"""
         brokers = HaCluster(self,2)
         brokers[0].config_declare("q","all")
         brokers[0].connect().session().sender("q").send("foo")
-        self.assert_browse_backup(brokers[1], "q", ["foo"])
+        brokers[1].assert_browse_backup("q", ["foo"])
 
     def test_standalone_queue_replica(self):
         """Test replication of individual queues outside of cluster mode"""
-        getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover.
-        primary = HaBroker(self, name="primary", ha_cluster=False, args=["--log-enable=debug+"])
+        primary = HaBroker(self, name="primary", ha_cluster=False)
         pc = primary.connect()
         ps = pc.session().sender("q;{create:always}")
         pr = pc.session().receiver("q;{create:always}")
-        backup = HaBroker(self, name="backup", ha_cluster=False, args=["--log-enable=debug+"])
+        backup = HaBroker(self, name="backup", ha_cluster=False)
         br = backup.connect().session().receiver("q;{create:always}")
 
         # Set up replication with qpid-ha
         backup.replicate(primary.host_port(), "q")
         ps.send("a")
-        self.assert_browse_backup(backup, "q", ["a"])
+        backup.assert_browse_backup("q", ["a"])
         ps.send("b")
-        self.assert_browse_backup(backup, "q", ["a", "b"])
+        backup.assert_browse_backup("q", ["a", "b"])
         self.assertEqual("a", pr.fetch().content)
         pr.session.acknowledge()
-        self.assert_browse_backup(backup, "q", ["b"])
+        backup.assert_browse_backup("q", ["b"])
 
         # Set up replication with qpid-config
         ps2 = pc.session().sender("q2;{create:always}")
         backup.config_replicate(primary.host_port(), "q2");
         ps2.send("x")
-        self.assert_browse_backup(backup, "q2", ["x"])
+        backup.assert_browse_backup("q2", ["x"])
 
 
     def test_queue_replica_failover(self):
         """Test individual queue replication from a cluster to a standalone backup broker, verify it fails over."""
-        getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover.
         cluster = HaCluster(self, 2)
         primary = cluster[0]
         pc = cluster.connect(0)
-        ps = pc.session().sender("q;{create:always,%s}"%qr_node("all"))
-        pr = pc.session().receiver("q;{create:always,%s}"%qr_node("all"))
-        backup = HaBroker(self, name="backup", ha_cluster=False, args=["--log-enable=debug+"])
+        ps = pc.session().sender("q;{create:always}")
+        pr = pc.session().receiver("q;{create:always}")
+        backup = HaBroker(self, name="backup", ha_cluster=False)
         br = backup.connect().session().receiver("q;{create:always}")
         backup.replicate(cluster.url, "q")
         ps.send("a")
-        self.assert_browse_backup(backup, "q", ["a"])
+        backup.assert_browse_backup("q", ["a"])
         cluster.bounce(0)
-        self.assert_browse_backup(backup, "q", ["a"])
+        backup.assert_browse_backup("q", ["a"])
         ps.send("b")
-        self.assert_browse_backup(backup, "q", ["a", "b"])
+        backup.assert_browse_backup("q", ["a", "b"])
         cluster.bounce(1)
         self.assertEqual("a", pr.fetch().content)
         pr.session.acknowledge()
-        self.assert_browse_backup(backup, "q", ["b"])
+        backup.assert_browse_backup("q", ["b"])
 
     def test_lvq(self):
         """Verify that we replicate to an LVQ correctly"""
         primary  = HaBroker(self, name="primary")
         primary.promote()
         backup = HaBroker(self, name="backup", broker_url=primary.host_port())
-        s = primary.connect().session().sender("lvq; {create:always, node:{x-declare:{arguments:{'qpid.last_value_queue_key':lvq-key, 'qpid.replicate':all}}}}")
+        s = primary.connect().session().sender("lvq; {create:always, node:{x-declare:{arguments:{'qpid.last_value_queue_key':lvq-key}}}}")
         def send(key,value): s.send(Message(content=value,properties={"lvq-key":key}))
         for kv in [("a","a-1"),("b","b-1"),("a","a-2"),("a","a-3"),("c","c-1"),("c","c-2")]:
             send(*kv)
-        self.assert_browse_backup(backup, "lvq", ["b-1", "a-3", "c-2"])
+        backup.assert_browse_backup("lvq", ["b-1", "a-3", "c-2"])
         send("b","b-2")
-        self.assert_browse_backup(backup, "lvq", ["a-3", "c-2", "b-2"])
+        backup.assert_browse_backup("lvq", ["a-3", "c-2", "b-2"])
         send("c","c-3")
-        self.assert_browse_backup(backup, "lvq", ["a-3", "b-2", "c-3"])
+        backup.assert_browse_backup("lvq", ["a-3", "b-2", "c-3"])
         send("d","d-1")
-        self.assert_browse_backup(backup, "lvq", ["a-3", "b-2", "c-3", "d-1"])
+        backup.assert_browse_backup("lvq", ["a-3", "b-2", "c-3", "d-1"])
 
     def test_ring(self):
+        """Test replication with the ring queue policy"""
         primary  = HaBroker(self, name="primary")
         primary.promote()
         backup = HaBroker(self, name="backup", broker_url=primary.host_port())
-        s = primary.connect().session().sender("q; {create:always, node:{x-declare:{arguments:{'qpid.policy_type':ring, 'qpid.max_count':5, 'qpid.replicate':all}}}}")
+        s = primary.connect().session().sender("q; {create:always, node:{x-declare:{arguments:{'qpid.policy_type':ring, 'qpid.max_count':5}}}}")
         for i in range(10): s.send(Message(str(i)))
-        self.assert_browse_backup(backup, "q", [str(i) for i in range(5,10)])
+        backup.assert_browse_backup("q", [str(i) for i in range(5,10)])
 
     def test_reject(self):
-        getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover.
+        """Test replication with the reject queue policy"""
         primary  = HaBroker(self, name="primary")
         primary.promote()
         backup = HaBroker(self, name="backup", broker_url=primary.host_port())
-        s = primary.connect().session().sender("q; {create:always, node:{x-declare:{arguments:{'qpid.policy_type':reject, 'qpid.max_count':5, 'qpid.replicate':all}}}}")
+        s = primary.connect().session().sender("q; {create:always, node:{x-declare:{arguments:{'qpid.policy_type':reject, 'qpid.max_count':5}}}}")
         try:
             for i in range(10): s.send(Message(str(i)), sync=False)
         except qpid.messaging.exceptions.TargetCapacityExceeded: pass
-        self.assert_browse_backup(backup, "q", [str(i) for i in range(0,5)])
+        backup.assert_browse_backup("q", [str(i) for i in range(0,5)])
 
     def test_priority(self):
         """Verify priority queues replicate correctly"""
@@ -447,12 +432,12 @@ class ShortTests(BrokerTest):
         primary.promote()
         backup = HaBroker(self, name="backup", broker_url=primary.host_port())
         session = primary.connect().session()
-        s = session.sender("priority-queue; {create:always, node:{x-declare:{arguments:{'qpid.priorities':10, 'qpid.replicate':all}}}}")
+        s = session.sender("priority-queue; {create:always, node:{x-declare:{arguments:{'qpid.priorities':10}}}}")
         priorities = [8,9,5,1,2,2,3,4,9,7,8,9,9,2]
         for p in priorities: s.send(Message(priority=p))
         # Can't use browse_backup as browser sees messages in delivery order not priority.
-        self.wait_backup(backup, "priority-queue")
-        r = self.connect_admin(backup).session().receiver("priority-queue")
+        backup.wait_backup("priority-queue")
+        r = backup.connect_admin().session().receiver("priority-queue")
         received = [r.fetch().priority for i in priorities]
         self.assertEqual(sorted(priorities, reverse=True), received)
 
@@ -466,11 +451,11 @@ class ShortTests(BrokerTest):
         priorities = [4,5,3,7,8,8,2,8,2,8,8,16,6,6,6,6,6,6,8,3,5,8,3,5,5,3,3,8,8,3,7,3,7,7,7,8,8,8,2,3]
         limits={7:0,6:4,5:3,4:2,3:2,2:2,1:2}
         limit_policy = ",".join(["'qpid.fairshare':5"] + ["'qpid.fairshare-%s':%s"%(i[0],i[1]) for i in limits.iteritems()])
-        s = session.sender("priority-queue; {create:always, node:{x-declare:{arguments:{'qpid.priorities':%s, %s, 'qpid.replicate':all}}}}"%(levels,limit_policy))
+        s = session.sender("priority-queue; {create:always, node:{x-declare:{arguments:{'qpid.priorities':%s, %s}}}}"%(levels,limit_policy))
         messages = [Message(content=str(uuid4()), priority = p) for p in priorities]
         for m in messages: s.send(m)
-        self.wait_backup(backup, s.target)
-        r = self.connect_admin(backup).session().receiver("priority-queue")
+        backup.wait_backup(s.target)
+        r = backup.connect_admin().session().receiver("priority-queue")
         received = [r.fetch().content for i in priorities]
         sort = sorted(messages, key=lambda m: priority_level(m.priority, levels), reverse=True)
         fair = [m.content for m in fairshare(sort, lambda l: limits.get(l,0), levels)]
@@ -480,16 +465,99 @@ class ShortTests(BrokerTest):
         primary  = HaBroker(self, name="primary")
         primary.promote()
         backup = HaBroker(self, name="backup", broker_url=primary.host_port())
-        s = primary.connect().session().sender("q; {create:always, node:{x-declare:{arguments:{'qpid.policy_type':ring, 'qpid.max_count':5, 'qpid.priorities':10, 'qpid.replicate':all}}}}")
+        s = primary.connect().session().sender("q; {create:always, node:{x-declare:{arguments:{'qpid.policy_type':ring, 'qpid.max_count':5, 'qpid.priorities':10}}}}")
         priorities = [8,9,5,1,2,2,3,4,9,7,8,9,9,2]
         for p in priorities: s.send(Message(priority=p))
-        # FIXME aconway 2012-02-22: there is a bug in priority ring queues that allows a low
-        # priority message to displace a high one. The following commented-out assert_browse
-        # is for the correct result, the uncommented one is for the actualy buggy result.
-        # See https://issues.apache.org/jira/browse/QPID-3866
+
+        # FIXME aconway 2012-02-22: there is a bug in priority ring
+        # queues that allows a low priority message to displace a high
+        # one. The following commented-out assert_browse is for the
+        # correct result, the uncommented one is for the actualy buggy
+        # result.  See https://issues.apache.org/jira/browse/QPID-3866
         #
-        # self.assert_browse_backup(backup, "q", sorted(priorities,reverse=True)[0:5], transform=lambda m: m.priority)
-        self.assert_browse_backup(backup, "q", [9,9,9,9,2], transform=lambda m: m.priority)
+        # backup.assert_browse_backup("q", sorted(priorities,reverse=True)[0:5], transform=lambda m: m.priority)
+        backup.assert_browse_backup("q", [9,9,9,9,2], transform=lambda m: m.priority)
+
+    def test_backup_acquired(self):
+        """Verify that acquired messages are backed up, for all queue types."""
+        class Test:
+            def __init__(self, queue, arguments, expect):
+                self.queue = queue
+                self.address = "%s;{create:always,node:{x-declare:{arguments:{%s}}}}"%(
+                    self.queue, ",".join(arguments + ["'qpid.replicate':all"]))
+                self.expect = [str(i) for i in expect]
+
+            def send(self, connection):
+                """Send messages, then acquire one but don't acknowledge"""
+                s = connection.session()
+                for m in range(10): s.sender(self.address).send(str(m))
+                s.receiver(self.address).fetch()
+
+            def wait(self, brokertest, backup):
+                backup.wait_backup(self.queue)
+
+            def verify(self, brokertest, backup):
+                backup.assert_browse_backup(self.queue, self.expect, msg=self.queue)
+
+        tests = [
+            Test("plain",[],range(10)),
+            Test("ring", ["'qpid.policy_type':ring", "'qpid.max_count':5"], range(5,10)),
+            Test("priority",["'qpid.priorities':10"], range(10)),
+            Test("fairshare", ["'qpid.priorities':10,'qpid.fairshare':5"], range(10)),
+            Test("lvq", ["'qpid.last_value_queue_key':lvq-key"], [9])
+            ]
+
+        primary  = HaBroker(self, name="primary")
+        primary.promote()
+        backup1 = HaBroker(self, name="backup1", broker_url=primary.host_port())
+        c = primary.connect()
+        for t in tests: t.send(c) # Send messages, leave one unacknowledged.
+
+        backup2 = HaBroker(self, name="backup2", broker_url=primary.host_port())
+        # Wait for backups to catch up.
+        for t in tests:
+            t.wait(self, backup1)
+            t.wait(self, backup2)
+        # Verify acquired message was replicated
+        for t in tests: t.verify(self, backup1)
+        for t in tests: t.verify(self, backup2)
+
+    def test_replicate_default(self):
+        """Make sure we don't replicate if ha-replicate is unspecified or none"""
+        cluster1 = HaCluster(self, 2, ha_replicate=None)
+        c1 = cluster1[0].connect().session().sender("q;{create:always}")
+        cluster2 = HaCluster(self, 2, ha_replicate="none")
+        cluster2[0].connect().session().sender("q;{create:always}")
+        time.sleep(.1)               # Give replication a chance.
+        try:
+            cluster1[1].connect_admin().session().receiver("q")
+            self.fail("Excpected no-such-queue exception")
+        except NotFound: pass
+        try:
+            cluster2[1].connect_admin().session().receiver("q")
+            self.fail("Excpected no-such-queue exception")
+        except NotFound: pass
+
+    def test_invalid_default(self):
+        """Verify that a queue with an invalid qpid.replicate gets default treatment"""
+        cluster = HaCluster(self, 2, ha_replicate="all")
+        c = cluster[0].connect().session().sender("q;{create:always, node:{x-declare:{arguments:{'qpid.replicate':XXinvalidXX}}}}")
+        cluster[1].wait_backup("q")
+
+    def test_exclusive_queue(self):
+        """Ensure that we can back-up exclusive queues, i.e. the replicating
+        subscriptions are exempt from the exclusivity"""
+        cluster = HaCluster(self, 2)
+        def test(addr):
+            c = cluster[0].connect()
+            q = addr.split(";")[0]
+            r = c.session().receiver(addr)
+            try: c.session().receiver(addr); self.fail("Expected exclusive exception")
+            except ReceiverError: pass
+            s = c.session().sender(q).send(q)
+            cluster[1].assert_browse_backup(q, [q])
+        test("excl_sub;{create:always, link:{x-subscribe:{exclusive:True}}}");
+        test("excl_queue;{create:always, node:{x-declare:{exclusive:True}}}")
 
 def fairshare(msgs, limit, levels):
     """

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/ipv6_test
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/ipv6_test?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/ipv6_test (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/ipv6_test Wed May  2 13:09:18 2012
@@ -113,7 +113,8 @@ fi
 test -z $CLUSTER_LIB && exit 0	# Exit if cluster not supported.
 
 ## Test failover in a cluster using IPv6 only
-. $srcdir/ais_check		# Will exit if clustering not enabled.
+. cpg_check.sh
+cpg_enabled || exit 0
 
 pick_port() {
     # We need a fixed port to set --cluster-url. Use qpidd to pick a free port.

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/qpid-cluster-benchmark
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/qpid-cluster-benchmark?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/qpid-cluster-benchmark (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/qpid-cluster-benchmark Wed May  2 13:09:18 2012
@@ -22,38 +22,45 @@
 
 # Default options
 MESSAGES="-m 10000"
-FLOW="--flow-control 100"	      # Flow control limit on queue depth for latency.
 REPEAT="--repeat 10"
 QUEUES="-q 6"
 SENDERS="-s 3"
 RECEIVERS="-r 3"
 BROKERS=			# Local broker
 CLIENT_HOSTS=			# No ssh, all clients are local
+# Connection options
+TCP_NODELAY=false
+RECONNECT=true
+HEARTBEAT=1
 
-while getopts "m:f:n:b:q:s:r:c:txyv-" opt; do
+while getopts "m:f:n:b:q:s:r:c:h:i:txyv-" opt; do
     case $opt in
+	b) BROKERS="-b $OPTARG";;
+	c) CLIENT_HOSTS="-c $OPTARG";;
+	h) HEARTBEAT=$OPTARG;;
+	i) RECONNECT=$OPTARG;;
 	m) MESSAGES="-m $OPTARG";;
-	f) FLOW="--flow-control $OPTARG";;
 	n) REPEAT="--repeat $OPTARG";;
-	b) BROKERS="-b $OPTARG";;
 	q) QUEUES="-q $OPTARG";;
-	s) SENDERS="-s $OPTARG";;
 	r) RECEIVERS="-r $OPTARG";;
-	c) CLIENT_HOSTS="-c $OPTARG";;
-	t) TCP_NODELAY="--connection-options {tcp-nodelay:true}";;
+	s) SENDERS="-s $OPTARG";;
+	t) TCP_NODELAY=true;;
+	v) OPTS="--verbose";;
 	x) SAVE_RECEIVED="--save-received";;
 	y) NO_DELETE="--no-delete";;
-	v) OPTS="--verbose";;
 	-) break ;;
 	*) echo "Unknown option"; exit 1;;
     esac
 done
 shift $(($OPTIND-1))
 
-REPLICATE="node:{x-declare:{arguments:{'qpid.replicate':all}}}"
+CONNECTION_OPTIONS="--connection-options {tcp-nodelay:$TCP_NODELAY,reconnect:$RECONNECT,heartbeat:$HEARTBEAT}"
+CREATE_OPTIONS="node:{x-declare:{arguments:{'qpid.replicate':all}}}"
+
 BROKER=$(echo $BROKERS | sed s/,.*//)
 run_test() { echo $*; shift; "$@"; echo; echo; echo; }
 
-OPTS="$OPTS $REPEAT $BROKERS --summarize $QUEUES $SENDERS $RECEIVERS $MESSAGES $CLIENT_HOSTS $SAVE_RECEIVED $TCP_NODELAY $NO_DELETE"
-OPTS="$OPTS --create-option $REPLICATE"
+OPTS="$OPTS $REPEAT $BROKERS --summarize $QUEUES $SENDERS $RECEIVERS $MESSAGES $CLIENT_HOSTS $SAVE_RECEIVED $CONNECTION_OPTIONS $NO_DELETE"
+OPTS="$OPTS --create-option $CREATE_OPTIONS"
+
 run_test "Benchmark:" qpid-cpp-benchmark $OPTS "$@"

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/qpid-cpp-benchmark
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/qpid-cpp-benchmark?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/qpid-cpp-benchmark (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/qpid-cpp-benchmark Wed May  2 13:09:18 2012
@@ -37,7 +37,7 @@ op.add_option("-r", "--receivers", defau
 op.add_option("-m", "--messages", default=100000, type="int", metavar="N",
               help="send N messages per sender (default %default)")
 op.add_option("--queue-name", default="benchmark", metavar="NAME",
-               help="base name for queues (default %default)")
+              help="base name for queues (default %default)")
 op.add_option("--send-rate", default=0, metavar="N",
               help="send rate limited to N messages/second, 0 means no limit (default %default)")
 op.add_option("--receive-rate", default=0, metavar="N",
@@ -67,18 +67,16 @@ op.add_option("--sequence", dest="sequen
               action="store_true", help="add a sequence number to each message")
 op.add_option("--connection-options", type="str",
               help="Connection options for senders & receivers")
-op.add_option("--flow-control", default=0, type="int", metavar="N",
-              help="Flow control each sender to limit queue depth to 2*N. 0 means no flow control.")
 op.add_option("--durable", default=False, action="store_true",
               help="Use durable queues and messages")
 op.add_option("--save-received", default=False, action="store_true",
               help="Save received message content to files <queuename>-receiver-<n>.msg")
-op.add_option("--group-receivers", default=False, action="store_true",
-              help="Run receivers for the same queue on the same host.")
 op.add_option("--verbose", default=False, action="store_true",
               help="Show commands executed")
 op.add_option("--no-delete", default=False, action="store_true",
               help="Don't delete the test queues.")
+op.add_option("--fill-drain", default=False, action="store_true",
+              help="First fill the queues, then drain them")
 
 single_quote_re = re.compile("'")
 def posix_quote(string):
@@ -150,7 +148,6 @@ def start_send(queue, opts, broker, host
                "--report-header=no",
                "--timestamp=%s"%(opts.timestamp and "yes" or "no"),
                "--sequence=%s"%(opts.sequence and "yes" or "no"),
-               "--flow-control", str(opts.flow_control),
                "--durable", str(opts.durable)
                ]
     command += opts.send_arg
@@ -169,18 +166,6 @@ def first_line(p):
         raise Exception("Process exit %d: %s"%(p.returncode, error_msg(out,err)))
     return out.split("\n")[0]
 
-def queue_exists(queue,broker):
-    c = qpid.messaging.Connection(broker)
-    c.open()
-    try:
-        s = c.session()
-        try:
-            s.sender(queue)
-            return True
-        except qpid.messaging.exceptions.NotFound:
-            return False
-    finally: c.close()
-
 def recreate_queues(queues, brokers, no_delete, opts):
     c = qpid.messaging.Connection(brokers[0])
     c.open()
@@ -189,15 +174,9 @@ def recreate_queues(queues, brokers, no_
         if not no_delete:
             try: s.sender("%s;{delete:always}"%(q)).close()
             except qpid.messaging.exceptions.NotFound: pass
-            # FIXME aconway 2011-05-04: new cluster async wiring, wait for changes to propagate
-            for b in brokers:
-                while queue_exists(q,b): time.sleep(0.1);
         address = "%s;{%s}"%(q, ",".join(opts.create_option + ["create:always"]))
         if opts.verbose: print "Creating", address
         s.sender(address)
-        # FIXME aconway 2011-05-04: new cluster async wiring, wait for changes to propagate
-        for b in brokers:
-            while not queue_exists(q,b): time.sleep(0.1);
     c.close()
 
 def print_header(timestamp):
@@ -295,24 +274,32 @@ def main():
             recreate_queues(queues, opts.broker, opts.no_delete, opts)
             ready_receiver = ReadyReceiver(ready_queue, opts.broker[0])
 
-            if opts.group_receivers: # Run receivers for same queue against same broker.
-                receivers = []
-                for q in queues:
-                    b = brokers.next()
-                    for j in xrange(opts.receivers):
-                        receivers.append(
-                            start_receive(q, j, opts, ready_queue, b, client_hosts.next()))
-            else:                       # Don't group receivers
-                receivers = [start_receive(q, j, opts, ready_queue,
-                                           brokers.next(), client_hosts.next())
-                             for q in queues for j in xrange(opts.receivers)]
-
-            ready_receiver.wait(filter(None, receivers)) # Wait for receivers to be ready.
-            start = time.time()
-            senders = [start_send(q, opts,brokers.next(), client_hosts.next())
-                       for q in queues for j in xrange(opts.senders)]
+            def start_receivers():
+                return [ start_receive(q, j, opts, ready_queue, brokers.next(), client_hosts.next())
+                         for q in queues for j in xrange(opts.receivers) ]
+
+
+            def start_senders():
+                return  [ start_send(q, opts,brokers.next(), client_hosts.next())
+                          for q in queues for j in xrange(opts.senders) ]
+
             if opts.report_header and i == 0: print_header(opts.timestamp)
-            for p in senders + receivers: p.wait()
+
+            if opts.fill_drain:
+                # First fill the queues, then drain them
+                start = time.time()
+                senders = start_senders()
+                for p in senders: p.wait()
+                receivers = start_receivers()
+                for p in receivers: p.wait()
+            else:
+                # Run senders and receivers in parallel
+                receivers = start_receivers()
+                ready_receiver.wait(filter(None, receivers)) # Wait for receivers ready
+                start = time.time()
+                senders = start_senders()
+                for p in senders + receivers: p.wait()
+
             total_sent = opts.queues * opts.senders * opts.messages
             total_tp = total_sent / (time.time()-start)
             send_stats=parse_senders(senders)

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/qpid-send.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/qpid-send.cpp?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/qpid-send.cpp (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/qpid-send.cpp Wed May  2 13:09:18 2012
@@ -85,7 +85,6 @@ struct Options : public qpid::Options
     uint reportEvery;
     bool reportHeader;
     uint sendRate;
-    uint flowControl;
     bool sequence;
     bool timestamp;
     std::string groupKey;
@@ -115,7 +114,6 @@ struct Options : public qpid::Options
           reportEvery(0),
           reportHeader(true),
           sendRate(0),
-          flowControl(0),
           sequence(true),
           timestamp(true),
           groupPrefix("GROUP-"),
@@ -149,7 +147,6 @@ struct Options : public qpid::Options
             ("report-every", qpid::optValue(reportEvery,"N"), "Report throughput statistics every N messages")
             ("report-header", qpid::optValue(reportHeader, "yes|no"), "Headers on report.")
             ("send-rate", qpid::optValue(sendRate,"N"), "Send at rate of N messages/second. 0 means send as fast as possible.")
-            ("flow-control", qpid::optValue(flowControl,"N"), "Do end to end flow control to limit queue depth to 2*N. 0 means no flow control.")
             ("sequence", qpid::optValue(sequence, "yes|no"), "Add a sequence number messages property (required for duplicate/lost message detection)")
             ("timestamp", qpid::optValue(timestamp, "yes|no"), "Add a time stamp messages property (required for latency measurement)")
             ("group-key", qpid::optValue(groupKey, "KEY"), "Generate groups of messages using message header 'KEY' to hold the group identifier")
@@ -371,8 +368,6 @@ int main(int argc, char ** argv)
                 msg.setPriority(opts.priority);
             }
             if (!opts.replyto.empty()) {
-                if (opts.flowControl)
-                    throw Exception("Can't use reply-to and flow-control together");
                 msg.setReplyTo(Address(opts.replyto));
             }
             if (!opts.userid.empty()) msg.setUserId(opts.userid);
@@ -406,26 +401,10 @@ int main(int argc, char ** argv)
             int64_t interval = 0;
             if (opts.sendRate) interval = qpid::sys::TIME_SEC/opts.sendRate;
 
-            Receiver flowControlReceiver;
-            Address flowControlAddress("flow-"+Uuid(true).str()+";{create:always,delete:always}");
-            uint flowSent = 0;
-            if (opts.flowControl) {
-                flowControlReceiver = session.createReceiver(flowControlAddress);
-                flowControlReceiver.setCapacity(2);
-            }
-
             while (contentGen->setContent(msg)) {
                 ++sent;
                 if (opts.sequence)
                     msg.getProperties()[SN] = sent;
-                if (opts.flowControl) {
-                    if ((sent % opts.flowControl) == 0) {
-                        msg.setReplyTo(flowControlAddress);
-                        ++flowSent;
-                    }
-                    else
-                        msg.setReplyTo(Address()); // Clear the reply address.
-                }
                 if (groupGen.get())
                     groupGen->setGroupInfo(msg);
 
@@ -444,19 +423,12 @@ int main(int argc, char ** argv)
                 }
                 if (opts.messages && sent >= opts.messages) break;
 
-                if (opts.flowControl && flowSent == 2) {
-                    flowControlReceiver.get(Duration::SECOND);
-                    --flowSent;
-                }
-
                 if (opts.sendRate) {
                     qpid::sys::AbsTime waitTill(start, sent*interval);
                     int64_t delay = qpid::sys::Duration(qpid::sys::now(), waitTill);
                     if (delay > 0) qpid::sys::usleep(delay/qpid::sys::TIME_USEC);
                 }
             }
-            for ( ; flowSent>0; --flowSent)
-                flowControlReceiver.get(Duration::SECOND);
             if (opts.reportTotal) reporter.report();
             for (uint i = opts.sendEos; i > 0; --i) {
                 if (opts.sequence)

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/qpid-txtest.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/qpid-txtest.cpp?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/qpid-txtest.cpp (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/qpid-txtest.cpp Wed May  2 13:09:18 2012
@@ -33,6 +33,7 @@
 #include "qpid/client/SubscriptionManager.h"
 #include "qpid/framing/Array.h"
 #include "qpid/framing/Buffer.h"
+#include "qpid/framing/FieldValue.h"
 #include "qpid/framing/Uuid.h"
 #include "qpid/sys/Thread.h"
 
@@ -245,10 +246,10 @@ struct Controller : public Client
 
         // Recover DTX transactions (if any)
         if (opts.dtx) {
-            std::vector<std::string> inDoubtXids;
             framing::DtxRecoverResult dtxRes = session.dtxRecover().get();
             const framing::Array& xidArr = dtxRes.getInDoubt();
-            xidArr.collect(inDoubtXids);
+            std::vector<std::string> inDoubtXids(xidArr.size());
+            std::transform(xidArr.begin(), xidArr.end(), inDoubtXids.begin(), framing::Array::get<std::string, framing::Array::ValuePtr>);
 
             if (inDoubtXids.size()) {
                 if (!opts.quiet) std::cout << "Recovering DTX in-doubt transaction(s):" << std::endl;

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/run_acl_tests
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/run_acl_tests?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/run_acl_tests (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/run_acl_tests Wed May  2 13:09:18 2012
@@ -22,16 +22,24 @@
 # Run the acl tests. $srcdir is set by the Makefile.
 source ./test_env.sh
 DATA_DIR=`pwd`/data_dir
+DATA_DIRI=`pwd`/data_diri
+DATA_DIRU=`pwd`/data_diru
 
 trap stop_brokers INT TERM QUIT
 
 start_brokers() {
-    ../qpidd --daemon --port 0 --no-module-dir --data-dir $DATA_DIR --load-module $ACL_LIB --acl-file policy.acl --auth no > qpidd.port
+    ../qpidd --daemon --port 0 --no-module-dir --data-dir $DATA_DIR --load-module $ACL_LIB --acl-file policy.acl --auth no --log-to-file local.log > qpidd.port
     LOCAL_PORT=`cat qpidd.port`
+    ../qpidd --daemon --port 0 --no-module-dir --data-dir $DATA_DIRI --load-module $ACL_LIB --acl-file policy.acl --auth no --acl-max-connect-per-ip 2 --log-to-file locali.log > qpiddi.port
+    LOCAL_PORTI=`cat qpiddi.port`
+    ../qpidd --daemon --port 0 --no-module-dir --data-dir $DATA_DIRU --load-module $ACL_LIB --acl-file policy.acl --auth no --acl-max-connect-per-user 2 --log-to-file localu.log > qpiddu.port
+    LOCAL_PORTU=`cat qpiddu.port`
 }
 
 stop_brokers() {
         $QPIDD_EXEC --no-module-dir -q --port $LOCAL_PORT
+        $QPIDD_EXEC --no-module-dir -q --port $LOCAL_PORTI
+        $QPIDD_EXEC --no-module-dir -q --port $LOCAL_PORTU
 }
 
 test_loading_acl_from_absolute_path(){
@@ -49,14 +57,22 @@ test_loading_acl_from_absolute_path(){
 
 if test -d ${PYTHON_DIR} ;  then
     rm -rf $DATA_DIR
+    rm -rf $DATA_DIRI
+    rm -rf $DATA_DIRU
     mkdir -p $DATA_DIR
+    mkdir -p $DATA_DIRI
+    mkdir -p $DATA_DIRU
     cp $srcdir/policy.acl $DATA_DIR
+    cp $srcdir/policy.acl $DATA_DIRI
+    cp $srcdir/policy.acl $DATA_DIRU
     start_brokers
-    echo "Running acl tests using brokers on ports $LOCAL_PORT"
-    $QPID_PYTHON_TEST -b localhost:$LOCAL_PORT -m acl || EXITCODE=1
+    echo "Running acl tests using brokers on ports $LOCAL_PORT, $LOCAL_PORTI, and $LOCAL_PORTU"
+    $QPID_PYTHON_TEST -b localhost:$LOCAL_PORT -m acl -Dport-i=$LOCAL_PORTI -Dport-u=$LOCAL_PORTU || EXITCODE=1
     stop_brokers || EXITCODE=1
     test_loading_acl_from_absolute_path || EXITCODE=1
     rm -rf $DATA_DIR
+    rm -rf $DATA_DIRI
+    rm -rf $DATA_DIRU
     exit $EXITCODE
 fi
 

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/run_cluster_authentication_soak
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/run_cluster_authentication_soak?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/run_cluster_authentication_soak (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/run_cluster_authentication_soak Wed May  2 13:09:18 2012
@@ -19,8 +19,9 @@
 
 
 source ./test_env.sh
-source $srcdir/ais_check
 source sasl_test_setup.sh
+source cpg_check.sh
+cpg_enabled || exit 0
 
 with_ais_group ./cluster_authentication_soak 500
 

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/run_cluster_authentication_test
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/run_cluster_authentication_test?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/run_cluster_authentication_test (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/run_cluster_authentication_test Wed May  2 13:09:18 2012
@@ -19,8 +19,9 @@
 
 
 source ./test_env.sh
-source $srcdir/ais_check
 source sasl_test_setup.sh
+source cpg_check.sh
+cpg_enabled || exit 0
 
 with_ais_group ./cluster_authentication_soak 
 

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/run_cluster_test
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/run_cluster_test?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/run_cluster_test (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/run_cluster_test Wed May  2 13:09:18 2012
@@ -22,5 +22,6 @@
 
 # Run the tests
 srcdir=`dirname $0`
-. $srcdir/ais_check
+source cpg_check.sh
+cpg_enabled || exit 0
 with_ais_group $srcdir/run_test ./cluster_test

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/run_cluster_tests
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/run_cluster_tests?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/run_cluster_tests (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/run_cluster_tests Wed May  2 13:09:18 2012
@@ -20,7 +20,9 @@
 #
 
 source ./test_env.sh
-source $srcdir/ais_check
+source cpg_check.sh
+cpg_enabled || exit 0
+
 
 test -x  $QPID_PYTHON_TEST || { echo Skipping test, $QPID_PYTHON_TEST not found; exit 0; }
 

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/run_failover_soak
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/run_failover_soak?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/run_failover_soak (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/run_failover_soak Wed May  2 13:09:18 2012
@@ -20,7 +20,8 @@
 #
 
 source ./test_env.sh
-. $srcdir/ais_check
+source cpg_check.sh
+cpg_enabled || exit 0
 
 host=127.0.0.1
 

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/run_federation_sys_tests
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/run_federation_sys_tests?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/run_federation_sys_tests (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/run_federation_sys_tests Wed May  2 13:09:18 2012
@@ -26,12 +26,8 @@ source ./test_env.sh
 MODULENAME=federation_sys
 
 # Test for clustering
-ps -u root | grep 'aisexec\|corosync' > /dev/null
-if (( $? == 0 )); then
-    CLUSTERING_ENABLED=1
-else
-    echo "WARNING: No clustering detected; tests using it will be ignored."
-fi
+source cpg_check.sh
+if cpg_enabled; then CLUSTERING_ENABLED=1; fi
 
 # Test for long test
 if [[ "$1" == "LONG_TEST" ]]; then

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/run_federation_tests
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/run_federation_tests?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/run_federation_tests (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/run_federation_tests Wed May  2 13:09:18 2012
@@ -33,16 +33,13 @@ else
     SKIPTESTS='-i *_xml'    # note: single quotes prevent expansion of *
 fi
 
+QPIDD_CMD="../qpidd --daemon --port 0 --no-data-dir $MODULES --auth no --log-enable=info+ --log-enable=debug+:Bridge --log-to-file"
 start_brokers() {
-    ../qpidd --daemon --port 0 --no-data-dir $MODULES --auth no > qpidd.port
-    LOCAL_PORT=`cat qpidd.port`
-    ../qpidd --daemon --port 0 --no-data-dir $MODULES --auth no > qpidd.port
-    REMOTE_PORT=`cat qpidd.port`
-
-    ../qpidd --daemon --port 0 --no-data-dir $MODULES --auth no > qpidd.port
-    REMOTE_B1=`cat qpidd.port`
-    ../qpidd --daemon --port 0 --no-data-dir $MODULES --auth no > qpidd.port
-    REMOTE_B2=`cat qpidd.port`
+    rm -f fed_local.log fed_remote.log fed_b1.log fed_b2.log
+    LOCAL_PORT=$($QPIDD_CMD fed_local.log)
+    REMOTE_PORT=$($QPIDD_CMD fed_remote.log)
+    REMOTE_B1=$($QPIDD_CMD fed_b1.log)
+    REMOTE_B2=$($QPIDD_CMD fed_b2.log)
 }
 
 stop_brokers() {

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl.mk
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl.mk?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl.mk (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl.mk Wed May  2 13:09:18 2012
@@ -20,18 +20,37 @@
 # Test that are only relevant if SASL is enabled.
 if HAVE_SASL
 
+if HAVE_LIBCPG
 check_PROGRAMS+=cluster_authentication_soak
 cluster_authentication_soak_INCLUDES=$(PUBLIC_INCLUDES)
 cluster_authentication_soak_SOURCES=cluster_authentication_soak.cpp  ForkedBroker.h ForkedBroker.cpp
 cluster_authentication_soak_LDADD=$(lib_client) $(lib_broker)
+endif HAVE_LIBCPG
 
 # Note: sasl_version is not a test -- it is a tool used by tests.
 check_PROGRAMS+=sasl_version
 sasl_version_SOURCES=sasl_version.cpp
 sasl_version_LDADD=$(lib_client)
 
-TESTS += run_cluster_authentication_test sasl_fed sasl_fed_ex_dynamic sasl_fed_ex_link sasl_fed_ex_queue sasl_fed_ex_route sasl_fed_ex_route_cluster sasl_fed_ex_link_cluster sasl_fed_ex_queue_cluster sasl_fed_ex_dynamic_cluster sasl_no_dir
+TESTS += 	sasl_fed
+		sasl_fed_ex_dynamic
+		sasl_fed_ex_link
+		sasl_fed_ex_queue
+		sasl_fed_ex_route
+		sasl_no_dir
+
+if HAVE_LIBCPG
+
+TESTS +=	run_cluster_authentication_test 	\
+		sasl_fed_ex_route_cluster		\
+		sasl_fed_ex_link_cluster		\
+		sasl_fed_ex_queue_cluster		\
+		sasl_fed_ex_dynamic_cluster
+
 LONG_TESTS += run_cluster_authentication_soak
+
+endif HAVE_LIBCPG
+
 EXTRA_DIST += run_cluster_authentication_test \
               sasl_fed                        \
               sasl_fed_ex                     \

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl_fed_ex_dynamic_cluster
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl_fed_ex_dynamic_cluster?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl_fed_ex_dynamic_cluster (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl_fed_ex_dynamic_cluster Wed May  2 13:09:18 2012
@@ -21,7 +21,9 @@
 
 
 source ./test_env.sh
-source $srcdir/ais_check
+source cpg_check.sh
+cpg_enabled || exit 0
+
 
 with_ais_group ${srcdir}/sasl_fed_ex dynamic cluster
 

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl_fed_ex_link_cluster
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl_fed_ex_link_cluster?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl_fed_ex_link_cluster (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl_fed_ex_link_cluster Wed May  2 13:09:18 2012
@@ -21,7 +21,8 @@
 
 
 source ./test_env.sh
-source $srcdir/ais_check
+source cpg_check.sh
+cpg_enabled || exit 0
 
 with_ais_group ${srcdir}/sasl_fed_ex link cluster
 

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl_fed_ex_queue_cluster
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl_fed_ex_queue_cluster?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl_fed_ex_queue_cluster (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl_fed_ex_queue_cluster Wed May  2 13:09:18 2012
@@ -21,7 +21,8 @@
 
 
 source ./test_env.sh
-source ${srcdir}/ais_check
+source cpg_check.sh
+cpg_enabled || exit 0
 
 with_ais_group ${srcdir}/sasl_fed_ex queue cluster
 

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl_fed_ex_route_cluster
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl_fed_ex_route_cluster?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl_fed_ex_route_cluster (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/sasl_fed_ex_route_cluster Wed May  2 13:09:18 2012
@@ -21,7 +21,8 @@
 
 
 source ./test_env.sh
-source ${srcdir}/ais_check
+source cpg_check.sh
+cpg_enabled || exit 0
 
 with_ais_group ${srcdir}/sasl_fed_ex route cluster
 

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/ssl_test
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/ssl_test?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/ssl_test (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/ssl_test Wed May  2 13:09:18 2012
@@ -192,7 +192,8 @@ stop_brokers
 test -z $CLUSTER_LIB && exit 0	# Exit if cluster not supported.
 
 ## Test failover in a cluster using SSL only
-. $srcdir/ais_check		# Will exit if clustering not enabled.
+source cpg_check.sh
+cpg_enabled || exit 0
 
 PORT1=`pick_port`; ssl_cluster_broker $PORT1
 echo "Running SSL cluster broker on port $PORT1"

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/start_cluster
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/start_cluster?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/start_cluster (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/start_cluster Wed May  2 13:09:18 2012
@@ -24,7 +24,8 @@
 
 # Execute command with the ais group set.
 source ./test_env.sh
-. `dirname $0`/ais_check
+source cpg_check.sh
+cpg_enabled || exit 0
 
 rm -f cluster*.log cluster.ports qpidd.port
 

Modified: qpid/branches/qpid-3767/qpid/cpp/src/tests/test_env.sh.in
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/tests/test_env.sh.in?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/tests/test_env.sh.in (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/tests/test_env.sh.in Wed May  2 13:09:18 2012
@@ -75,6 +75,7 @@ exportmodule XML_LIB xml.so
 # Qpid options
 export QPID_NO_MODULE_DIR=1	# Don't accidentally load installed modules
 export QPID_DATA_DIR=
+export QPID_CONFIG=$srcdir/qpidd-empty.conf
 
 # Use temporary directory if $HOME does not exist
 if [ ! -e "$HOME" ]; then

Modified: qpid/branches/qpid-3767/qpid/cpp/src/windows/QpiddBroker.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/src/windows/QpiddBroker.cpp?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/src/windows/QpiddBroker.cpp (original)
+++ qpid/branches/qpid-3767/qpid/cpp/src/windows/QpiddBroker.cpp Wed May  2 13:09:18 2012
@@ -37,7 +37,7 @@ namespace broker {
 
 BootstrapOptions::BootstrapOptions(const char* argv0)
   : qpid::Options("Options"),
-    common("", QPIDD_CONF_FILE),
+    common("", QPIDD_CONF_FILE, QPIDC_CONF_FILE),
     module(QPIDD_MODULE_DIR),
     log(argv0)
 {
@@ -315,7 +315,7 @@ struct QpiddWindowsOptions : public Qpid
 
 QpiddOptions::QpiddOptions(const char* argv0)
   : qpid::Options("Options"),
-    common("", QPIDD_CONF_FILE),
+    common("", QPIDD_CONF_FILE, QPIDC_CONF_FILE),
     module(QPIDD_MODULE_DIR),
     log(argv0)
 {

Modified: qpid/branches/qpid-3767/qpid/cpp/xml/cluster.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/cpp/xml/cluster.xml?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/cpp/xml/cluster.xml (original)
+++ qpid/branches/qpid-3767/qpid/cpp/xml/cluster.xml Wed May  2 13:09:18 2012
@@ -326,6 +326,12 @@
       <field name="dequeueSincePurge" type="uint32"/>
     </control>
 
+    <!-- Replicate the internal state for an object - e.g. Links, bridges, etc -->
+    <control name="internal-state" code="0x42">
+      <field name="type" type="str8"/> <!-- The type of object the state is for (e.g. 'link') -->
+      <field name="name" type="str8"/> <!-- Identifies the particular object to be updated -->
+      <field name="state" type="map"/> <!-- The internal state for the object -->
+    </control>
 
   </class>
 

Modified: qpid/branches/qpid-3767/qpid/doc/book/Makefile
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/doc/book/Makefile?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/doc/book/Makefile (original)
+++ qpid/branches/qpid-3767/qpid/doc/book/Makefile Wed May  2 13:09:18 2012
@@ -17,37 +17,22 @@
 # under the License.
 #
 
-#
-#  This Makefile requires the following:
-#
-#  Apache FOP, version 0.95 or higher
-#  Docbook 4.5
-#  Docbook XSL stylesheets - tested with xsl-stylesheets (1.75.2 and 1.65.1-2)
-#  xsltproc
-#  xmllint
-# 
-
-all: cpp java programming
+DIRS = src/java-broker src/cpp-broker src/programming
 
-cpp: build/AMQP-Messaging-Broker-CPP-Book
 
-java: build/AMQP-Messaging-Broker-Java-Book
+.PHONY: all $(DIRS)
 
-programming: build/Programming-In-Apache-Qpid
+all: $(DIRS)     
 
-qmf: build/QmfBook
-
-build/AMQP-Messaging-Broker-CPP-Book:
-	./build-book.sh AMQP-Messaging-Broker-CPP-Book
+clean: 
+	rm -rf build
 
-build/AMQP-Messaging-Broker-Java-Book:
-	./build-book.sh AMQP-Messaging-Broker-Java-Book
+html: TARGET = html
+html: all
 
-build/Programming-In-Apache-Qpid:
-	./build-book.sh Programming-In-Apache-Qpid
+pdf: TARGET = pdf
+pdf: all
 
-build/QmfBook: src/QmfBook.xml src/QmfIntroduction.xml
-	./build-book.sh QmfBook
+$(DIRS):
+	$(MAKE) -C $@ $(TARGET) OUTPUTDIR=../../build/
 
-clean:
-	rm -rf build

Propchange: qpid/branches/qpid-3767/qpid/doc/book/src/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed May  2 13:09:18 2012
@@ -0,0 +1 @@
+output

Propchange: qpid/branches/qpid-3767/qpid/doc/book/src/java-broker/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed May  2 13:09:18 2012
@@ -0,0 +1 @@
+output

Propchange: qpid/branches/qpid-3767/qpid/java/
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java:r1306564-1332660

Propchange: qpid/branches/qpid-3767/qpid/java/amqp-1-0-client/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed May  2 13:09:18 2012
@@ -0,0 +1,7 @@
+/qpid/branches/0.5.x-dev/amqp-1-0-client:886720-886722
+/qpid/branches/0.5.x-dev/qpid/java/amqp-1-0-client:886720-886722,887145,892761,894875,916304,916325,930288,931179
+/qpid/branches/java-broker-0-10/qpid/java/amqp-1-0-client:795950-829653
+/qpid/branches/java-network-refactor/qpid/java/amqp-1-0-client:805429-821809
+/qpid/branches/qpid-2935/qpid/java/amqp-1-0-client:1061302-1072333
+/qpid/trunk/qpid/amqp-1-0-client:796646-796653,1080001-1085000
+/qpid/trunk/qpid/java/amqp-1-0-client:1073294-1157765,1160415-1162726,1162729-1166086,1166089-1235000,1306564-1332660

Propchange: qpid/branches/qpid-3767/qpid/java/amqp-1-0-client-jms/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed May  2 13:09:18 2012
@@ -0,0 +1,7 @@
+/qpid/branches/0.5.x-dev/amqp-1-0-client-jms:886720-886722
+/qpid/branches/0.5.x-dev/qpid/java/amqp-1-0-client-jms:886720-886722,887145,892761,894875,916304,916325,930288,931179
+/qpid/branches/java-broker-0-10/qpid/java/amqp-1-0-client-jms:795950-829653
+/qpid/branches/java-network-refactor/qpid/java/amqp-1-0-client-jms:805429-821809
+/qpid/branches/qpid-2935/qpid/java/amqp-1-0-client-jms:1061302-1072333
+/qpid/trunk/qpid/amqp-1-0-client-jms:796646-796653,1080001-1085000
+/qpid/trunk/qpid/java/amqp-1-0-client-jms:1073294-1157765,1160415-1162726,1162729-1166086,1166089-1235000,1306564-1332660

Propchange: qpid/branches/qpid-3767/qpid/java/amqp-1-0-common/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed May  2 13:09:18 2012
@@ -0,0 +1,7 @@
+/qpid/branches/0.5.x-dev/amqp-1-0-common:886720-886722
+/qpid/branches/0.5.x-dev/qpid/java/amqp-1-0-common:886720-886722,887145,892761,894875,916304,916325,930288,931179
+/qpid/branches/java-broker-0-10/qpid/java/amqp-1-0-common:795950-829653
+/qpid/branches/java-network-refactor/qpid/java/amqp-1-0-common:805429-821809
+/qpid/branches/qpid-2935/qpid/java/amqp-1-0-common:1061302-1072333
+/qpid/trunk/qpid/amqp-1-0-common:796646-796653,1080001-1085000
+/qpid/trunk/qpid/java/amqp-1-0-common:1073294-1157765,1160415-1162726,1162729-1166086,1166089-1235000,1306564-1332660

Modified: qpid/branches/qpid-3767/qpid/java/bdbstore/build.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3767/qpid/java/bdbstore/build.xml?rev=1333027&r1=1333026&r2=1333027&view=diff
==============================================================================
--- qpid/branches/qpid-3767/qpid/java/bdbstore/build.xml (original)
+++ qpid/branches/qpid-3767/qpid/java/bdbstore/build.xml Wed May  2 13:09:18 2012
@@ -18,7 +18,7 @@
  -->
 <project name="bdbstore" default="build">
     <property name="module.depends" value="common broker" />
-    <property name="module.test.depends" value="test client common/test broker/test management/common perftests systests" />
+    <property name="module.test.depends" value="test client common/test broker/test management/common systests" />
     <property name="module.genpom" value="true"/>
 
     <import file="../module.xml" />



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message