summaryrefslogtreecommitdiff
path: root/cpp/src/tests/run_acl_tests
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/tests/run_acl_tests')
-rwxr-xr-xcpp/src/tests/run_acl_tests32
1 files changed, 32 insertions, 0 deletions
diff --git a/cpp/src/tests/run_acl_tests b/cpp/src/tests/run_acl_tests
new file mode 100755
index 0000000000..a6a6ca160e
--- /dev/null
+++ b/cpp/src/tests/run_acl_tests
@@ -0,0 +1,32 @@
+#!/bin/sh
+# Run the acl tests.
+MY_DIR=`dirname \`which $0\``
+PYTHON_DIR=${MY_DIR}/../../../python
+
+trap stop_brokers INT TERM QUIT
+
+start_brokers() {
+ ../qpidd --daemon --port 0 --data-dir ${MY_DIR}/data_dir --load-module ../.libs/acl.so --enforce-acl --auth no > qpidd.port
+ LOCAL_PORT=`cat qpidd.port`
+}
+
+stop_brokers() {
+ ../qpidd -q --port $LOCAL_PORT
+}
+
+if test -d ${PYTHON_DIR} ; then
+ mkdir ${MY_DIR}/data_dir
+ cp ${MY_DIR}/policy.acl ${MY_DIR}/data_dir/
+ start_brokers
+ echo "Running acl tests using brokers on ports $LOCAL_PORT"
+ PYTHONPATH=${PYTHON_DIR}
+ export PYTHONPATH
+ ${MY_DIR}/acl.py -v -s ${MY_DIR}/../../../specs/amqp.0-10-qpid-errata.xml -b localhost:$LOCAL_PORT --port $LOCAL_PORT
+ RETCODE=$?
+ stop_brokers
+ if test x$RETCODE != x0; then
+ echo "FAIL acl tests"; exit 1;
+ fi
+ rm -rf ${MY_DIR}/data_dir
+fi
+