#!/bin/bash # # Usage: setup-test-env-qpid.sh PROTOCOL # where PROTOCOL is the version of the AMQP protocol to use with # qpidd. Valid values for PROTOCOL are "1", "1.0", "0-10", "0.10" set -e # require qpidd, qpid-tools sasl2-bin/cyrus-sasl-plain+cyrus-sasl-lib . tools/functions.sh DATADIR=$(mktemp -d /tmp/OSLOMSG-QPID.XXXXX) trap "clean_exit $DATADIR" EXIT QPIDD=$(which qpidd 2>/dev/null) # which protocol should be used with qpidd? # 1 for AMQP 1.0, 0.10 for AMQP 0.10 # PROTOCOL=$1 case $PROTOCOL in "1" | "1.0") PROTOCOL="1" shift ;; "0.10" | "0-10") PROTOCOL="0-10" shift ;; *) # assume the old protocol echo "No protocol specified, assuming 0.10" PROTOCOL="0-10" ;; esac # ensure that the version of qpidd does support AMQP 1.0 if [ $PROTOCOL == "1" ] && ! `$QPIDD --help | grep -q "queue-patterns"`; then echo "This version of $QPIDD does not support AMQP 1.0" exit 1 fi [ -f "/usr/lib/qpid/daemon/acl.so" ] && LIBACL="load-module=/usr/lib/qpid/daemon/acl.so" cat > ${DATADIR}/qpidd.conf <=0.10). If this version of qpidd does # not support the fix, then do not require authentication if [ $PROTOCOL == "1" ] && ! `$QPIDD --help | grep -q "sasl-service-name"`; then echo "This version of $QPIDD does not support SASL authentication with AMQP 1.0" cat >> ${DATADIR}/qpidd.conf <> ${DATADIR}/qpidd.conf <> ${DATADIR}/qpidd.conf <0.32 require this for AMQP 1 and SASL: if `$QPIDD --help | grep -q "sasl-service-name"`; then cat >> ${DATADIR}/qpidd.conf < ${DATADIR}/qpidd.acl < ${DATADIR}/sasl2/qpidd.conf <> ${DATADIR}/sasl2/qpidd.conf <> ${DATADIR}/sasl2/qpidd.conf <