summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2016-12-22 15:57:38 +0100
committerKali Kaneko (leap communications) <kali@leap.se>2016-12-26 14:55:43 +0100
commitcf7328bbcf611e04975e3acb75c6d687c890cb69 (patch)
treed759dfa5c88a61eb9696d44bf229d86b7b716710 /tests
parent0f5eb825c5654a718c1f4f2fd3a9ac2f0efad395 (diff)
[test] look for mail we just send
Diffstat (limited to 'tests')
-rwxr-xr-xtests/e2e/e2e-test.sh17
1 files 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