diff options
author | Ted Ross <tross@apache.org> | 2012-02-22 16:41:55 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2012-02-22 16:41:55 +0000 |
commit | 3314a5cb4d14e94ed8fa29a1ba6348d10d27fdcf (patch) | |
tree | 52ddc4ee1c0424de91ded89b1cc27884cfa58134 /qpid/cpp | |
parent | 99104dde3f0718b4f9a3aff3427bab6a818fb41b (diff) | |
download | qpid-python-3314a5cb4d14e94ed8fa29a1ba6348d10d27fdcf.tar.gz |
QPID-3851 - Unified common CLI options for qpid-config and qpid-stat.
Also in this commit: qpid-config was converted to use the messaging-based qmf2
library. It no longer has a dependency on the qmf library. The CLI tests were also
ported to the faster library.
CLI test time prior to this commit: 2 minutes 12 seconds
CLI test time after this commit: 12.5 seconds
Other items in qpid-config and qpid-stat:
- The deprecated LVQ options (lqv, lqv-no-browse) were removed from qpid-config.
- A new option, --lvq-key, was added to qpid-config to support the new LVQ configuration.
The docs and tests were updated to match.
- qpid-stat was updated so that 'qpid-stat -q <queue-name>' prints full details from the
specified queue.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1292388 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
-rwxr-xr-x | qpid/cpp/bindings/qmf/tests/run_interop_tests | 3 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/cli_tests.py | 136 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/cluster_tests.py | 4 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/clustered_replication_test | 10 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/federated_cluster_test | 12 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/ipv6_test | 6 | ||||
-rw-r--r-- | qpid/cpp/src/tests/queue_flow_limit_tests.py | 2 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/reliable_replication_test | 6 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/replication_test | 34 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/ring_queue_test | 2 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/run_msg_group_tests | 8 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/run_msg_group_tests_soak | 4 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/sasl_fed | 16 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/sasl_fed_ex | 12 | ||||
-rw-r--r-- | qpid/cpp/src/tests/testlib.py | 4 |
15 files changed, 115 insertions, 144 deletions
diff --git a/qpid/cpp/bindings/qmf/tests/run_interop_tests b/qpid/cpp/bindings/qmf/tests/run_interop_tests index 83e7f2593b..c370f211af 100755 --- a/qpid/cpp/bindings/qmf/tests/run_interop_tests +++ b/qpid/cpp/bindings/qmf/tests/run_interop_tests @@ -24,6 +24,7 @@ MY_DIR=`dirname \`which $0\`` QPID_DIR=${MY_DIR}/../../../.. BUILD_DIR=../../.. PYTHON_DIR=${QPID_DIR}/python +TOOLS_PY_DIR=${QPID_DIR}/tools/src/py QMF_DIR=${QPID_DIR}/extras/qmf QMF_DIR_PY=${QMF_DIR}/src/py BROKER_DIR=${BUILD_DIR}/src @@ -68,7 +69,7 @@ TESTS_FAILED=0 if test -d ${PYTHON_DIR} ; then start_broker echo "Running qmf interop tests using broker on port $BROKER_PORT" - PYTHONPATH=${PYTHON_DIR}:${QMF_DIR_PY}:${MY_DIR} + PYTHONPATH=${PYTHON_DIR}:${QMF_DIR_PY}:${MY_DIR}:${TOOLS_PY_DIR} export PYTHONPATH if test -d ${PYTHON_LIB_DIR} ; then diff --git a/qpid/cpp/src/tests/cli_tests.py b/qpid/cpp/src/tests/cli_tests.py index 6c75927461..b9a7dda15c 100755 --- a/qpid/cpp/src/tests/cli_tests.py +++ b/qpid/cpp/src/tests/cli_tests.py @@ -22,7 +22,6 @@ import sys import os import imp from qpid.testlib import TestBase010 -# from brokertest import import_script, checkenv from qpid.datatypes import Message from qpid.queue import Empty from time import sleep @@ -61,14 +60,13 @@ class CliTests(TestBase010): ret = os.system(self.qpid_config_command(" add queue " + qname + " " + arguments)) self.assertEqual(ret, 0) - queues = self.qmf.getObjects(_class="queue") - for queue in queues: - if queue.name == qname: - return queue + queue = self.broker_access.getQueue(qname) + if queue: + return queue assert False def test_queue_params(self): - self.startQmf() + self.startBrokerAccess() queue1 = self.makeQueue("test_queue_params1", "--limit-policy none") queue2 = self.makeQueue("test_queue_params2", "--limit-policy reject") queue3 = self.makeQueue("test_queue_params3", "--limit-policy flow-to-disk") @@ -82,29 +80,21 @@ class CliTests(TestBase010): self.assertEqual(queue4.arguments[LIMIT], "ring") self.assertEqual(queue5.arguments[LIMIT], "ring_strict") - queue6 = self.makeQueue("test_queue_params6", "--order fifo") - queue7 = self.makeQueue("test_queue_params7", "--order lvq") - queue8 = self.makeQueue("test_queue_params8", "--order lvq-no-browse") - - LVQ = "qpid.last_value_queue" - LVQNB = "qpid.last_value_queue_no_browse" + queue6 = self.makeQueue("test_queue_params6", "--lvq-key lkey") - assert LVQ not in queue6.arguments - assert LVQ in queue7.arguments - assert LVQ not in queue8.arguments - - assert LVQNB not in queue6.arguments - assert LVQNB not in queue7.arguments - assert LVQNB in queue8.arguments + LVQKEY = "qpid.last_value_queue_key" + assert LVQKEY not in queue5.arguments + assert LVQKEY in queue6.arguments + assert queue6.arguments[LVQKEY] == "lkey" def test_queue_params_api(self): - self.startQmf() - queue1 = self.makeQueue("test_queue_params1", "--limit-policy none", True) - queue2 = self.makeQueue("test_queue_params2", "--limit-policy reject", True) - queue3 = self.makeQueue("test_queue_params3", "--limit-policy flow-to-disk", True) - queue4 = self.makeQueue("test_queue_params4", "--limit-policy ring", True) - queue5 = self.makeQueue("test_queue_params5", "--limit-policy ring-strict", True) + self.startBrokerAccess() + queue1 = self.makeQueue("test_queue_params_api1", "--limit-policy none", True) + queue2 = self.makeQueue("test_queue_params_api2", "--limit-policy reject", True) + queue3 = self.makeQueue("test_queue_params_api3", "--limit-policy flow-to-disk", True) + queue4 = self.makeQueue("test_queue_params_api4", "--limit-policy ring", True) + queue5 = self.makeQueue("test_queue_params_api5", "--limit-policy ring-strict", True) LIMIT = "qpid.policy_type" assert LIMIT not in queue1.arguments @@ -113,30 +103,22 @@ class CliTests(TestBase010): self.assertEqual(queue4.arguments[LIMIT], "ring") self.assertEqual(queue5.arguments[LIMIT], "ring_strict") - queue6 = self.makeQueue("test_queue_params6", "--order fifo", True) - queue7 = self.makeQueue("test_queue_params7", "--order lvq", True) - queue8 = self.makeQueue("test_queue_params8", "--order lvq-no-browse", True) - - LVQ = "qpid.last_value_queue" - LVQNB = "qpid.last_value_queue_no_browse" + queue6 = self.makeQueue("test_queue_params_api6", "--lvq-key lkey") - assert LVQ not in queue6.arguments - assert LVQ in queue7.arguments - assert LVQ not in queue8.arguments + LVQKEY = "qpid.last_value_queue_key" - assert LVQNB not in queue6.arguments - assert LVQNB not in queue7.arguments - assert LVQNB in queue8.arguments + assert LVQKEY not in queue5.arguments + assert LVQKEY in queue6.arguments + assert queue6.arguments[LVQKEY] == "lkey" def test_qpid_config(self): - self.startQmf(); - qmf = self.qmf + self.startBrokerAccess(); qname = "test_qpid_config" ret = os.system(self.qpid_config_command(" add queue " + qname)) self.assertEqual(ret, 0) - queues = qmf.getObjects(_class="queue") + queues = self.broker_access.getAllQueues() found = False for queue in queues: if queue.name == qname: @@ -146,7 +128,7 @@ class CliTests(TestBase010): ret = os.system(self.qpid_config_command(" del queue " + qname)) self.assertEqual(ret, 0) - queues = qmf.getObjects(_class="queue") + queues = self.broker_access.getAllQueues() found = False for queue in queues: if queue.name == qname: @@ -154,13 +136,12 @@ class CliTests(TestBase010): self.assertEqual(found, False) def test_qpid_config_api(self): - self.startQmf(); - qmf = self.qmf + self.startBrokerAccess(); qname = "test_qpid_config_api" ret = self.qpid_config_api(" add queue " + qname) self.assertEqual(ret, 0) - queues = qmf.getObjects(_class="queue") + queues = self.broker_access.getAllQueues() found = False for queue in queues: if queue.name == qname: @@ -170,7 +151,7 @@ class CliTests(TestBase010): ret = self.qpid_config_api(" del queue " + qname) self.assertEqual(ret, 0) - queues = qmf.getObjects(_class="queue") + queues = self.broker_access.getAllQueues() found = False for queue in queues: if queue.name == qname: @@ -179,25 +160,23 @@ class CliTests(TestBase010): def test_qpid_config_sasl_plain_expect_succeed(self): - self.startQmf(); - qmf = self.qmf + self.startBrokerAccess(); qname = "test_qpid_config_sasl_plain_expect_succeed" - cmd = " --sasl-mechanism PLAIN -a guest/guest@localhost:"+str(self.broker.port) + " add queue " + qname + cmd = " --sasl-mechanism PLAIN -b guest/guest@localhost:"+str(self.broker.port) + " add queue " + qname ret = self.qpid_config_api(cmd) self.assertEqual(ret, 0) def test_qpid_config_sasl_plain_expect_fail(self): """Fails because no user name and password is supplied""" - self.startQmf(); - qmf = self.qmf - qname = "test_qpid_config_sasl_plain_expect_succeed" - cmd = " --sasl-mechanism PLAIN -a localhost:"+str(self.broker.port) + " add queue " + qname + self.startBrokerAccess(); + qname = "test_qpid_config_sasl_plain_expect_fail" + cmd = " --sasl-mechanism PLAIN -b localhost:"+str(self.broker.port) + " add queue " + qname ret = self.qpid_config_api(cmd) assert ret != 0 # helpers for some of the test methods def helper_find_exchange(self, xchgname, typ, expected=True): - xchgs = self.qmf.getObjects(_class = "exchange") + xchgs = self.broker_access.getAllExchanges() found = False for xchg in xchgs: if xchg.name == xchgname: @@ -221,7 +200,7 @@ class CliTests(TestBase010): self.helper_find_exchange(xchgname, False, expected=False) def helper_find_queue(self, qname, expected=True): - queues = self.qmf.getObjects(_class="queue") + queues = self.broker_access.getAllQueues() found = False for queue in queues: if queue.name == qname: @@ -246,8 +225,7 @@ class CliTests(TestBase010): # test the bind-queue-to-header-exchange functionality def test_qpid_config_headers(self): - self.startQmf(); - qmf = self.qmf + self.startBrokerAccess(); qname = "test_qpid_config" xchgname = "test_xchg" @@ -277,8 +255,7 @@ class CliTests(TestBase010): def test_qpid_config_xml(self): - self.startQmf(); - qmf = self.qmf + self.startBrokerAccess(); qname = "test_qpid_config" xchgname = "test_xchg" @@ -306,13 +283,12 @@ class CliTests(TestBase010): self.helper_destroy_exchange(xchgname) def test_qpid_config_durable(self): - self.startQmf(); - qmf = self.qmf + self.startBrokerAccess(); qname = "test_qpid_config" ret = os.system(self.qpid_config_command(" add queue --durable " + qname)) self.assertEqual(ret, 0) - queues = qmf.getObjects(_class="queue") + queues = self.broker_access.getAllQueues() found = False for queue in queues: if queue.name == qname: @@ -322,7 +298,7 @@ class CliTests(TestBase010): ret = os.system(self.qpid_config_command(" del queue " + qname)) self.assertEqual(ret, 0) - queues = qmf.getObjects(_class="queue") + queues = self.broker_access.getAllQueues() found = False for queue in queues: if queue.name == qname: @@ -330,8 +306,7 @@ class CliTests(TestBase010): self.assertEqual(found, False) def test_qpid_config_altex(self): - self.startQmf(); - qmf = self.qmf + self.startBrokerAccess(); exName = "testalt" qName = "testqalt" altName = "amq.direct" @@ -339,7 +314,7 @@ class CliTests(TestBase010): ret = os.system(self.qpid_config_command(" add exchange topic %s --alternate-exchange=%s" % (exName, altName))) self.assertEqual(ret, 0) - exchanges = qmf.getObjects(_class="exchange") + exchanges = self.broker_access.getAllExchanges() found = False for exchange in exchanges: if exchange.name == altName: @@ -349,20 +324,20 @@ class CliTests(TestBase010): found = True if not exchange.altExchange: self.fail("Alternate exchange not set") - self.assertEqual(exchange._altExchange_.name, altName) + self.assertEqual(exchange.altExchange, altName) self.assertEqual(found, True) ret = os.system(self.qpid_config_command(" add queue %s --alternate-exchange=%s" % (qName, altName))) self.assertEqual(ret, 0) - queues = qmf.getObjects(_class="queue") + queues = self.broker_access.getAllQueues() found = False for queue in queues: if queue.name == qName: found = True if not queue.altExchange: self.fail("Alternate exchange not set") - self.assertEqual(queue._altExchange_.name, altName) + self.assertEqual(queue.altExchange, altName) self.assertEqual(found, True) def test_qpid_config_list_queues_arguments(self): @@ -371,8 +346,7 @@ class CliTests(TestBase010): actually a string (though still a valid value), it does not upset qpid-config """ - self.startQmf(); - qmf = self.qmf + self.startBrokerAccess(); names = ["queue_capacity%s" % (i) for i in range(1, 6)] for name in names: @@ -386,15 +360,14 @@ class CliTests(TestBase010): assert name in queues, "%s not in %s" % (name, queues) def test_qpid_route(self): - self.startQmf(); - qmf = self.qmf + self.startBrokerAccess(); command = self.cli_dir() + "/qpid-route dynamic add guest/guest@localhost:%d %s:%d amq.topic" %\ (self.broker.port, self.remote_host(), self.remote_port()) ret = os.system(command) self.assertEqual(ret, 0) - links = qmf.getObjects(_class="link") + links = self.broker_access.getAllLinks() found = False for link in links: if link.port == self.remote_port(): @@ -402,8 +375,7 @@ class CliTests(TestBase010): self.assertEqual(found, True) def test_qpid_route_api(self): - self.startQmf(); - qmf = self.qmf + self.startBrokerAccess(); ret = self.qpid_route_api("dynamic add " + "guest/guest@localhost:"+str(self.broker.port) + " " @@ -412,7 +384,7 @@ class CliTests(TestBase010): self.assertEqual(ret, 0) - links = qmf.getObjects(_class="link") + links = self.broker_access.getAllLinks() found = False for link in links: if link.port == self.remote_port(): @@ -421,8 +393,7 @@ class CliTests(TestBase010): def test_qpid_route_api(self): - self.startQmf(); - qmf = self.qmf + self.startBrokerAccess(); ret = self.qpid_route_api("dynamic add " + " --client-sasl-mechanism PLAIN " @@ -432,7 +403,7 @@ class CliTests(TestBase010): self.assertEqual(ret, 0) - links = qmf.getObjects(_class="link") + links = self.broker_access.getAllLinks() found = False for link in links: if link.port == self.remote_port(): @@ -440,8 +411,7 @@ class CliTests(TestBase010): self.assertEqual(found, True) def test_qpid_route_api_expect_fail(self): - self.startQmf(); - qmf = self.qmf + self.startBrokerAccess(); ret = self.qpid_route_api("dynamic add " + " --client-sasl-mechanism PLAIN " @@ -463,11 +433,11 @@ class CliTests(TestBase010): return None def qpid_config_command(self, arg = ""): - return self.cli_dir() + "/qpid-config -a localhost:%d" % self.broker.port + " " + arg + return self.cli_dir() + "/qpid-config -b localhost:%d" % self.broker.port + " " + arg def qpid_config_api(self, arg = ""): script = import_script(checkenv("QPID_CONFIG_EXEC")) - broker = ["-a", "localhost:"+str(self.broker.port)] + broker = ["-b", "localhost:"+str(self.broker.port)] return script.main(broker + arg.split()) def qpid_route_api(self, arg = ""): diff --git a/qpid/cpp/src/tests/cluster_tests.py b/qpid/cpp/src/tests/cluster_tests.py index cbc3df4a6b..79df21aada 100755 --- a/qpid/cpp/src/tests/cluster_tests.py +++ b/qpid/cpp/src/tests/cluster_tests.py @@ -277,7 +277,7 @@ acl deny all all QMF-based tools - regression test for BZ615300.""" broker1 = self.cluster(1)[0] broker2 = self.cluster(1)[0] - qs = subprocess.Popen(["qpid-stat", "-e", broker1.host_port()], stdout=subprocess.PIPE) + qs = subprocess.Popen(["qpid-stat", "-e", "-b", broker1.host_port()], stdout=subprocess.PIPE) out = qs.communicate()[0] assert out.find("amq.failover") > 0 @@ -1160,7 +1160,7 @@ class LongTests(BrokerTest): def start_mclients(broker): """Start management clients that make multiple connections.""" - cmd = ["qpid-stat", "-b", "localhost:%s" %(broker.port())] + cmd = ["qpid-cluster", "-C", "localhost:%s" %(broker.port())] mclients.append(ClientLoop(broker, cmd)) endtime = time.time() + self.duration() diff --git a/qpid/cpp/src/tests/clustered_replication_test b/qpid/cpp/src/tests/clustered_replication_test index 4a57502f39..8c8522c2eb 100755 --- a/qpid/cpp/src/tests/clustered_replication_test +++ b/qpid/cpp/src/tests/clustered_replication_test @@ -65,8 +65,8 @@ if test -d $PYTHON_DIR; then #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 -a "localhost:$PRIMARY1" add queue test-queue --generate-queue-events 2 - $PYTHON_COMMANDS/qpid-config -a "localhost:$PRIMARY1" add queue control-queue --generate-queue-events 1 + $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 @@ -81,9 +81,9 @@ if test -d $PYTHON_DIR; then 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 -a "localhost:$DR1" add queue test-queue - $PYTHON_COMMANDS/qpid-config -a "localhost:$DR1" add queue control-queue - $PYTHON_COMMANDS/qpid-config -a "localhost:$DR1" add exchange replication REPLICATION_EXCHANGE + $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 diff --git a/qpid/cpp/src/tests/federated_cluster_test b/qpid/cpp/src/tests/federated_cluster_test index b32455259e..50b877e666 100755 --- a/qpid/cpp/src/tests/federated_cluster_test +++ b/qpid/cpp/src/tests/federated_cluster_test @@ -63,20 +63,20 @@ start_brokers() { setup() { #create exchange on both cluster and single broker - $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_A" add exchange direct test-exchange - $PYTHON_COMMANDS/qpid-config -a "localhost:$NODE_1" add exchange direct test-exchange + $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_A" add exchange direct test-exchange + $PYTHON_COMMANDS/qpid-config -b "localhost:$NODE_1" add exchange direct test-exchange #create dynamic routes for test exchange $PYTHON_COMMANDS/qpid-route dynamic add "localhost:$NODE_2" "localhost:$BROKER_A" test-exchange $PYTHON_COMMANDS/qpid-route dynamic add "localhost:$BROKER_A" "localhost:$NODE_2" test-exchange #create test queue on cluster and bind it to the test exchange - $PYTHON_COMMANDS/qpid-config -a "localhost:$NODE_1" add queue test-queue - $PYTHON_COMMANDS/qpid-config -a "localhost:$NODE_1" bind test-exchange test-queue to-cluster + $PYTHON_COMMANDS/qpid-config -b "localhost:$NODE_1" add queue test-queue + $PYTHON_COMMANDS/qpid-config -b "localhost:$NODE_1" bind test-exchange test-queue to-cluster #create test queue on single broker and bind it to the test exchange - $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_A" add queue test-queue - $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_A" bind test-exchange test-queue from-cluster + $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_A" add queue test-queue + $PYTHON_COMMANDS/qpid-config -b "localhost:$BROKER_A" bind test-exchange test-queue from-cluster } run_test_pull_to_cluster_two_consumers() { diff --git a/qpid/cpp/src/tests/ipv6_test b/qpid/cpp/src/tests/ipv6_test index d75d50fd0a..8fa272d514 100755 --- a/qpid/cpp/src/tests/ipv6_test +++ b/qpid/cpp/src/tests/ipv6_test @@ -93,10 +93,10 @@ else BROKER1="[::1]:${PORTS[1]}" TEST_QUEUE=ipv6-fed-test - $QPID_CONFIG_EXEC -a $BROKER0 add queue $TEST_QUEUE - $QPID_CONFIG_EXEC -a $BROKER1 add queue $TEST_QUEUE + $QPID_CONFIG_EXEC -b $BROKER0 add queue $TEST_QUEUE + $QPID_CONFIG_EXEC -b $BROKER1 add queue $TEST_QUEUE $QPID_ROUTE_EXEC dynamic add $BROKER1 $BROKER0 amq.direct - $QPID_CONFIG_EXEC -a $BROKER1 bind amq.direct $TEST_QUEUE $TEST_QUEUE + $QPID_CONFIG_EXEC -b $BROKER1 bind amq.direct $TEST_QUEUE $TEST_QUEUE $QPID_ROUTE_EXEC route map $BROKER1 ./datagen --count 100 | tee rdata-in | diff --git a/qpid/cpp/src/tests/queue_flow_limit_tests.py b/qpid/cpp/src/tests/queue_flow_limit_tests.py index dec7cfb3af..d51b26a821 100644 --- a/qpid/cpp/src/tests/queue_flow_limit_tests.py +++ b/qpid/cpp/src/tests/queue_flow_limit_tests.py @@ -117,7 +117,7 @@ class QueueFlowLimitTests(TestBase010): tool = environ.get("QPID_CONFIG_EXEC") if tool: command = tool + \ - " --broker-addr=%s:%s " % (self.broker.host, self.broker.port) \ + " --broker=%s:%s " % (self.broker.host, self.broker.port) \ + "add queue test01 --flow-stop-count=999" \ + " --flow-resume-count=55 --flow-stop-size=5000000" \ + " --flow-resume-size=100000" diff --git a/qpid/cpp/src/tests/reliable_replication_test b/qpid/cpp/src/tests/reliable_replication_test index 1f1dac5f2d..c660f751e5 100755 --- a/qpid/cpp/src/tests/reliable_replication_test +++ b/qpid/cpp/src/tests/reliable_replication_test @@ -47,12 +47,12 @@ setup() { echo "Testing replication from port $BROKER_A to port $BROKER_B" - $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_B" add exchange replication replication + $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 -a "localhost:$BROKER_A" add queue queue-a --generate-queue-events 1 - $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_B" add queue queue-a + $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() { diff --git a/qpid/cpp/src/tests/replication_test b/qpid/cpp/src/tests/replication_test index 8c37568875..f8b2136396 100755 --- a/qpid/cpp/src/tests/replication_test +++ b/qpid/cpp/src/tests/replication_test @@ -46,21 +46,21 @@ if test -d ${PYTHON_DIR} && test -f "$REPLICATING_LISTENER_LIB" && test -f "$REP BROKER_B=`cat qpidd.port` echo "Running replication test between localhost:$BROKER_A and localhost:$BROKER_B" - $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_B" add exchange replication replication + $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 -a "localhost:$BROKER_A" add queue queue-a --generate-queue-events 2 - $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_A" add queue queue-b --generate-queue-events 2 - $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_A" add queue queue-c --generate-queue-events 1 - $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_A" add queue queue-d --generate-queue-events 2 - $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_A" add queue queue-e --generate-queue-events 1 + $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 -a "localhost:$BROKER_B" add queue queue-a - $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_B" add queue queue-b - $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_B" add queue queue-c - $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_B" add queue queue-e + $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: @@ -124,13 +124,13 @@ if test -d ${PYTHON_DIR} && test -f "$REPLICATING_LISTENER_LIB" && test -f "$REP $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 -a "localhost:$BROKER_B" add exchange replication replication + $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 -a "localhost:$BROKER_A" add queue queue-e --generate-queue-events 2 - $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_B" add queue queue-e - $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_A" add queue queue-d --generate-queue-events 1 - $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_B" add queue queue-d + $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 @@ -152,8 +152,8 @@ if test -d ${PYTHON_DIR} && test -f "$REPLICATING_LISTENER_LIB" && test -f "$REP $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 -a "localhost:$BROKER_B" add queue queue-e - $PYTHON_COMMANDS/qpid-config -a "localhost:$BROKER_B" add exchange replication replication + $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 diff --git a/qpid/cpp/src/tests/ring_queue_test b/qpid/cpp/src/tests/ring_queue_test index 553746eb49..271b46183e 100755 --- a/qpid/cpp/src/tests/ring_queue_test +++ b/qpid/cpp/src/tests/ring_queue_test @@ -28,7 +28,7 @@ MESSAGES=10000 SENDERS=1 RECEIVERS=1 CONCURRENT=0 -BROKER_URL="-a ${QPID_BROKER:-localhost}:${QPID_PORT:-5672}" +BROKER_URL="-b ${QPID_BROKER:-localhost}:${QPID_PORT:-5672}" setup() { if [[ $DURABLE -gt 0 ]]; then diff --git a/qpid/cpp/src/tests/run_msg_group_tests b/qpid/cpp/src/tests/run_msg_group_tests index 5a6da546f3..4e82759866 100755 --- a/qpid/cpp/src/tests/run_msg_group_tests +++ b/qpid/cpp/src/tests/run_msg_group_tests @@ -44,19 +44,19 @@ run_test() { declare -i i=0 declare -a tests -tests=("qpid-config -a $BROKER_URL add queue $QUEUE_NAME --group-header=${GROUP_KEY} --shared-groups" +tests=("qpid-config -b $BROKER_URL add queue $QUEUE_NAME --group-header=${GROUP_KEY} --shared-groups" "msg_group_test -b $BROKER_URL -a $QUEUE_NAME --group-key $GROUP_KEY --messages 103 --group-size 13 --receivers 2 --senders 3 --capacity 3 --ack-frequency 7 --randomize-group-size --interleave 3" "msg_group_test -b $BROKER_URL -a $QUEUE_NAME --group-key $GROUP_KEY --messages 103 --group-size 13 --receivers 2 --senders 3 --capacity 7 --ack-frequency 7 --randomize-group-size" - "qpid-config -a $BROKER_URL add queue ${QUEUE_NAME}-two --group-header=${GROUP_KEY} --shared-groups" + "qpid-config -b $BROKER_URL add queue ${QUEUE_NAME}-two --group-header=${GROUP_KEY} --shared-groups" "msg_group_test -b $BROKER_URL -a $QUEUE_NAME --group-key $GROUP_KEY --messages 103 --group-size 13 --receivers 2 --senders 3 --capacity 7 --ack-frequency 3 --randomize-group-size" "msg_group_test -b $BROKER_URL -a ${QUEUE_NAME}-two --group-key $GROUP_KEY --messages 103 --group-size 13 --receivers 2 --senders 3 --capacity 3 --ack-frequency 7 --randomize-group-size --interleave 5" "msg_group_test -b $BROKER_URL -a $QUEUE_NAME --group-key $GROUP_KEY --messages 59 --group-size 5 --receivers 2 --senders 3 --capacity 1 --ack-frequency 3 --randomize-group-size" - "qpid-config -a $BROKER_URL del queue ${QUEUE_NAME}-two --force" + "qpid-config -b $BROKER_URL del queue ${QUEUE_NAME}-two --force" "msg_group_test -b $BROKER_URL -a $QUEUE_NAME --group-key $GROUP_KEY --messages 59 --group-size 3 --receivers 2 --senders 3 --capacity 1 --ack-frequency 1 --randomize-group-size" "msg_group_test -b $BROKER_URL -a $QUEUE_NAME --group-key $GROUP_KEY --messages 211 --group-size 13 --receivers 2 --senders 3 --capacity 47 --ack-frequency 79 --interleave 53" "msg_group_test -b $BROKER_URL -a $QUEUE_NAME --group-key $GROUP_KEY --messages 10000 --group-size 1 --receivers 0 --senders 1" "msg_group_test -b $BROKER_URL -a $QUEUE_NAME --group-key $GROUP_KEY --messages 10000 --receivers 5 --senders 0" - "qpid-config -a $BROKER_URL del queue $QUEUE_NAME --force") + "qpid-config -b $BROKER_URL del queue $QUEUE_NAME --force") while [ -n "${tests[i]}" ]; do run_test ${tests[i]} diff --git a/qpid/cpp/src/tests/run_msg_group_tests_soak b/qpid/cpp/src/tests/run_msg_group_tests_soak index 44995423cc..2ebbaf4efd 100755 --- a/qpid/cpp/src/tests/run_msg_group_tests_soak +++ b/qpid/cpp/src/tests/run_msg_group_tests_soak @@ -44,13 +44,13 @@ run_test() { declare -i i=0 declare -a tests -tests=("qpid-config -a $BROKER_URL add queue $QUEUE_NAME --group-header=${GROUP_KEY} --shared-groups" +tests=("qpid-config -b $BROKER_URL add queue $QUEUE_NAME --group-header=${GROUP_KEY} --shared-groups" "msg_group_test -b $BROKER_URL -a $QUEUE_NAME --group-key $GROUP_KEY --messages 10007 --receivers 3 --senders 5 --group-size 211 --randomize-group-size --capacity 47 --ack-frequency 97" "msg_group_test -b $BROKER_URL -a $QUEUE_NAME --group-key $GROUP_KEY --messages 10007 --receivers 3 --senders 5 --group-size 211 --randomize-group-size --capacity 79 --ack-frequency 79" "msg_group_test -b $BROKER_URL -a $QUEUE_NAME --group-key $GROUP_KEY --messages 10007 --receivers 3 --senders 5 --group-size 211 --randomize-group-size --capacity 97 --ack-frequency 47" "msg_group_test -b $BROKER_URL -a $QUEUE_NAME --group-key $GROUP_KEY --messages 40000 --receivers 0 --senders 5 --group-size 13 --randomize-group-size" "msg_group_test -b $BROKER_URL -a $QUEUE_NAME --group-key $GROUP_KEY --messages 200000 --receivers 3 --senders 0 --capacity 23 --ack-frequency 7" - "qpid-config -a $BROKER_URL del queue $QUEUE_NAME --force") + "qpid-config -b $BROKER_URL del queue $QUEUE_NAME --force") while [ -n "${tests[i]}" ]; do run_test ${tests[i]} diff --git a/qpid/cpp/src/tests/sasl_fed b/qpid/cpp/src/tests/sasl_fed index 884c44177c..9dc2dd46e2 100755 --- a/qpid/cpp/src/tests/sasl_fed +++ b/qpid/cpp/src/tests/sasl_fed @@ -90,23 +90,23 @@ EXCHANGE_NAME=sasl_fedex #-------------------------------------------------- #echo " add exchanges" #-------------------------------------------------- -$QPID_CONFIG_EXEC -a localhost:$broker_1_port add exchange direct $EXCHANGE_NAME -$QPID_CONFIG_EXEC -a localhost:$broker_2_port add exchange direct $EXCHANGE_NAME +$QPID_CONFIG_EXEC -b localhost:$broker_1_port add exchange direct $EXCHANGE_NAME +$QPID_CONFIG_EXEC -b localhost:$broker_2_port add exchange direct $EXCHANGE_NAME #-------------------------------------------------- #echo " add queues" #-------------------------------------------------- -$QPID_CONFIG_EXEC -a localhost:$broker_1_port add queue $QUEUE_NAME -$QPID_CONFIG_EXEC -a localhost:$broker_2_port add queue $QUEUE_NAME +$QPID_CONFIG_EXEC -b localhost:$broker_1_port add queue $QUEUE_NAME +$QPID_CONFIG_EXEC -b localhost:$broker_2_port add queue $QUEUE_NAME sleep 5 #-------------------------------------------------- #echo " create bindings" #-------------------------------------------------- -$QPID_CONFIG_EXEC -a localhost:$broker_1_port bind $EXCHANGE_NAME $QUEUE_NAME $ROUTING_KEY -$QPID_CONFIG_EXEC -a localhost:$broker_2_port bind $EXCHANGE_NAME $QUEUE_NAME $ROUTING_KEY +$QPID_CONFIG_EXEC -b localhost:$broker_1_port bind $EXCHANGE_NAME $QUEUE_NAME $ROUTING_KEY +$QPID_CONFIG_EXEC -b localhost:$broker_2_port bind $EXCHANGE_NAME $QUEUE_NAME $ROUTING_KEY sleep 5 @@ -130,13 +130,13 @@ sleep 5 #-------------------------------------------------- #echo " Examine Broker $broker_1_port" #-------------------------------------------------- -broker_1_message_count=`$PYTHON_COMMANDS/qpid-stat -q localhost:$broker_1_port | grep sasl_fed_queue | awk '{print $2}'` +broker_1_message_count=`$PYTHON_COMMANDS/qpid-stat -q -b localhost:$broker_1_port | grep sasl_fed_queue | awk '{print $2}'` #echo " " #-------------------------------------------------- #echo " Examine Broker $broker_2_port" #-------------------------------------------------- -broker_2_message_count=`$PYTHON_COMMANDS/qpid-stat -q localhost:$broker_2_port | grep sasl_fed_queue | awk '{print $2}'` +broker_2_message_count=`$PYTHON_COMMANDS/qpid-stat -q -b localhost:$broker_2_port | grep sasl_fed_queue | awk '{print $2}'` #echo " " #-------------------------------------------------- diff --git a/qpid/cpp/src/tests/sasl_fed_ex b/qpid/cpp/src/tests/sasl_fed_ex index 716a806874..cc5b310067 100755 --- a/qpid/cpp/src/tests/sasl_fed_ex +++ b/qpid/cpp/src/tests/sasl_fed_ex @@ -280,18 +280,18 @@ EXCHANGE_NAME=sasl_fedex print "add exchanges" -$QPID_CONFIG_EXEC -a localhost:${SRC_TCP_PORT} add exchange direct $EXCHANGE_NAME -$QPID_CONFIG_EXEC -a localhost:${DST_TCP_PORT} add exchange direct $EXCHANGE_NAME +$QPID_CONFIG_EXEC -b localhost:${SRC_TCP_PORT} add exchange direct $EXCHANGE_NAME +$QPID_CONFIG_EXEC -b localhost:${DST_TCP_PORT} add exchange direct $EXCHANGE_NAME print "add queues" -$QPID_CONFIG_EXEC -a localhost:${SRC_TCP_PORT} add queue $QUEUE_NAME -$QPID_CONFIG_EXEC -a localhost:${DST_TCP_PORT} add queue $QUEUE_NAME +$QPID_CONFIG_EXEC -b localhost:${SRC_TCP_PORT} add queue $QUEUE_NAME +$QPID_CONFIG_EXEC -b localhost:${DST_TCP_PORT} add queue $QUEUE_NAME print "create bindings" -$QPID_CONFIG_EXEC -a localhost:${SRC_TCP_PORT} bind $EXCHANGE_NAME $QUEUE_NAME $ROUTING_KEY -$QPID_CONFIG_EXEC -a localhost:${DST_TCP_PORT} bind $EXCHANGE_NAME $QUEUE_NAME $ROUTING_KEY +$QPID_CONFIG_EXEC -b localhost:${SRC_TCP_PORT} bind $EXCHANGE_NAME $QUEUE_NAME $ROUTING_KEY +$QPID_CONFIG_EXEC -b localhost:${DST_TCP_PORT} bind $EXCHANGE_NAME $QUEUE_NAME $ROUTING_KEY # diff --git a/qpid/cpp/src/tests/testlib.py b/qpid/cpp/src/tests/testlib.py index fe57a84a81..71ad59e5c1 100644 --- a/qpid/cpp/src/tests/testlib.py +++ b/qpid/cpp/src/tests/testlib.py @@ -348,8 +348,8 @@ class TestBaseCluster(TestBase): def _qpidConfig(self, nodeNumber, clusterName, action): """Configure some aspect of a qpid broker using the qpid_config executable""" port = self.getNodeTuple(nodeNumber, clusterName)[self.PORT] - #print "%s -a localhost:%d %s" % (self._qpidConfigExec, port, action) - ret = os.spawnl(os.P_WAIT, self._qpidConfigExec, self._qpidConfigExec, "-a", "localhost:%d" % port, *action.split()) + #print "%s -b localhost:%d %s" % (self._qpidConfigExec, port, action) + ret = os.spawnl(os.P_WAIT, self._qpidConfigExec, self._qpidConfigExec, "-b", "localhost:%d" % port, *action.split()) if ret != 0: raise Exception("_qpidConfig(): cluster=\"%s\" nodeNumber=%d port=%d action=\"%s\" returned %d" % \ (clusterName, nodeNumber, port, action, ret)) |