summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qpid/cpp/src/tests/CMakeLists.txt1
-rw-r--r--qpid/cpp/src/tests/queue_flow_limit_tests.py21
-rwxr-xr-xqpid/cpp/src/tests/run_queue_flow_limit_tests26
3 files changed, 23 insertions, 25 deletions
diff --git a/qpid/cpp/src/tests/CMakeLists.txt b/qpid/cpp/src/tests/CMakeLists.txt
index dd29743126..cee7ae5d20 100644
--- a/qpid/cpp/src/tests/CMakeLists.txt
+++ b/qpid/cpp/src/tests/CMakeLists.txt
@@ -340,6 +340,7 @@ if (PYTHON_EXECUTABLE)
add_test (ipv6_test ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/ipv6_test${test_script_suffix})
add_test (federation_tests ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/run_federation_tests${test_script_suffix})
add_test (federation_sys_tests ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/run_federation_sys_tests${test_script_suffix})
+ add_test (queue_flow_limit_tests ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/run_queue_flow_limit_tests${test_script_suffix})
if (BUILD_ACL)
add_test (acl_tests ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/run_acl_tests${test_script_suffix})
endif (BUILD_ACL)
diff --git a/qpid/cpp/src/tests/queue_flow_limit_tests.py b/qpid/cpp/src/tests/queue_flow_limit_tests.py
index d51b26a821..c7361a629e 100644
--- a/qpid/cpp/src/tests/queue_flow_limit_tests.py
+++ b/qpid/cpp/src/tests/queue_flow_limit_tests.py
@@ -7,9 +7,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
@@ -20,10 +20,8 @@
import sys
from qpid.testlib import TestBase010
-from qpid import datatypes, messaging
-from qpid.messaging import Message, Empty
-from threading import Thread, Lock
-from logging import getLogger
+from qpid.messaging import Connection
+from threading import Thread
from time import sleep, time
from os import environ, popen
@@ -56,8 +54,9 @@ class QueueFlowLimitTests(TestBase010):
if (max_count is not None):
args["qpid.max_count"] = max_count;
-
- self.session.queue_declare(queue=name, arguments=args)
+ broker = self.qmf.getObjects(_class="broker")[0]
+ rc = broker.create( "queue", name, args, True )
+ self.assertEqual(rc.status, 0, rc)
qs = self.qmf.getObjects(_class="queue")
for i in qs:
@@ -84,7 +83,9 @@ class QueueFlowLimitTests(TestBase010):
def _delete_queue(self, name):
""" Delete a named queue
"""
- self.session.queue_delete(queue=name)
+ broker = self.qmf.getObjects(_class="broker")[0]
+ rc = broker.delete( "queue", name, {} )
+ self.assertEqual(rc.status, 0, rc)
def _start_qpid_send(self, queue, count, content="X", capacity=100):
@@ -287,6 +288,7 @@ class QueueFlowLimitTests(TestBase010):
self.sendCount = 1000
self.consumeCount = 301 # (send - resume) + 1 to reenable flow
self.content = "X"
+ self.mgmt = None
def verifyStopped(self):
self.mgmt.update()
return self.mgmt.flowStopped and (self.mgmt.msgDepth > 800)
@@ -313,6 +315,7 @@ class QueueFlowLimitTests(TestBase010):
self.sendCount = 2000
self.consumeCount = 601 # (send - resume) + 1 to reenable flow
self.content = "XXXXX" # 5 bytes per message sent.
+ self.mgmt = None
def verifyStopped(self):
self.mgmt.update()
return self.mgmt.flowStopped and (self.mgmt.byteDepth > 8000)
diff --git a/qpid/cpp/src/tests/run_queue_flow_limit_tests b/qpid/cpp/src/tests/run_queue_flow_limit_tests
index 78fc2adf83..f6b5da97ea 100755
--- a/qpid/cpp/src/tests/run_queue_flow_limit_tests
+++ b/qpid/cpp/src/tests/run_queue_flow_limit_tests
@@ -24,8 +24,7 @@
source ./test_env.sh
test -d $PYTHON_DIR || { echo "Skipping queue flow control tests, no python dir."; exit 0; }
-LOG_FILE=queue_flow_limit_test.log
-PORT=""
+LOG_FILE=qpidd.log
trap stop_broker INT TERM QUIT
@@ -34,22 +33,17 @@ error() {
exit 1;
}
-start_broker() {
- # Note: if you change the DEFAULT_THRESHOLDS, you will need to update queue_flow_limit_tests.py
- DEFAULT_THRESHOLDS="--default-flow-stop-threshold=80 --default-flow-resume-threshold=70"
- rm -rf $LOG_FILE
- PORT=$($QPIDD_EXEC $DEFAULT_THRESHOLDS --auth=no --no-module-dir --daemon --port=0 -t --log-to-file $LOG_FILE) || error "Could not start broker"
-}
-
-stop_broker() {
- test -n "$PORT" && $QPIDD_EXEC --no-module-dir --quit --port $PORT
-}
+#set -x
-start_broker
-echo "Running Queue flow limit tests using broker on port $PORT"
-$QPID_PYTHON_TEST -m queue_flow_limit_tests $SKIPTESTS -b localhost:$PORT $@
+rm -rf $LOG_FILE
+# Note: if you change the DEFAULT_THRESHOLDS, you will need to update queue_flow_limit_tests.py
+DEFAULT_THRESHOLDS="--default-flow-stop-threshold=80 --default-flow-resume-threshold=70"
+start_broker $DEFAULT_THRESHOLDS -t --log-to-stderr=no --log-to-stdout=no || error "Could not start broker"
+QPID_PORT=`cat qpidd.port`
+echo "Running Queue flow limit tests using broker on port $QPID_PORT"
+$QPID_PYTHON_TEST -m queue_flow_limit_tests $SKIPTESTS -b localhost:$QPID_PORT $@
RETCODE=$?
-stop_broker
+stop_broker || error "Could not stop broker"
if test x$RETCODE != x0; then
echo "FAIL queue flow limit tests"; exit 1;
fi