You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jr...@apache.org on 2016/04/21 14:31:35 UTC

svn commit: r1740289 [2/3] - in /qpid/trunk/qpid: cpp/ cpp/docs/design/ cpp/docs/src/ cpp/management/ cpp/management/python/ cpp/management/python/bin/ cpp/management/python/lib/ cpp/management/python/lib/qlslibs/ cpp/management/python/lib/qmf/ cpp/man...

Modified: qpid/trunk/qpid/cpp/src/tests/interlink_tests.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/interlink_tests.py?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/interlink_tests.py (original)
+++ qpid/trunk/qpid/cpp/src/tests/interlink_tests.py Thu Apr 21 12:31:34 2016
@@ -72,12 +72,7 @@ class AmqpBrokerTest(BrokerTest):
         return self.popen(cmd, stdout=PIPE)
 
     def ready_receiver(self, config):
-        # NOTE: some tests core dump when run with SWIG binding over proton
-        # version<=0.6. This is fixed on proton 0.7.
-        def use_native():
-            pv=os.environ.get("QPID_PROTON_VERSION")
-            return pv and [int(n) for n in pv.split(".")] <= [0,6]
-        s = self.broker.connect(native=use_native()).session()
+        s = self.broker.connect().session()
         r = s.receiver("readyq; {create:always}")
         cmd = ["qpid-receive",
                "--broker", config.url,

Modified: qpid/trunk/qpid/cpp/src/tests/interop_tests.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/interop_tests.py?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/interop_tests.py (original)
+++ qpid/trunk/qpid/cpp/src/tests/interop_tests.py Thu Apr 21 12:31:34 2016
@@ -192,10 +192,7 @@ class CppTxTest(InteropTest):
 
 
 if __name__ == "__main__":
-    if not BrokerTest.amqp_tx_supported:
-        BrokerTest.amqp_tx_warning()
-        print "Skipping interop_tests"
-        sys.exit(0)
+    from env import *
     outdir = "interop_tests.tmp"
     shutil.rmtree(outdir, True)
     cmd = ["qpid-python-test", "-m", "interop_tests", "-DOUTDIR=%s"%outdir] + sys.argv[1:]

Modified: qpid/trunk/qpid/cpp/src/tests/legacystore/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/CMakeLists.txt?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/CMakeLists.txt Thu Apr 21 12:31:34 2016
@@ -28,8 +28,6 @@ endif (QPID_LINK_BOOST_DYNAMIC)
 
 include_directories( ${CMAKE_CURRENT_SOURCE_DIR} )
 
-set(test_wrap ${shell} ${CMAKE_SOURCE_DIR}/src/tests/run_test${test_script_suffix} -buildDir=${CMAKE_BINARY_DIR})
-
 if (BUILD_TESTING_UNITTESTS)
 
 # Like this to work with cmake 2.4 on Unix
@@ -53,7 +51,7 @@ target_link_libraries (${testname}
 if ("${ARGV1}" STREQUAL "LONG")
   set_target_properties(${testname} PROPERTIES COMPILE_DEFINITIONS LONG_TEST)
 endif ()
-add_test (NAME ${testname} COMMAND ${test_wrap} -boostTest -- $<TARGET_FILE:${testname}>)
+add_test (NAME ${testname} COMMAND ${CMAKE_BINARY_DIR}/src/tests/run.sh $<TARGET_FILE:${testname}>)
 unset (testname)
 ENDMACRO (define_journal_test)
 
@@ -100,7 +98,7 @@ target_link_libraries (jtt__ut
                        ${Boost_PROGRAM_OPTIONS_LIBRARY}
                        ${clock_gettime_LIB} legacystore_shared)
 
-add_test(journal_jtt_ut ${test_wrap} -boostTest -workingDir=${CMAKE_CURRENT_SOURCE_DIR}/jrnl/jtt -- ${CMAKE_CURRENT_BINARY_DIR}/jtt__ut)
+add_test(journal_jtt_ut ${CMAKE_BINARY_DIR}/src/tests/run.sh ${CMAKE_CURRENT_BINARY_DIR}/jtt__ut)
 
 endif (BUILD_TESTING_UNITTESTS)
 
@@ -127,6 +125,6 @@ target_link_libraries (jtt
 
 add_test(journal_jtt ${CMAKE_CURRENT_BINARY_DIR}/jtt -c ${CMAKE_CURRENT_SOURCE_DIR}/jrnl/jtt/jtt.csv)
 
-add_test (legacystore_python_tests ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/run_python_tests${test_script_suffix})
+add_test(legacystore_python_tests ${PYTHON_EXECUTABLE} run_python_tests)
 
 endif (BUILD_LEGACYSTORE AND BUILD_TESTING)

Modified: qpid/trunk/qpid/cpp/src/tests/legacystore/federation/federation_tests_env.sh
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/federation/federation_tests_env.sh?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/federation/federation_tests_env.sh (original)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/federation/federation_tests_env.sh Thu Apr 21 12:31:34 2016
@@ -142,7 +142,7 @@ func_set_env ()
 	    if test -z ${QPID_BLD}; then
 		    QPID_BLD="${QPID_DIR}/cpp"
 	    fi
-	    source $QPID_BLD/src/tests/test_env.sh
+	    source $QPID_BLD/src/tests/env.sh
 #	    CPP_CLUSTER_EXEC="${QPID_BLD}/src/tests/cluster_test"
 #	    PYTHON_CLUSTER_EXEC="${QPID_DIR}/cpp/src/tests/$PYTHON_TESTNAME"
 	    FEDERATION_SYS_TESTS_FAIL="${QPID_DIR}/cpp/src/tests/federation_sys_tests.fail"

Modified: qpid/trunk/qpid/cpp/src/tests/legacystore/run_python_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/legacystore/run_python_tests?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/legacystore/run_python_tests (original)
+++ qpid/trunk/qpid/cpp/src/tests/legacystore/run_python_tests Thu Apr 21 12:31:34 2016
@@ -1,4 +1,5 @@
-#!/usr/bin/env bash
+#!/usr/bin/env python
+
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -18,26 +19,29 @@
 # under the License.
 #
 
-source $QPID_TEST_COMMON
+import os
+import sys
 
-ensure_python_tests
+# Put the python test library on the path so we can get our
+# environment
 
-#Add our directory to the python path
-export PYTHONPATH=$srcdir/legacystore:$PYTHONPATH
+file_path = os.path.abspath(__file__)
+store_tests_dir = os.path.split(file_path)[0]
+tests_dir = os.path.split(store_tests_dir)[0]
 
-MODULENAME=python_tests
+sys.path.insert(0, tests_dir)
 
-echo "Running Python tests in module ${MODULENAME}..."
+from common import *
 
-QPID_PORT=${QPID_PORT:-5672}
-FAILING=${FAILING:-/dev/null}
-PYTHON_TESTS=${PYTHON_TESTS:-$*}
+# Add our directory to the python path
 
-OUTDIR=${MODULENAME}.tmp
-rm -rf $OUTDIR
+ENV["PYTHONPATH"] = "{}:{}".format(store_tests_dir, ENV["PYTHONPATH"])
 
 # To debug a test, add the following options to the end of the following line:
 # -v DEBUG -c qpid.messaging.io.ops [*.testName]
-${QPID_PYTHON_TEST} -m ${MODULENAME} -I $FAILING -DOUTDIR=$OUTDIR \
-  $PYTHON_TEST || exit 1
 
+port = start_broker("broker", "--load-module {}".format(STORE_LIB))
+
+run_broker_tests(port, "-m python_tests", "-DOUTDIR={}".format(WORK_DIR))
+
+check_results()

Modified: qpid/trunk/qpid/cpp/src/tests/linearstore/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/linearstore/CMakeLists.txt?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/linearstore/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/src/tests/linearstore/CMakeLists.txt Thu Apr 21 12:31:34 2016
@@ -17,13 +17,10 @@
 # under the License.
 #
 
-if(BUILD_LINEARSTORE AND BUILD_TESTING)
+if (BUILD_LINEARSTORE AND BUILD_TESTING)
 
 message(STATUS "Building linearstore tests")
 
-set(test_wrap ${shell} ${CMAKE_SOURCE_DIR}/src/tests/run_test${test_script_suffix} -buildDir=${CMAKE_BINARY_DIR})
-
-add_test (linearstore_python_tests ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/run_python_tests${test_script_suffix})
+add_test(linearstore_python_tests ${PYTHON_EXECUTABLE} run_python_tests)
 
 endif (BUILD_LINEARSTORE AND BUILD_TESTING)
-

Modified: qpid/trunk/qpid/cpp/src/tests/linearstore/run_python_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/linearstore/run_python_tests?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/linearstore/run_python_tests (original)
+++ qpid/trunk/qpid/cpp/src/tests/linearstore/run_python_tests Thu Apr 21 12:31:34 2016
@@ -1,4 +1,5 @@
-#!/usr/bin/env bash
+#!/usr/bin/env python
+
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -18,25 +19,29 @@
 # under the License.
 #
 
-source ${QPID_TEST_COMMON}
+import os
+import sys
 
-ensure_python_tests
+# Put the python test library on the path so we can get our
+# environment
 
-#Add our directory to the python path
-export PYTHONPATH=$srcdir/linearstore:${PYTHONPATH}
+file_path = os.path.abspath(__file__)
+store_tests_dir = os.path.split(file_path)[0]
+tests_dir = os.path.split(store_tests_dir)[0]
 
-MODULENAME=python_tests
+sys.path.insert(0, tests_dir)
 
-echo "Running Python tests in module ${MODULENAME}..."
+from common import *
 
-QPID_PORT=${QPID_PORT:-5672}
-FAILING=${FAILING:-/dev/null}
-PYTHON_TESTS=${PYTHON_TESTS:-$*}
+# Add our directory to the python path
 
-OUTDIR=${MODULENAME}.tmp
-rm -rf ${OUTDIR}
+ENV["PYTHONPATH"] = "{}:{}".format(store_tests_dir, ENV["PYTHONPATH"])
 
 # To debug a test, add the following options to the end of the following line:
 # -v DEBUG -c qpid.messaging.io.ops [*.testName]
-${QPID_PYTHON_TEST} -m ${MODULENAME} -I ${FAILING} -DOUTDIR=${OUTDIR} ${PYTHON_TEST} || exit 1
 
+port = start_broker("broker", "--load-module {}".format(STORE_LIB))
+
+run_broker_tests(port, "-m python_tests", "-DOUTDIR={}".format(WORK_DIR))
+
+check_results()

Added: qpid/trunk/qpid/cpp/src/tests/plano.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/plano.py?rev=1740289&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/plano.py (added)
+++ qpid/trunk/qpid/cpp/src/tests/plano.py Thu Apr 21 12:31:34 2016
@@ -0,0 +1,543 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+from __future__ import print_function
+
+import atexit as _atexit
+import codecs as _codecs
+import fnmatch as _fnmatch
+import getpass as _getpass
+import os as _os
+import random as _random
+import re as _re
+import shutil as _shutil
+import subprocess as _subprocess
+import sys as _sys
+import tarfile as _tarfile
+import tempfile as _tempfile
+import traceback as _traceback
+
+# See documentation at http://www.ssorj.net/projects/plano.html
+
+def fail(message, *args):
+    error(message, *args)
+
+    if isinstance(message, BaseException):
+        raise message
+
+    raise Exception(message)
+
+def error(message, *args):
+    _print_message("Error", message, args, _sys.stderr)
+
+def warn(message, *args):
+    _print_message("Warn", message, args, _sys.stderr)
+
+def notice(message, *args):
+    _print_message(None, message, args, _sys.stdout)
+
+def debug(message, *args):
+    _print_message("Debug", message, args, _sys.stdout)
+
+def exit(message=None, *args):
+    if message is None:
+        _sys.exit()
+
+    _print_message("Error", message, args, _sys.stderr)
+
+    _sys.exit(1)
+
+def _print_message(category, message, args, file):
+    message = _format_message(category, message, args)
+
+    print(message, file=file)
+    file.flush()
+
+def _format_message(category, message, args):
+    if isinstance(message, BaseException):
+        message = str(message)
+
+        if message == "":
+            message = message.__class__.__name__
+
+    if category:
+        message = "{}: {}".format(category, message)
+
+    if args:
+        message = message.format(*args)
+
+    script = split(_sys.argv[0])[1]
+    message = "{}: {}".format(script, message)
+
+    return message
+
+def flush():
+    _sys.stdout.flush()
+    _sys.stderr.flush()
+
+absolute_path = _os.path.abspath
+normalize_path = _os.path.normpath
+exists = _os.path.exists
+is_absolute = _os.path.isabs
+is_dir = _os.path.isdir
+is_file = _os.path.isfile
+is_link = _os.path.islink
+
+join = _os.path.join
+split = _os.path.split
+split_extension = _os.path.splitext
+
+LINE_SEP = _os.linesep
+PATH_SEP = _os.sep
+PATH_VAR_SEP = _os.pathsep
+ENV = _os.environ
+ARGS = _sys.argv
+
+current_dir = _os.getcwd
+
+def home_dir(user=""):
+    return _os.path.expanduser("~{}".format(user))
+
+def parent_dir(path):
+    path = normalize_path(path)
+    parent, child = split(path)
+
+    return parent
+
+def file_name(file):
+    file = normalize_path(file)
+    dir, name = split(file)
+
+    return name
+
+def name_stem(file):
+    name = file_name(file)
+
+    if name.endswith(".tar.gz"):
+        name = name[:-3]
+
+    stem, ext = split_extension(name)
+
+    return stem
+
+def name_extension(file):
+    name = file_name(file)
+    stem, ext = split_extension(name)
+    
+    return ext
+
+def read(file):
+    with _codecs.open(file, encoding="utf-8", mode="r") as f:
+        return f.read()
+
+def write(file, string):
+    with _codecs.open(file, encoding="utf-8", mode="w") as f:
+        f.write(string)
+
+    return file
+
+def append(file, string):
+    with _codecs.open(file, encoding="utf-8", mode="a") as f:
+        f.write(string)
+
+    return file
+
+def prepend(file, string):
+    orig = read(file)
+    prepended = string + orig
+
+    return write(file, prepended)
+
+def touch(file):
+    return append(file, "")
+
+def tail(file, n):
+    return "".join(tail_lines(file, n))
+
+def read_lines(file):
+    with _codecs.open(file, encoding="utf-8", mode="r") as f:
+        return f.readlines()
+
+def write_lines(file, lines):
+    with _codecs.open(file, encoding="utf-8", mode="r") as f:
+        f.writelines(lines)
+
+    return file
+
+def append_lines(file, lines):
+    with _codecs.open(file, encoding="utf-8", mode="a") as f:
+        f.writelines(string)
+
+    return file
+
+def prepend_lines(file, lines):
+    orig_lines = read_lines(file)
+
+    with _codecs.open(file, encoding="utf-8", mode="w") as f:
+        f.writelines(lines)
+        f.writelines(orig_lines)
+
+    return file
+
+# Derived from http://stackoverflow.com/questions/136168/get-last-n-lines-of-a-file-with-python-similar-to-tail
+def tail_lines(file, n):
+    assert n >= 0
+
+    with _codecs.open(file, encoding="utf-8", mode="r") as f:
+        pos = n + 1
+        lines = list()
+
+        while len(lines) <= n:
+        	try:
+        	    f.seek(-pos, 2)
+        	except IOError:
+        	    f.seek(0)
+        	    break
+        	finally:
+        	    lines = f.readlines()
+
+        	pos *= 2
+            
+        return lines[-n:]
+
+_temp_dir = _tempfile.mkdtemp(prefix="plano.")
+
+def _get_temp_file(key):
+    assert not key.startswith("_")
+
+    return join(_temp_dir, "_file_{}".format(key))
+
+def _remove_temp_dir():
+    _shutil.rmtree(_temp_dir, ignore_errors=True)
+
+_atexit.register(_remove_temp_dir)
+
+def read_temp(key):
+    file = _get_temp_file(key)
+    return read(file)
+
+def write_temp(key, string):
+    file = _get_temp_file(key)
+    return write(file, string)
+
+def append_temp(key, string):
+    file = _get_temp_file(key)
+    return append(file, string)
+
+def prepend_temp(key, string):
+    file = _get_temp_file(key)
+    return prepend(file, string)
+
+def make_temp(key):
+    return append_temp(key, "")
+
+def open_temp(key, mode="r"):
+    file = _get_temp_file(key)
+    return _codecs.open(file, encoding="utf-8", mode=mode)
+
+# This one is deleted on process exit
+def make_temp_dir():
+    return _tempfile.mkdtemp(prefix="_dir_", dir=_temp_dir)
+
+# This one sticks around
+def make_user_temp_dir():
+    temp_dir = _tempfile.gettempdir()
+    user = _getpass.getuser()
+    user_temp_dir = join(temp_dir, user)
+
+    return make_dir(user_temp_dir)
+
+def copy(from_path, to_path):
+    notice("Copying '{}' to '{}'", from_path, to_path)
+
+    to_dir = parent_dir(to_path)
+
+    if to_dir:
+        make_dir(to_dir)
+
+    if is_dir(from_path):
+        _copytree(from_path, to_path, symlinks=True)
+    else:
+        _shutil.copy(from_path, to_path)
+
+    return to_path
+
+def move(from_path, to_path):
+    notice("Moving '{}' to '{}'", from_path, to_path)
+
+    _shutil.move(from_path, to_path)
+
+    return to_path
+
+def rename(path, expr, replacement):
+    path = normalize_path(path)
+    parent_dir, name = split(path)
+    to_name = string_replace(name, expr, replacement)
+    to_path = join(parent_dir, to_name)
+
+    notice("Renaming '{}' to '{}'", path, to_path)
+
+    move(path, to_path)
+
+    return to_path
+
+def remove(path):
+    notice("Removing '{}'", path)
+
+    if not exists(path):
+        return
+
+    if is_dir(path):
+        _shutil.rmtree(path, ignore_errors=True)
+    else:
+        _os.remove(path)
+
+    return path
+
+def make_link(source_path, link_file):
+    if exists(link_file):
+        assert read_link(link_file) == source_path
+        return
+
+    _os.symlink(source_path, link_file)
+
+    return link_file
+
+def read_link(file):
+    return _os.readlink(file)
+
+def find(dir, *patterns):
+    matched_paths = set()
+
+    if not patterns:
+        patterns = ("*",)
+
+    for root, dirs, files in _os.walk(dir):
+        for pattern in patterns:
+            matched_dirs = _fnmatch.filter(dirs, pattern)
+            matched_files = _fnmatch.filter(files, pattern)
+
+            matched_paths.update([join(root, x) for x in matched_dirs])
+            matched_paths.update([join(root, x) for x in matched_files])
+
+    return sorted(matched_paths)
+
+def find_any_one(dir, *patterns):
+    paths = find(dir, *patterns)
+
+    if len(paths) == 0:
+        return
+    
+    return paths[0]
+
+def find_only_one(dir, *patterns):
+    paths = find(dir, *patterns)
+
+    if len(paths) == 0:
+        return
+    
+    assert len(paths) == 1
+
+    return paths[0]
+
+# find_via_expr?
+
+def string_replace(string, expr, replacement, count=0):
+    return _re.sub(expr, replacement, string, count)
+
+def make_dir(dir):
+    if not exists(dir):
+        _os.makedirs(dir)
+
+    return dir
+
+# Returns the current working directory so you can change it back
+def change_dir(dir):
+    notice("Changing directory to '{}'", dir)
+
+    cwd = current_dir()
+    _os.chdir(dir)
+    return cwd
+
+def list_dir(dir, *patterns):
+    assert is_dir(dir)
+
+    names = _os.listdir(dir)
+
+    if not patterns:
+        return sorted(names)
+
+    matched_names = set()
+
+    for pattern in patterns:
+        matched_names.update(_fnmatch.filter(names, pattern))
+
+    return sorted(matched_names)
+
+class working_dir(object):
+    def __init__(self, dir):
+        self.dir = dir
+        self.prev_dir = None
+
+    def __enter__(self):
+        self.prev_dir = change_dir(self.dir)
+        return self.dir
+
+    def __exit__(self, type, value, traceback):
+        change_dir(self.prev_dir)
+
+def _init_call(command, args, kwargs):
+    if args:
+        command = command.format(*args)
+
+    if "shell" not in kwargs:
+        kwargs["shell"] = True
+
+    notice("Calling '{}'", command)
+
+    return command, kwargs
+
+def call(command, *args, **kwargs):
+    command, args = _init_call(command, args, kwargs)
+    _subprocess.check_call(command, **kwargs)
+
+def call_for_output(command, *args, **kwargs):
+    command, args = _init_call(command, args, kwargs)
+    return _subprocess.check_output(command, **kwargs)
+
+def make_archive(input_dir, output_dir, archive_stem):
+    temp_dir = make_temp_dir()
+    temp_input_dir = join(temp_dir, archive_stem)
+
+    copy(input_dir, temp_input_dir)
+    make_dir(output_dir)
+
+    output_file = "{}.tar.gz".format(join(output_dir, archive_stem))
+    output_file = absolute_path(output_file)
+
+    with working_dir(temp_dir):
+        call("tar -czf {} {}", output_file, archive_stem)
+
+    return output_file
+
+def extract_archive(archive_file, output_dir):
+    assert is_file(archive_file)
+
+    if not exists(output_dir):
+        make_dir(output_dir)
+
+    archive_file = absolute_path(archive_file)
+
+    with working_dir(output_dir):
+        call("tar -xf {}", archive_file)
+
+    return output_dir
+
+def rename_archive(archive_file, new_archive_stem):
+    assert is_file(archive_file)
+
+    if name_stem(archive_file) == new_archive_stem:
+        return
+
+    temp_dir = make_temp_dir()
+
+    extract_archive(archive_file, temp_dir)
+
+    input_name = list_dir(temp_dir)[0]
+    input_dir = join(temp_dir, input_name)
+    output_file = make_archive(input_dir, temp_dir, new_archive_stem)
+    output_name = file_name(output_file)
+    archive_dir = parent_dir(archive_file)
+    new_archive_file = join(archive_dir, output_name)
+
+    move(output_file, new_archive_file)
+    remove(archive_file)
+
+    return new_archive_file
+
+def random_port(min=49152, max=65535):
+    return _random.randint(min, max)
+
+# Modified copytree impl that allows for already existing destination
+# dirs
+def _copytree(src, dst, symlinks=False, ignore=None):
+    """Recursively copy a directory tree using copy2().
+
+    If exception(s) occur, an Error is raised with a list of reasons.
+
+    If the optional symlinks flag is true, symbolic links in the
+    source tree result in symbolic links in the destination tree; if
+    it is false, the contents of the files pointed to by symbolic
+    links are copied.
+
+    The optional ignore argument is a callable. If given, it
+    is called with the `src` parameter, which is the directory
+    being visited by copytree(), and `names` which is the list of
+    `src` contents, as returned by os.listdir():
+
+        callable(src, names) -> ignored_names
+
+    Since copytree() is called recursively, the callable will be
+    called once for each directory that is copied. It returns a
+    list of names relative to the `src` directory that should
+    not be copied.
+
+    XXX Consider this example code rather than the ultimate tool.
+
+    """
+    names = _os.listdir(src)
+    if ignore is not None:
+        ignored_names = ignore(src, names)
+    else:
+        ignored_names = set()
+
+    if not exists(dst):
+        _os.makedirs(dst)
+    errors = []
+    for name in names:
+        if name in ignored_names:
+            continue
+        srcname = _os.path.join(src, name)
+        dstname = _os.path.join(dst, name)
+        try:
+            if symlinks and _os.path.islink(srcname):
+                linkto = _os.readlink(srcname)
+                _os.symlink(linkto, dstname)
+            elif _os.path.isdir(srcname):
+                _copytree(srcname, dstname, symlinks, ignore)
+            else:
+                # Will raise a SpecialFileError for unsupported file types
+                _shutil.copy2(srcname, dstname)
+        # catch the Error from the recursive copytree so that we can
+        # continue with other files
+        except _shutil.Error as err:
+            errors.extend(err.args[0])
+        except EnvironmentError as why:
+            errors.append((srcname, dstname, str(why)))
+    try:
+        _shutil.copystat(src, dst)
+    except OSError as why:
+        if _shutil.WindowsError is not None and isinstance \
+               (why, _shutil.WindowsError):
+            # Copying file access times may fail on Windows
+            pass
+        else:
+            errors.append((src, dst, str(why)))
+    if errors:
+        raise _shutil.Error(errors)

Added: qpid/trunk/qpid/cpp/src/tests/run.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run.py?rev=1740289&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run.py (added)
+++ qpid/trunk/qpid/cpp/src/tests/run.py Thu Apr 21 12:31:34 2016
@@ -0,0 +1,6 @@
+#!/usr/bin/env python
+
+from common import *
+
+call(" ".join(ARGS[1:]))
+

Propchange: qpid/trunk/qpid/cpp/src/tests/run.py
------------------------------------------------------------------------------
    svn:executable = *

Modified: qpid/trunk/qpid/cpp/src/tests/run_acl_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_acl_tests?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_acl_tests (original)
+++ qpid/trunk/qpid/cpp/src/tests/run_acl_tests Thu Apr 21 12:31:34 2016
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env python
 
 #
 # Licensed to the Apache Software Foundation (ASF) under one
@@ -19,148 +19,52 @@
 # under the License.
 #
 
-# 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
-DATA_DIRQ=`pwd`/data_dirq
-
-trap stop_brokers INT TERM QUIT
-
-start_brokers() {
-    ../qpidd --daemon --port 0 --interface 127.0.0.1 --no-module-dir --data-dir $DATA_DIR --acl-file policy.acl --auth no --log-enable trace+:acl  --log-to-file local.log > qpidd.port
-    LOCAL_PORT=`cat qpidd.port`
-    ../qpidd --daemon --port 0 --interface 127.0.0.1 --no-module-dir --data-dir $DATA_DIRI --acl-file policy.acl --auth no --connection-limit-per-ip 2   --log-to-file locali.log > qpiddi.port
-    LOCAL_PORTI=`cat qpiddi.port`
-    ../qpidd --daemon --port 0 --interface 127.0.0.1 --no-module-dir --data-dir $DATA_DIRU --acl-file policy.acl --auth no --connection-limit-per-user 2 --log-to-file localu.log > qpiddu.port
-    LOCAL_PORTU=`cat qpiddu.port`
-    ../qpidd --daemon --port 0 --interface 127.0.0.1 --no-module-dir --data-dir $DATA_DIRQ --acl-file policy.acl --auth no --max-queues-per-user 2      --log-to-file localq.log > qpiddq.port
-    LOCAL_PORTQ=`cat qpiddq.port`
-}
-
-start_noacl_noauth_brokers() {
-    ../qpidd --daemon --port 0 --no-module-dir --data-dir $DATA_DIR --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 --auth no --log-to-file locali.log > qpiddi.port
-    LOCAL_PORTI=`cat qpiddi.port`
-    ../qpidd --daemon --port 0 --no-module-dir --data-dir $DATA_DIRU --auth no --log-to-file localu.log > qpiddu.port
-    LOCAL_PORTU=`cat qpiddu.port`
-    ../qpidd --daemon --port 0 --no-module-dir --data-dir $DATA_DIRQ --auth no --log-to-file localq.log > qpiddq.port
-    LOCAL_PORTQ=`cat qpiddq.port`
-}
-
-start_noacl_auth_brokers() {
-    sasl_config_file=$builddir/sasl_config
-    if [ ! -f $sasl_config_file ] ; then
-	echo Creating sasl database
-	. $srcdir/sasl_test_setup.sh
-    fi
-    ../qpidd --daemon --port 0 --interface 127.0.0.1 --no-module-dir --data-dir $DATA_DIR --auth yes --sasl-config=$sasl_config_file --log-to-file local.log > qpidd.port
-    LOCAL_PORT=`cat qpidd.port`
-    ../qpidd --daemon --port 0 --interface 127.0.0.1 --no-module-dir --data-dir $DATA_DIRI --auth yes --sasl-config=$sasl_config_file --log-to-file locali.log > qpiddi.port
-    LOCAL_PORTI=`cat qpiddi.port`
-    ../qpidd --daemon --port 0 --interface 127.0.0.1 --no-module-dir --data-dir $DATA_DIRU --auth yes --sasl-config=$sasl_config_file --log-to-file localu.log > qpiddu.port
-    LOCAL_PORTU=`cat qpiddu.port`
-    ../qpidd --daemon --port 0 --interface 127.0.0.1 --no-module-dir --data-dir $DATA_DIRQ --auth yes --sasl-config=$sasl_config_file --log-to-file localq.log > qpiddq.port
-    LOCAL_PORTQ=`cat qpiddq.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
-        $QPIDD_EXEC --no-module-dir -q --port $LOCAL_PORTQ
-}
-
-delete_directories() {
-    rm -rf $DATA_DIR
-    rm -rf $DATA_DIRI
-    rm -rf $DATA_DIRU
-    rm -rf $DATA_DIRQ
-}
-
-delete_logfiles() {
-    rm -rf local.log
-    rm -rf locali.log
-    rm -rf localu.log
-    rm -rf localq.log
-}
-
-create_directories() {
-    mkdir -p $DATA_DIR
-    mkdir -p $DATA_DIRI
-    mkdir -p $DATA_DIRU
-    mkdir -p $DATA_DIRQ
-}
-
-populate_directories() {
-    cp $srcdir/policy.acl $DATA_DIR
-    cp $srcdir/policy.acl $DATA_DIRI
-    cp $srcdir/policy.acl $DATA_DIRU
-    cp $srcdir/policy.acl $DATA_DIRQ
-}
-
-test_loading_acl_from_absolute_path(){
-    POLICY_FILE=$srcdir/policy.acl
-    rm -f temp.log
-    PORT=`../qpidd --daemon --port 0 --interface 127.0.0.1 --no-module-dir --no-data-dir --auth no --acl-file $POLICY_FILE -t --log-to-file temp.log  2>/dev/null`
-    ACL_FILE=`grep "notice ACL: Read file" temp.log | sed 's/^.*Read file //'`
-   $QPIDD_EXEC --no-module-dir -q --port $PORT
-   if test "$ACL_FILE" != "\"$POLICY_FILE\""; then
-     echo "unable to load policy file from an absolute path";
-     return 1;
-   fi
-   rm temp.log
-}
-
-test_noacl_deny_create_link() {
-    delete_logfiles
-    start_noacl_noauth_brokers
-    echo "Running no-acl, no-auth tests using brokers on ports $LOCAL_PORT, $LOCAL_PORTI, $LOCAL_PORTU, and $LOCAL_PORTQ"
-    $QPID_CONFIG_EXEC -a localhost:$LOCAL_PORT  add exchange topic fed.topic
-    $QPID_CONFIG_EXEC -a localhost:$LOCAL_PORTI add exchange topic fed.topic
-    $QPID_ROUTE_EXEC dynamic add localhost:$LOCAL_PORT localhost:$LOCAL_PORTI fed.topic 2>/dev/null
-    sleep 2
-    stop_brokers
-    grep -q "must specify ACL create link rules" local.log
-    if [ $? -eq 0 ]
-    then
-	echo "Test fail - Broker with auth=no should have allowed link creation";
-	return 1;
-    fi
-
-    delete_logfiles
-    start_noacl_auth_brokers
-    echo "Running no-acl, auth tests using brokers on ports $LOCAL_PORT, $LOCAL_PORTI, $LOCAL_PORTU, and $LOCAL_PORTQ"
-    $QPID_CONFIG_EXEC -a localhost:$LOCAL_PORT  add exchange topic fed.topic
-    $QPID_CONFIG_EXEC -a localhost:$LOCAL_PORTI add exchange topic fed.topic
-    $QPID_ROUTE_EXEC dynamic add localhost:$LOCAL_PORT localhost:$LOCAL_PORTI fed.topic 2>/dev/null
-    sleep 2
-    stop_brokers
-    grep -q "must specify ACL create link rules" local.log
-    if [ $? -ne 0 ]
-    then
-	echo "Test fail - Broker with no ACL and --auth=yes file did not deny link creation";
-	return 1;
-    fi
-}
-
-if test -d ${PYTHON_DIR} ;  then
-    # run acl.py test file
-    delete_directories
-    create_directories
-    populate_directories
-    delete_logfiles
-    start_brokers
-    echo "Running acl tests using brokers on ports $LOCAL_PORT, $LOCAL_PORTI, $LOCAL_PORTU, and $LOCAL_PORTQ"
-    $QPID_PYTHON_TEST -b localhost:$LOCAL_PORT -m acl -Dport-i=$LOCAL_PORTI -Dport-u=$LOCAL_PORTU -Dport-q=$LOCAL_PORTQ || EXITCODE=1
-    stop_brokers || EXITCODE=1
-    #
-    test_loading_acl_from_absolute_path || EXITCODE=1
-    #
-    test_noacl_deny_create_link || EXITCODE=1
-    delete_directories
-    exit $EXITCODE
-fi
+from common import *
 
+policy_file = join(BUILD_DIR, "src", "tests", "policy.acl")
+broker_args = "--acl-file {}".format(policy_file)
+
+broker_port = start_broker("broker", broker_args, "--log-enable debug+:acl")
+broker_i_port = start_broker("broker_i", broker_args, "--connection-limit-per-ip 2")
+broker_u_port = start_broker("broker_u", broker_args, "--connection-limit-per-user 2")
+broker_q_port = start_broker("broker_q", broker_args, "--max-queues-per-user 2")
+
+run_broker_tests(broker_port, "-m acl",
+                 "-Dport-i={}".format(broker_i_port),
+                 "-Dport-u={}".format(broker_u_port),
+                 "-Dport-q={}".format(broker_q_port),
+                 "-Dpolicy-file={}".format(policy_file))
+
+# Test interaction of authentication and link creation
+
+broker_1_port = start_broker("broker_1")
+broker_2_port = start_broker("broker_2")
+
+configure_broker(broker_1_port, "add exchange topic fed.topic")
+configure_broker(broker_2_port, "add exchange topic fed.topic")
+
+connect_brokers("dynamic add",
+                "localhost:{}".format(broker_1_port),
+                "localhost:{}".format(broker_2_port),
+                "fed.topic")
+
+sasl_config_dir = join(BUILD_DIR, "src", "tests", "sasl_config")
+broker_args = "--auth yes --sasl-config {}".format(sasl_config_dir)
+
+broker_3_port = start_broker("broker_3", broker_args, auth_disabled=False)
+broker_4_port = start_broker("broker_4", broker_args, auth_disabled=False)
+
+configure_broker(broker_3_port, "add exchange topic fed.topic")
+configure_broker(broker_4_port, "add exchange topic fed.topic")
+
+try:
+    connect_brokers("dynamic add",
+                    "localhost:{}".format(broker_3_port),
+                    "localhost:{}".format(broker_4_port),
+                    "fed.topic")
+
+    fail("Broker with no ACLs but auth enabled did not deny link creation")
+except:
+    pass
+
+check_results()

Modified: qpid/trunk/qpid/cpp/src/tests/run_cli_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_cli_tests?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_cli_tests (original)
+++ qpid/trunk/qpid/cpp/src/tests/run_cli_tests Thu Apr 21 12:31:34 2016
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env python
 
 #
 # Licensed to the Apache Software Foundation (ASF) under one
@@ -19,63 +19,45 @@
 # under the License.
 #
 
-# Run the cli-utility tests.
+# Run the cli-utility tests
 
-source ./test_env.sh
-CLI_DIR=$PYTHON_COMMANDS
+from common import *
 
-trap stop_brokers INT TERM QUIT
+cli_dir = join(SOURCE_DIR, "management", "python", "bin")
 
-# helper function to create test.xquery in the current directory, so
-# that the python test program can find it.  yes, it leaves a turd.
-create_test_xquery() {
-     cat <<EOF > ./test.xquery
-    let \$w := ./weather
-    return \$w/station = 'Raleigh-Durham International Airport (KRDU)'
-       and \$w/temperature_f > 50
-       and \$w/temperature_f - \$w/dewpoint > 5
-       and \$w/wind_speed_mph > 7
-       and \$w/wind_speed_mph < 20
-EOF
-}
-
-start_brokers() {
-    # if the xml lib is present, use it.  if not, disable any tests which
-    # look like they're xml related.
-    # if we start supporting xml on windows, it will need something similar 
-    # here
-    if [ -f ../xml.so ] ; then
-	xargs="--load-module ../xml.so"
-	if [ ! -f test.xquery ] ; then 
-	    create_test_xquery
-	fi
-	targs=""
-    else
-	echo "Ignoring XML tests"
-	xargs=""
-	targs="--ignore=*xml*"
-    fi
-
-    ../qpidd --daemon --port 0 --interface 127.0.0.1 --no-data-dir --no-module-dir --mgmt-publish no --auth no $xargs > qpidd.port
-    LOCAL_PORT=`cat qpidd.port`
-    ../qpidd --daemon --port 0 --interface 127.0.0.1 --no-data-dir --no-module-dir --mgmt-publish no --auth no $xargs > qpidd.port
-    REMOTE_PORT=`cat qpidd.port`
-}
-
-stop_brokers() {
-        $QPIDD_EXEC --no-module-dir -q --port $LOCAL_PORT
-        $QPIDD_EXEC --no-module-dir -q --port $REMOTE_PORT
-}
-
-if test -d ${PYTHON_DIR} ;  then
-    start_brokers
-    echo "Running CLI tests using brokers on ports $LOCAL_PORT $REMOTE_PORT"
-    PYTHON_TESTS=${PYTHON_TESTS:-$*}
-    $QPID_PYTHON_TEST -m cli_tests -b localhost:$LOCAL_PORT -Dremote-port=$REMOTE_PORT -Dcli-dir=$CLI_DIR $targs $PYTHON_TESTS $@
-    RETCODE=$?
-    stop_brokers
-    if test x$RETCODE != x0; then 
-        echo "FAIL CLI tests"; exit 1;
-    fi
-fi
+xquery = """
+let $w := ./weather
+return $w/station = 'Raleigh-Durham International Airport (KRDU)'
+   and $w/temperature_f > 50
+   and $w/temperature_f - $w/dewpoint > 5
+   and $w/wind_speed_mph > 7
+   and $w/wind_speed_mph < 20
+"""
+xquery_file = write(join(WORK_DIR, "xquery_file"), xquery)
 
+# If the xml lib is present, use it.  if not, disable any tests which
+# look like they're xml related.
+#
+# If we start supporting xml on windows, it will need something
+# similar here.
+
+if XML_LIB is not None:
+    broker_args = "--load-module {}".format(XML_LIB)
+    test_args = ""
+else:
+    notice("Ignoring XML tests")
+
+    broker_args = ""
+    test_args = "--ignore=*xml*"
+
+local_port = start_broker("local", broker_args)
+remote_port = start_broker("remote", broker_args)
+
+run_broker_tests(local_port,
+                 "-m cli_tests",
+                 "-Dremote-port={}".format(remote_port),
+                 "-Dcli-dir={}".format(cli_dir),
+                 "-Dxquery-file={}".format(xquery_file),
+                 test_args)
+
+check_results()

Added: qpid/trunk/qpid/cpp/src/tests/run_client_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_client_tests?rev=1740289&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_client_tests (added)
+++ qpid/trunk/qpid/cpp/src/tests/run_client_tests Thu Apr 21 12:31:34 2016
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+from common import *
+
+port = start_broker("broker")
+
+ENV["QPID_PORT"] = str(port)
+
+call_with_valgrind("qpid-client-test --verbose")
+
+check_results()

Propchange: qpid/trunk/qpid/cpp/src/tests/run_client_tests
------------------------------------------------------------------------------
    svn:executable = *

Modified: qpid/trunk/qpid/cpp/src/tests/run_federation_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_federation_tests?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_federation_tests (original)
+++ qpid/trunk/qpid/cpp/src/tests/run_federation_tests Thu Apr 21 12:31:34 2016
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env python
 
 #
 # Licensed to the Apache Software Foundation (ASF) under one
@@ -19,43 +19,42 @@
 # under the License.
 #
 
-# Run the federation tests.
+from common import *
 
-source ./test_env.sh
-#set -x
-trap stop_brokers INT TERM QUIT
-
-if [ -f ../xml.so ] ; then
-    MODULES="--load-module xml" # Load the XML exchange and run XML exchange federation tests
-    SKIPTESTS=
-else
-    MODULES="--no-module-dir"
-    SKIPTESTS='-i *_xml'    # note: single quotes prevent expansion of *
-fi
-
-QPIDD_CMD="../qpidd --daemon --port 0 --interface 127.0.0.1 --no-data-dir $MODULES --auth no --log-enable=info+ --log-enable=debug+:Bridge --log-to-file"
-start_brokers() {
-    rm -f fed_local.log fed_remote.log fed_b1.log fed_b2.log
-    LOCAL_PORT=$($QPIDD_CMD fed_local.log --federation-tag LOCAL)
-    REMOTE_PORT=$($QPIDD_CMD fed_remote.log --federation-tag REMOTE)
-    REMOTE_B1=$($QPIDD_CMD fed_b1.log --federation-tag B1)
-    REMOTE_B2=$($QPIDD_CMD fed_b2.log --federation-tag B2)
-}
-
-stop_brokers() {
-        $QPIDD_EXEC $MODULES -q --port $LOCAL_PORT
-        $QPIDD_EXEC $MODULES -q --port $REMOTE_PORT
-        $QPIDD_EXEC $MODULES -q --port $REMOTE_B1
-        $QPIDD_EXEC $MODULES -q --port $REMOTE_B2
-}
-
-if test -d ${PYTHON_DIR} ;  then
-    start_brokers
-    echo "Running federation tests using brokers on ports $LOCAL_PORT $REMOTE_PORT $REMOTE_B1 $REMOTE_B2"
-    $QPID_PYTHON_TEST -m federation ${SKIPTESTS} -b localhost:$LOCAL_PORT -Dremote-port=$REMOTE_PORT -Dextra-brokers="$REMOTE_B1 $REMOTE_B2" $@
-    RETCODE=$?
-    stop_brokers
-    if test x$RETCODE != x0; then
-        echo "FAIL federation tests"; exit 1;
-    fi
-fi
+common_args = "--log-enable=debug+:Bridge"
+module_args = None
+test_args = "-i *_xml"
+
+sys_test_args = [
+    "-i federation_sys.A_Long*",
+    "-i federation_sys.B_Long*",
+    "-i federation_sys.C_*",
+    "-i federation_sys.D_*",
+    "-i federation_sys.E_*",
+    "-i federation_sys.F_*",
+    "-i federation_sys.G_*",
+    "-i federation_sys.H_*",
+]
+
+if XML_LIB is not None:
+    module_args = "--load-module {}".format(XML_LIB)
+    test_args = None
+
+local_port = start_broker("local", common_args, module_args, "--federation-tag LOCAL")
+remote_port = start_broker("remote", common_args, module_args, "--federation-tag REMOTE")
+remote_b1 = start_broker("remote_b1", common_args, module_args, "--federation-tag REMOTE_B1")
+remote_b2 = start_broker("remote_b2", common_args, module_args, "--federation-tag REMOTE_B2")
+
+run_broker_tests(local_port, "-m federation",
+                 "-Dremote-port={}".format(remote_port),
+                 "-Dextra-brokers='{} {}'".format(remote_b1, remote_b2),
+                 test_args)
+
+run_broker_tests(local_port, "-m headers_federation", "-Dremote-port={}".format(remote_port))
+
+run_broker_tests(remote_port, "-m federation_sys",
+                 "-Dlocal-port={}".format(local_port),
+                 "-Dremote-port={}".format(remote_port),
+                 *sys_test_args)
+
+check_results()

Added: qpid/trunk/qpid/cpp/src/tests/run_flow_control_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_flow_control_tests?rev=1740289&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_flow_control_tests (added)
+++ qpid/trunk/qpid/cpp/src/tests/run_flow_control_tests Thu Apr 21 12:31:34 2016
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+from common import *
+
+port = start_broker("broker", "--default-flow-stop-threshold=80 --default-flow-resume-threshold=70")
+
+run_broker_tests(port, "-m queue_flow_limit_tests")
+
+check_results()

Propchange: qpid/trunk/qpid/cpp/src/tests/run_flow_control_tests
------------------------------------------------------------------------------
    svn:executable = *

Modified: qpid/trunk/qpid/cpp/src/tests/run_ha_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_ha_tests?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_ha_tests (original)
+++ qpid/trunk/qpid/cpp/src/tests/run_ha_tests Thu Apr 21 12:31:34 2016
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env python
 
 #
 # Licensed to the Apache Software Foundation (ASF) under one
@@ -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
@@ -19,11 +19,19 @@
 # under the License.
 #
 
+from common import *
+
+# ENV["QPID_USE_SWIG_CLIENT"] = "1" # XXX is this necessary?
+
+# XXX These tests hang, and I can't figure out why
+# -i *tx_block_threads 
 
-# Make sure the python tools are available. They will be if we are building in
-# a checkoug, they may not be in a distribution.
-test -d $PYTHON_COMMANDS -a -x $PYTHON_COMMANDS/qpid-ha -a -x $PYTHON_COMMANDS/qpid-config || { echo "Skipping HA tests, qpid-ha or qpid-config not available."; exit 0; }
+# ENV["QPID_NO_MODULE_DIR"] = "1" # Don't accidentally load installed modules
+# ENV["QPID_DATA_DIR"] = ""
+# ENV["QPID_CONFIG"] = join(BUILD_DIR, "src", "tests", "qpidd-empty.conf")
+# ENV["QPID_PORT"] = ""
+# ENV["QPID_LOG_TO_FILE"] = join(BUILD_DIR, "src", "tests", "gah.log")
 
-srcdir=`dirname $0`
-$srcdir/ha_tests.py
+call("qpid-python-test -m ha_tests -DOUTDIR={}", WORK_DIR)
 
+check_results()

Added: qpid/trunk/qpid/cpp/src/tests/run_idle_timeout_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_idle_timeout_tests?rev=1740289&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_idle_timeout_tests (added)
+++ qpid/trunk/qpid/cpp/src/tests/run_idle_timeout_tests Thu Apr 21 12:31:34 2016
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+from common import *
+
+call("qpid-python-test -m idle_timeout_tests -DOUTDIR={}", WORK_DIR)
+
+check_results()

Propchange: qpid/trunk/qpid/cpp/src/tests/run_idle_timeout_tests
------------------------------------------------------------------------------
    svn:executable = *

Modified: qpid/trunk/qpid/cpp/src/tests/run_interlink_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_interlink_tests?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_interlink_tests (original)
+++ qpid/trunk/qpid/cpp/src/tests/run_interlink_tests Thu Apr 21 12:31:34 2016
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env python
 
 #
 # Licensed to the Apache Software Foundation (ASF) under one
@@ -19,8 +19,8 @@
 # under the License.
 #
 
-test -e "$AMQP_LIB" || { echo "Skipping AMQP 1.0 based tests; AMQP 1.0 support not available."; exit 0; }
+from common import *
 
-srcdir=`dirname $0`
-$srcdir/interlink_tests.py
+call("qpid-python-test -m interlink_tests -DOUTDIR={}", WORK_DIR)
 
+check_results()

Added: qpid/trunk/qpid/cpp/src/tests/run_interop_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_interop_tests?rev=1740289&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_interop_tests (added)
+++ qpid/trunk/qpid/cpp/src/tests/run_interop_tests Thu Apr 21 12:31:34 2016
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+from common import *
+
+port = start_broker("broker", "--load-module {}".format(AMQP_LIB))
+
+ENV["QPID_INTEROP_URL"] = "localhost:{}".format(port)
+
+call("qpid-python-test -m interop_tests -DOUTDIR={}", WORK_DIR)
+
+check_results()

Propchange: qpid/trunk/qpid/cpp/src/tests/run_interop_tests
------------------------------------------------------------------------------
    svn:executable = *

Added: qpid/trunk/qpid/cpp/src/tests/run_ipv6_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_ipv6_tests?rev=1740289&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_ipv6_tests (added)
+++ qpid/trunk/qpid/cpp/src/tests/run_ipv6_tests Thu Apr 21 12:31:34 2016
@@ -0,0 +1,116 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+source env.sh
+
+# Check whether we have any globally configured IPv6 addresses
+# - if not then we can't run the tests because ipv6 lookups won't
+#   work within the qpid code. This is a deliberate feature to avoid
+#   getting addresses that can't be routed by the machine.
+
+if ip -f inet6 -o addr | cut -f 9 -s -d' ' | grep global > /dev/null ; then
+    echo "IPv6 addresses configured - continuing"
+else
+    echo "No global IPv6 addresses configured - skipping test"
+    exit 0
+fi
+
+
+CONFIG=$(dirname $0)/qpidd-empty.conf
+TEST_HOSTNAME=::1
+COUNT=10
+
+trap cleanup EXIT
+
+error() { echo $*; exit 1; }
+
+# Don't need --no-module-dir or --no-data-dir as they are set as env vars in env.sh
+COMMON_OPTS="--interface [::1] --daemon --auth no --config $CONFIG"
+
+# Record all broker ports started
+unset PORTS
+declare -a PORTS
+
+# Start new brokers:
+#   $1 must be integer
+#   $2 = extra opts
+# Append used ports to PORTS variable
+start_brokers() {
+    local -a ports
+    for (( i=0; $i<$1; i++)) do
+        ports[$i]=$(qpidd --port 0 $COMMON_OPTS $2)
+    done
+    PORTS=( ${PORTS[@]} ${ports[@]} )
+}
+
+stop_brokers() {
+    for port in "${PORTS[@]}";
+    do
+        qpidd -qp $port
+    done
+    PORTS=()
+}
+
+cleanup() {
+    stop_brokers
+}
+
+start_brokers 1
+PORT=${PORTS[0]}
+echo "Started IPv6 smoke perftest on broker port $PORT"
+
+## Test connection via connection settings
+qpid-perftest --count ${COUNT} --port ${PORT} -b $TEST_HOSTNAME --summary
+
+## Test connection with a URL
+URL="amqp:[$TEST_HOSTNAME]:$PORT"
+
+qpid-send -b $URL --content-string=hello -a "foo;{create:always}"
+MSG=`qpid-receive -b $URL -a "foo;{create:always}" --messages 1`
+test "$MSG" = "hello" || { echo "receive failed '$MSG' != 'hello'"; exit 1; }
+
+stop_brokers
+
+# Federation smoke test follows
+
+# Start 2 brokers
+
+start_brokers 2
+echo "Started Federated brokers on ports ${PORTS[*]}"
+# Make broker urls
+BROKER0="[::1]:${PORTS[0]}"
+BROKER1="[::1]:${PORTS[1]}"
+TEST_QUEUE=ipv6-fed-test
+
+qpid-config -b $BROKER0 add queue $TEST_QUEUE
+qpid-config -b $BROKER1 add queue $TEST_QUEUE
+qpid-route dynamic add $BROKER1 $BROKER0 amq.direct
+qpid-config -b $BROKER1 bind amq.direct $TEST_QUEUE $TEST_QUEUE
+qpid-route route map $BROKER1
+
+datagen --count 100 | tee rdata-in |
+    ./qpid-send -b amqp:$BROKER0 -a amq.direct/$TEST_QUEUE --content-stdin
+qpid-receive -b amqp:$BROKER1 -a $TEST_QUEUE --print-content yes -m 0 > rdata-out
+
+cmp rdata-in rdata-out || { echo "Federated data over IPv6 does not compare"; exit 1; }
+
+stop_brokers
+rm rdata-in rdata-out

Propchange: qpid/trunk/qpid/cpp/src/tests/run_ipv6_tests
------------------------------------------------------------------------------
    svn:executable = *

Added: qpid/trunk/qpid/cpp/src/tests/run_logging_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_logging_tests?rev=1740289&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_logging_tests (added)
+++ qpid/trunk/qpid/cpp/src/tests/run_logging_tests Thu Apr 21 12:31:34 2016
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -eu
+
+source env.sh
+
+export WORK_DIR=$(mktemp -d $PWD/run_logging_tests_XXXX)
+
+exit_code=0
+
+dynamic_log_hires_timestamp || exit_code=1
+dynamic_log_level_test || exit_code=1
+
+if (( exit_code != 0 )); then
+    echo "Logging test failures"
+    exit $exit_code
+fi
+
+rm -rf $WORK_DIR

Propchange: qpid/trunk/qpid/cpp/src/tests/run_logging_tests
------------------------------------------------------------------------------
    svn:executable = *

Modified: qpid/trunk/qpid/cpp/src/tests/run_long_federation_sys_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_long_federation_sys_tests?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_long_federation_sys_tests (original)
+++ qpid/trunk/qpid/cpp/src/tests/run_long_federation_sys_tests Thu Apr 21 12:31:34 2016
@@ -21,4 +21,4 @@
 
 # Run the federation system tests (long version).
 
-./run_federation_sys_tests LONG_TEST $@
+USE_LONG_TEST=1 ./run_federation_sys_tests $@

Modified: qpid/trunk/qpid/cpp/src/tests/run_msg_group_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_msg_group_tests?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_msg_group_tests (original)
+++ qpid/trunk/qpid/cpp/src/tests/run_msg_group_tests Thu Apr 21 12:31:34 2016
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env python
 
 #
 # Licensed to the Apache Software Foundation (ASF) under one
@@ -18,45 +18,30 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-#script to run a sequence of message group queue tests via make
 
-source $QPID_TEST_COMMON
+from common import *
 
-ensure_python_tests
+port = start_broker("broker")
 
-QUEUE_NAME="group-queue"
-GROUP_KEY="My-Group-Id"
+commands = [
+    "qpid-config -b {} add queue group-queue --group-header=My-Group-Id --shared-groups",
+    "msg_group_test -b {} -a group-queue --group-key My-Group-Id --messages 103 --group-size 13 --receivers 2 --senders 3 --capacity 3 --ack-frequency 7 --randomize-group-size --interleave 3",
+    "msg_group_test -b {} -a group-queue --group-key My-Group-Id --messages 103 --group-size 13 --receivers 2 --senders 3 --capacity 7 --ack-frequency 7 --randomize-group-size",
+    "qpid-config -b {} add queue group-queue-two --group-header=My-Group-Id --shared-groups",
+    "msg_group_test -b {} -a group-queue --group-key My-Group-Id --messages 103 --group-size 13 --receivers 2 --senders 3 --capacity 7 --ack-frequency 3 --randomize-group-size",
+    "msg_group_test -b {} -a group-queue-two --group-key My-Group-Id --messages 103 --group-size 13 --receivers 2 --senders 3 --capacity 3 --ack-frequency 7 --randomize-group-size --interleave 5",
+    "msg_group_test -b {} -a group-queue --group-key My-Group-Id --messages 59  --group-size 5  --receivers 2 --senders 3 --capacity 1 --ack-frequency 3 --randomize-group-size",
+    "qpid-config -b {} del queue group-queue-two --force",
+    "msg_group_test -b {} -a group-queue --group-key My-Group-Id --messages 59  --group-size 3  --receivers 2 --senders 3 --capacity 1 --ack-frequency 1 --randomize-group-size",
+    "msg_group_test -b {} -a group-queue --group-key My-Group-Id --messages 211 --group-size 13 --receivers 2 --senders 3 --capacity 47 --ack-frequency 79 --interleave 53",
+    "msg_group_test -b {} -a group-queue --group-key My-Group-Id --messages 10000  --group-size 1 --receivers 0 --senders 1",
+    "msg_group_test -b {} -a group-queue --group-key My-Group-Id --messages 10000  --receivers 5 --senders 0",
+    "qpid-config -b {} del queue group-queue --force",
+]
 
-BROKER_URL="${QPID_BROKER:-localhost}:${QPID_PORT:-5672}"
-
-run_test() {
-    "$@"
-}
-
-##set -x
-
-declare -i i=0
-declare -a tests
-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 -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 -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 -b $BROKER_URL del queue $QUEUE_NAME --force")
-
-while [ -n "${tests[i]}" ]; do
-    run_test ${tests[i]}
-    RETCODE=$?
-    if test x$RETCODE != x0; then
-        echo "FAILED message group test.  Failed command: \"${tests[i]}\"";
-        exit 1;
-    fi
-    i+=1
-done
+address = "localhost:{}".format(port)
+
+for command in commands:
+    call(command, address)
+
+check_results()

Modified: qpid/trunk/qpid/cpp/src/tests/run_msg_group_tests_soak
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_msg_group_tests_soak?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_msg_group_tests_soak (original)
+++ qpid/trunk/qpid/cpp/src/tests/run_msg_group_tests_soak Thu Apr 21 12:31:34 2016
@@ -18,13 +18,11 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-#script to run a sequence of long-running message group tests via make
 
-#setup path to find qpid-config and msg_group_test test progs
-source ./test_env.sh
-test -d $PYTHON_DIR || { echo "Skipping message group tests, no python dir."; exit 0; }
+# Script to run a sequence of long-running message group tests via
+# make
 
-export PATH=$PWD:$srcdir:$PYTHON_COMMANDS:$PATH
+source env.sh
 
 #set port to connect to via env var
 test -s qpidd.port && QPID_PORT=`cat qpidd.port`

Modified: qpid/trunk/qpid/cpp/src/tests/run_paged_queue_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_paged_queue_tests?rev=1740289&r1=1740288&r2=1740289&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_paged_queue_tests (original)
+++ qpid/trunk/qpid/cpp/src/tests/run_paged_queue_tests Thu Apr 21 12:31:34 2016
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env python
 
 #
 # Licensed to the Apache Software Foundation (ASF) under one
@@ -19,32 +19,27 @@
 # under the License.
 #
 
-#setup path to find qpid-config and sender/receiver test progs
-source ./test_env.sh
-trap stop_broker INT TERM QUIT
-
-export PATH=$PWD:$srcdir:$PYTHON_COMMANDS:$PATH
-
-start_broker() {
-    QPID_PORT=$($QPIDD_EXEC --daemon --port 0 --interface 127.0.0.1 --no-data-dir --paging-dir=$PWD/pqtest_data $MODULES --auth no) || { echo "Could not start broker"; exit 1; }
-}
-
-stop_broker() {
-    $QPIDD_EXEC -q --port $QPID_PORT
-}
-
-test_single_page() {
-    msgcount=1000
-    qpid-send --messages $msgcount --content-size 1024 --broker "localhost:$QPID_PORT" --address "onepage; {create: always, node:{x-declare:{arguments:{'qpid.paging':True,'qpid.max_pages_loaded':1}}}}"
-    received=$(qpid-receive --address onepage --broker "localhost:$QPID_PORT" --messages $msgcount | wc -l)
-    if [[ $received -ne $msgcount ]]; then
-        echo "single page test failed: received $received messages, expected $msgcount"
-        exit 1
-    fi
-}
-
-start_broker
-test_single_page
-qpid-cpp-benchmark --broker "localhost:$QPID_PORT" --create-option "node:{x-declare:{arguments:{'qpid.paging':True,'qpid.max_size':0,'qpid.max_count':0,'qpid.flow_stop_size':0,'qpid.flow_resume_size':0,'qpid.flow_stop_count':0,'qpid.flow_resume_count':0}}}"
-qpid-cpp-benchmark --broker "localhost:$QPID_PORT" --create-option "node:{x-declare:{arguments:{'qpid.paging':True,'qpid.max_size':0,'qpid.max_count':0,'qpid.flow_stop_size':0,'qpid.flow_resume_size':0,'qpid.flow_stop_count':0,'qpid.flow_resume_count':0}}}" --fill-drain
-stop_broker
+from common import *
+
+port = start_broker("broker", "--paging-dir={}".format(join(WORK_DIR, "pqtest_data")))
+
+messages = 1000
+address = "onepage; {create: always, node:{x-declare:{arguments:{'qpid.paging':True,'qpid.max_pages_loaded':1}}}}"
+
+call_with_valgrind("qpid-send --messages {} --content-size 1024 --broker localhost:{} --address \"{}\"",
+                   messages, port, address)
+
+output = call_for_output_with_valgrind("qpid-receive --address onepage --messages {} --broker localhost:{}",
+                                       messages, port)
+
+received = len(output.splitlines())
+
+if received != messages:
+    fail("Single page test failed: received {} messages, expected {}", received, messages)
+
+option = "node:{x-declare:{arguments:{'qpid.paging':True,'qpid.max_size':0,'qpid.max_count':0,'qpid.flow_stop_size':0,'qpid.flow_resume_size':0,'qpid.flow_stop_count':0,'qpid.flow_resume_count':0}}}"
+    
+call("qpid-cpp-benchmark --broker localhost:{} --create-option \"{}\"", port, option)
+call("qpid-cpp-benchmark --broker localhost:{} --create-option \"{}\" --fill-drain", port, option)
+
+check_results()

Added: qpid/trunk/qpid/cpp/src/tests/run_performance_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_performance_tests?rev=1740289&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_performance_tests (added)
+++ qpid/trunk/qpid/cpp/src/tests/run_performance_tests Thu Apr 21 12:31:34 2016
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+from common import *
+
+port = start_broker("broker")
+
+call_with_valgrind("qpid-perftest --summary --count 100 --port {}", port)
+
+check_results()

Propchange: qpid/trunk/qpid/cpp/src/tests/run_performance_tests
------------------------------------------------------------------------------
    svn:executable = *

Added: qpid/trunk/qpid/cpp/src/tests/run_python_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_python_tests?rev=1740289&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_python_tests (added)
+++ qpid/trunk/qpid/cpp/src/tests/run_python_tests Thu Apr 21 12:31:34 2016
@@ -0,0 +1,62 @@
+#!/usr/bin/env python
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+from common import *
+
+load_module_arg = None
+
+if AMQP_LIB is not None:
+    load_module_arg = "--load-module {}".format(AMQP_LIB)
+
+acl_file = join(BUILD_DIR, "src", "tests", "policy.acl")
+acl_file_arg = "--acl-file {}".format(acl_file)
+
+port = start_broker("broker", load_module_arg, acl_file_arg)
+
+# Native python tests
+
+run_broker_tests(port, "-m qpid_tests.broker_0_10 -m qpid.tests")
+
+# Swigged python tests
+
+failing_tests = join(BUILD_DIR, "src", "tests", "failing-amqp0-10-python-tests")
+
+ENV["QPID_USE_SWIG_CLIENT"] = "1"
+
+run_broker_tests(port, 
+                 "-m qpid.tests.messaging.message",
+                 "-m qpid_tests.broker_0_10.priority",
+                 "-m qpid_tests.broker_0_10.lvq",
+                 "-m qpid_tests.broker_0_10.new_api",
+                 "-I {}".format(failing_tests))
+
+if AMQP_LIB is not None:
+    failing_tests = join(BUILD_DIR, "src", "tests", "failing-amqp1.0-python-tests")
+
+    run_broker_tests(port,
+                     "--define=\"protocol_version=amqp1.0\"",
+                     "--define=\"policy_file={}\"".format(acl_file),
+                     "-m qpid_tests.broker_1_0",
+                     "-m qpid_tests.broker_0_10.new_api",
+                     "-m assertions -m reject_release -m misc -m policies -m acl_1",
+                     "-I {}".format(failing_tests))
+
+check_results()

Propchange: qpid/trunk/qpid/cpp/src/tests/run_python_tests
------------------------------------------------------------------------------
    svn:executable = *

Added: qpid/trunk/qpid/cpp/src/tests/run_qmf_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_qmf_tests?rev=1740289&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_qmf_tests (added)
+++ qpid/trunk/qpid/cpp/src/tests/run_qmf_tests Thu Apr 21 12:31:34 2016
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+from common import *
+
+call("qpid-python-test -m qpidd_qmfv2_tests -DOUTDIR={}", WORK_DIR)
+
+check_results()

Propchange: qpid/trunk/qpid/cpp/src/tests/run_qmf_tests
------------------------------------------------------------------------------
    svn:executable = *

Added: qpid/trunk/qpid/cpp/src/tests/run_queue_redirect_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_queue_redirect_tests?rev=1740289&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_queue_redirect_tests (added)
+++ qpid/trunk/qpid/cpp/src/tests/run_queue_redirect_tests Thu Apr 21 12:31:34 2016
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+from common import *
+
+policy_file = join(BUILD_DIR, "src", "tests", "policy.acl")
+
+port = start_broker("broker", "--acl-file {}".format(policy_file), "--log-enable debug+:Model")
+
+run_broker_tests(port, "-m queue_redirect", "-Dpolicy-file={}".format(policy_file))
+
+check_results()

Added: qpid/trunk/qpid/cpp/src/tests/run_ring_queue_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_ring_queue_tests?rev=1740289&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_ring_queue_tests (added)
+++ qpid/trunk/qpid/cpp/src/tests/run_ring_queue_tests Thu Apr 21 12:31:34 2016
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+from common import *
+
+ENV["QPID_PORT"] = start_broker("broker")
+
+call("ring_queue_test -c -s 4 -r 4")
+call("ring_queue_test -s 4 -r 0")
+call("ring_queue_test -s 1 -r 1")
+
+check_results()

Propchange: qpid/trunk/qpid/cpp/src/tests/run_ring_queue_tests
------------------------------------------------------------------------------
    svn:executable = *

Added: qpid/trunk/qpid/cpp/src/tests/run_sasl_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_sasl_tests?rev=1740289&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_sasl_tests (added)
+++ qpid/trunk/qpid/cpp/src/tests/run_sasl_tests Thu Apr 21 12:31:34 2016
@@ -0,0 +1,64 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -eu
+
+source env.sh
+
+export WORK_DIR=$(mktemp -d $PWD/run_sasl_tests_XXXX)
+
+echo "Created work dir '${WORK_DIR}'"
+
+min_sasl_version=131350 # Sasl version 2.1.22
+sasl_version=$(sasl_version)
+
+if (( $sasl_version < min_sasl_version )); then
+    echo "Sasl version is too old; found $version; require $min_version or greater"
+    echo "SKIPPING"
+    exit 0
+fi
+
+exit_code=0
+
+function fail {
+    echo "FAILED! ${1}"
+    exit_code=1
+}
+
+echo "# Running sasl_fed"
+sasl_fed || fail "Test sasl_fed failed"
+echo "# Running sasl_fed_ex dynamic"
+sasl_fed_ex dynamic || fail "Test sasl_fed_ex dynamic failed"
+echo "# Running sasl_fed_ex link"
+sasl_fed_ex link || fail "Test sasl_fed_ex link failed"
+echo "# Running sasl_fed_ex queue"
+sasl_fed_ex queue || fail "Test sasl_fed_ex queue failed"
+echo "# Running sasl_fed_ex route"
+sasl_fed_ex route || fail "Test sasl_fed_ex route failed"
+echo "# Running sasl_no_dir"
+sasl_no_dir || fail "Test sasl_no_dir failed"
+
+if (( exit_code != 0 )); then
+    echo "SASL test failures"
+    exit $exit_code
+fi
+
+rm -rf $WORK_DIR

Propchange: qpid/trunk/qpid/cpp/src/tests/run_sasl_tests
------------------------------------------------------------------------------
    svn:executable = *



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