X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/f0beecb5ab89a3e2e2913919f304b1dcdee53a66..7934d6196251675f4d2ab6c2e4efae42e9c1192a:/test/oauth/test-send diff --git a/test/oauth/test-send b/test/oauth/test-send index 1c5ae4bf..4c7a335c 100755 --- a/test/oauth/test-send +++ b/test/oauth/test-send @@ -24,7 +24,7 @@ export XOAUTH XOAUTH='dXNlcj1ub2JvZHlAZXhhbXBsZS5jb20BYXV0aD1CZWFyZXIgdGVzdC1hY2Nlc3MBAQ==' # TEST -echo 'access token ready, smtp server accepts message' +start_test 'access token ready, smtp server accepts message' setup_draft @@ -35,10 +35,10 @@ expire: 2000000000 EOF start_fakesmtp -run_test "send -draft -server 127.0.0.1 -port ${smtp_port} -oauth test -user nobody@example.com" +run_test "send -draft -server 127.0.0.1 -port ${smtp_port} -saslmech xoauth2 -authservice test -user nobody@example.com" # TEST -echo 'expired access token, refresh works, smtp server accepts message' +start_test 'expired access token, refresh works, smtp server accepts message' setup_draft @@ -70,7 +70,7 @@ check_creds_private check_creds # TEST -echo 'expired access token, refresh works and gets updated, smtp server accepts message' +start_test 'expired access token, refresh works and gets updated, smtp server accepts message' setup_draft @@ -100,7 +100,7 @@ test_send check_creds # TEST -echo 'access token has no expiration, refresh works, smtp server accepts message' +start_test 'access token has no expiration, refresh works, smtp server accepts message' setup_draft @@ -128,7 +128,7 @@ test_send check_creds # TEST -echo 'no access token, refresh works, smtp server accepts message' +start_test 'no access token, refresh works, smtp server accepts message' setup_draft @@ -161,26 +161,26 @@ check_creds setup_draft # TEST -echo 'no service definition' +start_test 'no service definition' -run_test "send -draft -server 127.0.0.1 -port ${smtp_port} -oauth bogus -user nobody@example.com" 'send: incomplete OAuth2 service definition: scope is missing' +run_test "send -draft -server 127.0.0.1 -port ${smtp_port} -saslmech xoauth2 -authservice bogus -user nobody@example.com" 'send: incomplete OAuth2 service definition: scope is missing' # TEST -echo 'no creds file -- should tell user to mhlogin' +start_test 'no creds file -- should tell user to mhlogin' rm -f "${MHTMPDIR}/oauth-test" -test_send_no_servers 'send: no credentials -- run mhlogin -oauth test' +test_send_no_servers 'send: no credentials -- run mhlogin -saslmech xoauth2 -authservice test' # TEST -echo 'empty creds file -- should tell user to mhlogin' +start_test 'empty creds file -- should tell user to mhlogin' fake_creds < /dev/null -test_send_no_servers 'send: no valid credentials -- run mhlogin -oauth test' +test_send_no_servers 'send: no valid credentials -- run mhlogin -saslmech xoauth2 -authservice test' # TEST -echo 'garbage creds file' +start_test 'garbage creds file' echo bork | fake_creds @@ -188,7 +188,7 @@ test_send_no_servers 'send: eof encountered in field "bork" send: error loading cred file' # TEST -echo 'unexpected field in creds file' +start_test 'unexpected field in creds file' fake_creds < "${testname}.send-output" 2>&1 || true + -saslmech xoauth2 -authservice test -user nobody@example.com > "${testname}.send-output" 2>&1 || true # Clear out an error message we get from libcurl on some systems (seen at least # 3 different versions of this error message, on FreeBSD 10.1, Ubuntu 12.04, and # Ubuntu 14.04). @@ -269,7 +269,7 @@ check "$f".clean "${testname}.expected-send-output" rm "$f" # TEST -echo 'refresh gets bogus 200 response from http server' +start_test 'refresh gets bogus 200 response from http server' expect_http_post_refresh @@ -283,7 +283,7 @@ test_send_only_fakehttp 'send: error refreshing OAuth2 token send: invalid response' # TEST -echo 'refresh gets 500 response from http server' +start_test 'refresh gets 500 response from http server' expect_http_post_refresh @@ -297,7 +297,7 @@ test_send_only_fakehttp 'send: error refreshing OAuth2 token send: invalid response' # TEST -echo 'refresh gets proper error from http' +start_test 'refresh gets proper error from http' expect_http_post_refresh @@ -309,10 +309,10 @@ Content-Type: application/json } EOF -test_send_only_fakehttp 'send: credentials rejected -- run mhlogin -oath test' +test_send_only_fakehttp 'send: credentials rejected -- run mhlogin -saslmech xoauth2 -authservice test' # TEST -echo 'refresh gets response too big' +start_test 'refresh gets response too big' fake_creds <