summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/run_acl_tests
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2008-10-22 03:29:32 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2008-10-22 03:29:32 +0000
commite2f72f2bdbe5a9dfc826f684fc03e23faa3e8140 (patch)
treedd045902a2a9689e1bb4f2782abe5f12a8147f13 /qpid/cpp/src/tests/run_acl_tests
parent8cdcb48458906c833772b2d3a497f87c33c1c7dd (diff)
downloadqpid-python-e2f72f2bdbe5a9dfc826f684fc03e23faa3e8140.tar.gz
This is for QPID-1363
These tests creates an acl file and use the acl.reloadAclFile method to reconfigure the broker. The tests are run as part of make check git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@706850 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/run_acl_tests')
-rwxr-xr-xqpid/cpp/src/tests/run_acl_tests32
1 files changed, 32 insertions, 0 deletions
diff --git a/qpid/cpp/src/tests/run_acl_tests b/qpid/cpp/src/tests/run_acl_tests
new file mode 100755
index 0000000000..a6a6ca160e
--- /dev/null
+++ b/qpid/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
+