]> diplodocus.org Git - nmh/blobdiff - test/oauth/test-inc
sbr/oauth.c: Remove const to avoid curl's debug_callback warning.
[nmh] / test / oauth / test-inc
index 6fa5892ac88f5b6d0045de59f98cd6ff8a8af283..de18d8f0d247f57f9d0b9f74fb5824c84be996c8 100755 (executable)
@@ -10,6 +10,8 @@ fi
 
 . "${srcdir}/test/oauth/common.sh"
 
 
 . "${srcdir}/test/oauth/common.sh"
 
+check_exit '-eq 1' inc -
+
 setup_pop
 
 #
 setup_pop
 
 #
@@ -20,8 +22,8 @@ setup_pop
 start_test 'access token ready, pop server accepts message'
 
 fake_creds <<EOF
 start_test 'access token ready, pop server accepts message'
 
 fake_creds <<EOF
-access: test-access
-expire: 2000000000
+access-nobody@example.com: test-access
+expire-nobody@example.com: 2000000000
 EOF
 
 start_pop_xoauth
 EOF
 
 start_pop_xoauth
@@ -32,9 +34,9 @@ test_inc_success
 start_test 'expired access token, refresh works, pop server accepts message'
 
 fake_creds <<EOF
 start_test 'expired access token, refresh works, pop server accepts message'
 
 fake_creds <<EOF
-access: old-access
-refresh: test-refresh
-expire: 1414303986
+access-nobody@example.com: old-access
+refresh-nobody@example.com: test-refresh
+expire-nobody@example.com: 1414303986
 EOF
 
 expect_http_post_refresh
 EOF
 
 expect_http_post_refresh
@@ -62,8 +64,8 @@ check_http_req
 start_test 'refresh gets proper error from http'
 
 fake_creds <<EOF
 start_test 'refresh gets proper error from http'
 
 fake_creds <<EOF
-access: test-access
-refresh: test-refresh
+access-nobody@example.com: test-access
+refresh-nobody@example.com: test-refresh
 EOF
 
 expect_http_post_refresh
 EOF
 
 expect_http_post_refresh
@@ -77,6 +79,7 @@ Content-Type: application/json
 EOF
 
 start_fakehttp
 EOF
 
 start_fakehttp
+start_pop_xoauth
 
 test_inc 'inc: error refreshing OAuth2 token
 inc: bad OAuth request; re-run with -snoop and send REDACTED output to nmh-workers'
 
 test_inc 'inc: error refreshing OAuth2 token
 inc: bad OAuth request; re-run with -snoop and send REDACTED output to nmh-workers'
@@ -87,20 +90,20 @@ check_http_req
 start_test 'pop server rejects token'
 
 fake_creds <<EOF
 start_test 'pop server rejects token'
 
 fake_creds <<EOF
-access: wrong-access
-expire: 2000000000
+access-nobody@example.com: wrong-access
+expire-nobody@example.com: 2000000000
 EOF
 
 start_pop_xoauth
 
 EOF
 
 start_pop_xoauth
 
-test_inc 'inc: -ERR [AUTH] Invalid credentials.'
+test_inc 'inc: Authentication failed: -ERR [AUTH] Invalid credentials.'
 
 # TEST
 start_test "pop server doesn't support oauth"
 
 fake_creds <<EOF
 
 # TEST
 start_test "pop server doesn't support oauth"
 
 fake_creds <<EOF
-access: test-access
-expire: 2000000000
+access-nobody@example.com: test-access
+expire-nobody@example.com: 2000000000
 EOF
 
 start_pop testuser testpass
 EOF
 
 start_pop testuser testpass