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
|
#!/bin/sh
set -efu
if [ -z "$AUTOPKGTEST_TMP" ]; then
AUTOPKGTEST_TMP=tmp
mkdir -p ${AUTOPKGTEST_TMP}
fi
SRCDIR=$(pwd)
cp -rv ${SRCDIR}/debian/tests ${AUTOPKGTEST_TMP}
cd ${AUTOPKGTEST_TMP}/tests
#get cert fingerprint
fingerprint=`openssl x509 -noout -fingerprint -sha256 -inform pem -in /etc/dovecot/private/dovecot.pem | cut -d '=' -f2`
#start dovecot if its not running
if [ ! -f /run/dovecot/master.pid ]; then
dovecot
fi
sleep 5
# wait for dovecot to start running
for i in `seq 1 5`; do
doveadm -f flow instance list | grep -q 'running=yes'
if [ $? -eq 0 ]; then
break
fi
sleep 5
done
sleep 1
python3 -c "import imaplib2; imaplib2.IMAP4_SSL(host='localhost')"
dovecot stop
|