From cf7328bbcf611e04975e3acb75c6d687c890cb69 Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 22 Dec 2016 15:57:38 +0100 Subject: [test] look for mail we just send --- tests/e2e/e2e-test.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/e2e/e2e-test.sh b/tests/e2e/e2e-test.sh index 96c211d..598b71f 100755 --- a/tests/e2e/e2e-test.sh +++ b/tests/e2e/e2e-test.sh @@ -15,19 +15,19 @@ set -e PROVIDER='cdev.bitmask.net' BCTL='bitmaskctl' -LEAP_HOME='~/.config/leap' +LEAP_HOME="$HOME/.config/leap" MAIL_UUID=$(uuidgen) username="tmp_user_$(date +%Y%m%d%H%M%S)" user="${username}@${PROVIDER}" pw="$(head -c 10 < /dev/urandom | base64)" -SWAKS="swaks -t $user --header-X-MAIL-UUID \"$MAIL_UUID\"" +SWAKS="swaks -t $user --h-Subject $MAIL_UUID" # Stop any previously started bitmaskd # and start a new instance "$BCTL" stop -rm -rf $LEAP_HOME +rm -rf "$LEAP_HOME" "$BCTL" start @@ -52,12 +52,17 @@ while [[ $imap_pw == *"None"* ]]; do imap_pw=$(echo "$response" | head -n 1 | sed 's/ */ /g' | cut -d' ' -f 2) done - $SWAKS $FROM_EXTERNAL_OPTS echo "IMAP/SMTP PASSWD: $imap_pw" +# Send testmail +$SWAKS $FROM_EXTERNAL_OPTS + +# XXX wait until we the get mail we just sent. -# XXX get mail we just sent. -./getmail --mailbox INBOX --subject "my_unique_subject" $user $imap_pw +while [[ ! $(./getmail --mailbox INBOX --subject "$MAIL_UUID" $user $imap_pw) ]] +do + sleep 10 +done -- cgit v1.2.3