diff --git a/drydocker/guam/test_integration.sh b/drydocker/guam/test_integration.sh index 77ef1e1..a2c80ff 100755 --- a/drydocker/guam/test_integration.sh +++ b/drydocker/guam/test_integration.sh @@ -1,71 +1,125 @@ #!/bin/bash source /srv/stick.git/drydocker/generic_integration.sh # This installs Kolab Groupware retval=$(_shell generic_integration_install) # This sets up Kolab Groupware retval=$(_shell generic_integration_setup) set -x if [ ! -f "/etc/pki/tls/private/localhost.pem" ]; then pushd /etc/pki/tls/certs/ ./make-dummy-cert ../private/localhost.pem popd fi ( sleep 1; echo "1"; echo ""; echo "John"; echo "Doe"; echo ""; ) | kolab add-user while [ $(timeout 10s kolab lm user/john.doe*@example.org 2>/dev/null | wc -l) -lt 15 ]; do echo "Waiting for folders to be created ..." >&3 sleep 10 done sed -e 's/:993/:9993/g' \ /etc/kolab/kolab.conf > /etc/kolab/kolab.guam.conf guam start sleep 10 -retval=0 +result_retval=0 -echo ". LIST \"\" \"*\"" | timeout 10s imtest -t "" -u cyrus-admin -a cyrus-admin -w $(grep ^admin_password /etc/kolab/kolab.conf | awk '{print $3}') -p 9143 localhost ; retval=$(( ${retval} + $? )) +echo ". LIST \"\" \"*\"" | timeout 10s imtest -t "" -u cyrus-admin -a cyrus-admin -w $(grep ^admin_password /etc/kolab/kolab.conf | awk '{print $3}') -p 9143 localhost >&3 2>&3; retval=$? -echo ". LIST \"\" \"*\"" | timeout 10s imtest -s -u cyrus-admin -a cyrus-admin -w $(grep ^admin_password /etc/kolab/kolab.conf | awk '{print $3}') -p 9993 localhost ; retval=$(( ${retval} + $? )) +if [ ${retval} -ne 0 ]; then + echo "Listing folders using a STARTTLS connection failed." >&3 + + if [ ${retval} -eq 124 ]; then + echo "Since it was because of a timeout, here's the results for a direct IMAP connection:" + + echo ". LIST \"\" \"*\"" | timeout 10s imtest -t "" -u cyrus-admin -a cyrus-admin -w $(grep ^admin_password /etc/kolab/kolab.conf | awk '{print $3}') -p 143 localhost >&3 2>&3; retval2=$? + + if [ ${retval2} -ne 0 ]; then + echo "That fails too?" >&3 + else + result_retval=$(( ${result_retval} + ${retval} )) + fi + fi +fi + +echo ". LIST \"\" \"*\"" | timeout 10s imtest -s -u cyrus-admin -a cyrus-admin -w $(grep ^admin_password /etc/kolab/kolab.conf | awk '{print $3}') -p 9993 localhost >&3 2>&3; retval=$? + +if [ ${retval} -ne 0 ]; then + echo "Listing folders using an SSL connection failed." >&3 + + if [ ${retval} -eq 124 ]; then + echo "Since it was because of a timeout, here's the results for a direct IMAP connection:" + + echo ". LIST \"\" \"*\"" | timeout 10s imtest -s -u cyrus-admin -a cyrus-admin -w $(grep ^admin_password /etc/kolab/kolab.conf | awk '{print $3}') -p 993 localhost >&3 2>&3; retval2=$? + + if [ ${retval2} -ne 0 ]; then + echo "That fails too?" >&3 + else + result_retval=$(( ${result_retval} + ${retval} )) + fi + fi +fi + +retval=${result_retval} + +if [ ${retval} -ne 0 ]; then + echo "Initial testing failed, here's some additional input for developers:" >&3 + + echo "== START /etc/guam/sys.config ==" >&3 + cat /etc/guam/sys.config >&3 + echo "== END /etc/guam/sys.config ==" >&3 + + echo "" + + for log_file in console.log crash.log erlang.log.1 error.log run_erl.log; do + if [ -f "/var/log/guam/${log_file}" ]; then + echo "== START /var/log/guam/${log_file} ==" >&3 + cat /var/log/guam/${log_file} >&3 + echo "== END /var/log/guam/${log_file} ==" >&3 + + echo "" + fi + done +fi guam stop killall -9 epmd echo "uid=doe,ou=People,dc=example,dc=org" | ldapdelete -x -h localhost -D "cn=Directory Manager" -w Welcome2KolabSystems while [ $(timeout 10s kolab lm user/john.doe*@example.org 2>/dev/null | wc -l) -gt 0 ]; do echo "Waiting for folders to be removed ..." >&3 sleep 10 done echo "Cleaning out IMAP folders ..." >&3 while [ $(timeout 180s kolab lm 2>/dev/null | wc -l) -gt 0 ]; do kolab lm | while read folder; do kolab dm "${folder}" done done set - -x if [ ${retval} -ne 0 ]; then exit ${retval} fi popd