blob: ed06f19fd3eac58a1a7f81acbe00713226807718 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#!/bin/sh
# Run a simple test over SSL
MY_DIR=$(dirname $(which $0))
CERT_DIR=${MY_DIR}/test_cert_db
CERT_PW_FILE=${MY_DIR}/cert.password
HOSTNAME=`hostname`
COUNT=10000
trap stop_broker EXIT
error() { echo $*; exit 1; }
create_certs() {
#create certificate and key databases with single, simple, self-signed certificate in it
mkdir ${CERT_DIR}
certutil -N -d ${CERT_DIR} -f ${CERT_PW_FILE}
certutil -S -d ${CERT_DIR} -n ${HOSTNAME} -s "CN=${HOSTNAME}" -t "CT,," -x -f ${CERT_PW_FILE} -z /usr/bin/certutil
}
start_broker() {
${MY_DIR}/../qpidd --daemon --transport ssl --port 0 --ssl-port 0 --no-data-dir --no-module-dir --auth no\
--load-module ${MY_DIR}/../.libs/ssl.so --ssl-cert-db $CERT_DIR --ssl-cert-password-file $CERT_PW_FILE > qpidd.port
PORT=`cat qpidd.port`
}
stop_broker() {
${MY_DIR}/../qpidd -q --port $PORT
}
if [[ !(-e ${CERT_PW_FILE}) ]] ; then
echo password > ${CERT_PW_FILE}
fi
if [[ !(-e ${CERT_DIR}) ]] ; then
create_certs || error "Could not create test certificate"
fi
start_broker || error "Could not start broker"
echo "Running SSL test on port $PORT"
export QPID_LOAD_MODULE=${MY_DIR}/../.libs/sslconnector.so
export QPID_SSL_CERT_DB=${CERT_DIR}
export QPID_SSL_CERT_PASSWORD_FILE=${CERT_PW_FILE}
${MY_DIR}/perftest --count ${COUNT} --port ${PORT} -P ssl -b $HOSTNAME --summary
|