summaryrefslogtreecommitdiff
path: root/test-swaks.sh
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2013-09-03 15:09:39 +0200
committervarac <varacanero@zeromail.org>2013-09-03 15:09:39 +0200
commitac627aacf00c2f888f21c6f108931dea38260f73 (patch)
tree0f3b0c06653c95a0c05102d9b7e73d39f2b5b93a /test-swaks.sh
parent4de9cbe5ddcdc688d6723262728dc4d86c898afa (diff)
reorganized directory layout
Diffstat (limited to 'test-swaks.sh')
-rwxr-xr-xtest-swaks.sh73
1 files changed, 0 insertions, 73 deletions
diff --git a/test-swaks.sh b/test-swaks.sh
deleted file mode 100755
index 9f521b9..0000000
--- a/test-swaks.sh
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/bash
-
-local='dummy@bitmask.net'
-nobody_local='fooooooo@bitmask.net'
-external='dummy@leap.se'
-server='leech.bitmask.net'
-exit_code=0
-
-# override $server with possible exported shell var
-[ $SWAKS_SERVER ] && server=$SWAKS_SERVER
-
-swaks_options="--timeout 5 --server $server --hide-informational --suppress-data"
-swaks_auth="--tlsc --tls-cert $HOME/leap/test/certs/cert.crt --tls-key $HOME/leap/test/certs/cert.key"
-
-echo "swaks_options: $swaks_options"
-echo "swaks_auth : $swaks_auth"
-echo
-
-test_swaks() {
- local from=$1
- shift
- local to=$1
- shift
- local expected_repsonse_code=$1
- shift
- local options="$@"
-
- response=`swaks -f $from -t $to $options | tail -3 | head -1`
- response_code=`echo "$response"| cut -d' ' -f 2-|sed 's/^ //g'|cut -d' ' -f 1 `
- if [ "$response_code" == "$expected_repsonse_code" ]
- then
- echo -n 'OK: '
- else
- echo -n 'WARNING: '
- exit_code=1
- fi
-
- [[ "$options" == *--tls* ]] && authentication='authenticated ' || authentication='no authentication'
- [ ]
- echo "From $from, to $to, $authentication: $response"
-}
-
-
-test_delivery() {
- local from=$1
- local to=$2
- local unauth_repsonse_code=$3
- local auth_response_code=$4
-
- test_swaks $from $to $unauth_repsonse_code $swaks_options
- test_swaks $from $to $auth_response_code $swaks_options $swaks_auth
-
- echo
-}
-
-
-test_delivery $local $local 250 250
-test_delivery $local $nobody_local 550 550
-test_delivery $local $external 554 250
-
-echo
-
-test_delivery $nobody_local $local 250 250
-test_delivery $nobody_local $nobody_local 550 550
-test_delivery $nobody_local $external 554 250
-
-echo
-
-test_delivery $external $local 250 250
-test_delivery $external $nobody_local 550 550
-test_delivery $external $external 554 250
-
-exit $exit_code