diff --git a/drydocker/guam/tests/test_003_many_more_folders.sh b/drydocker/guam/tests/test_003_many_more_folders.sh index 4b4c12a..1d0194d 100755 --- a/drydocker/guam/tests/test_003_many_more_folders.sh +++ b/drydocker/guam/tests/test_003_many_more_folders.sh @@ -1,128 +1,146 @@ #!/bin/bash set -x for i in `seq 11 30`; do ( sleep 1; echo "1"; echo ""; echo "John"; echo "Doe${i}"; echo ""; ) | kolab add-user ( echo "dn: uid=doe${i},ou=People,dc=example,dc=org" echo "changetype: modify" echo "replace: userPassword" echo "userPassword: Welcome2KolabSystems" echo "" ) | ldapmodify -x -h localhost -D "cn=Directory Manager" -w Welcome2KolabSystems done while [ $(timeout 10s kolab lm user/john.doe*@example.org 2>/dev/null | wc -l) -lt 300 ]; do echo "Waiting for folders to be created ..." >&3 sleep 10 done kolab sam user/john.doe*@example.org anyone lrs for i in `seq 101 450`; do kolab cm shared/lists/list${i}@example.org kolab sam shared/lists/list${i}@example.org anyone lrs done for team in Sales Marketing Engineering Accounting HR Legal; do kolab cm --metadata=/shared/vendor/kolab/folder-type=event shared/${team}/Calendar@example.org done for i in `seq 1 10`; do foldername="shared/$(head -c 500 /dev/urandom | tr -dc _A-Z-a-z-0-9)@example.org" kolab cm ${foldername} kolab sam ${foldername} anyone lrs done result_retval=0 +echo ". LIST \"\" \"*\"" | timeout 10s imtest -t "" -u john.doe11@example.org -a john.doe11@example.org -w Welcome2KolabSystems -p 9143 localhost; 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:" >&3 + + echo ". LIST \"\" \"*\"" | timeout 10s imtest -t "" -u john.doe11@example.org -a john.doe11@example.org -w Welcome2KolabSystems -p 143 localhost; 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 -t "" -u cyrus-admin -a cyrus-admin -w $(grep ^admin_password /etc/kolab/kolab.conf | awk '{print $3}') -p 9143 localhost; 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:" >&3 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; 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; 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:" >&3 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; 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 "" >&3 echo "== START /var/log/guam/${log_file} ==" >&3 cat /var/log/guam/${log_file} >&3 echo "== END /var/log/guam/${log_file} ==" >&3 echo "" >&3 fi done fi for i in `seq 11 30`; do echo "uid=doe${i},ou=People,dc=example,dc=org" done | ldapdelete -x -h localhost -D "cn=Directory Manager" -w Welcome2KolabSystems -c 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