X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/012d05c2b62332eb400d66b806e48216d39358c6..735132076ce596a46936878532cbfe409b1be87d:/test/oauth/test-mhlogin diff --git a/test/oauth/test-mhlogin b/test/oauth/test-mhlogin index 6103f706..7454576b 100755 --- a/test/oauth/test-mhlogin +++ b/test/oauth/test-mhlogin @@ -11,14 +11,14 @@ fi . "${srcdir}/test/oauth/common.sh" expect_no_creds() { - cat /dev/null > "${testname}.expected-creds" + cat /dev/null > "${MHTMPDIR}/$$.expected-creds" cat /dev/null > "${MHTMPDIR}/oauth-test" chmod 600 "${MHTMPDIR}/oauth-test" } test_mhlogin() { start_fakehttp - run_test 'eval echo code | mhlogin -oauth test' \ + run_test 'eval echo code | mhlogin -saslmech xoauth2 -authservice test -user nobody@example.com' \ "Load the following URL in your browser and authorize nmh to access test: http://127.0.0.1:${http_port}/oauth/auth?response_type=code&client_id=test-id&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=test-scope @@ -39,7 +39,7 @@ mhlogin: invalid response' # # TEST -echo 'mhlogin receives access and expiration' +start_test 'mhlogin receives access and expiration' expect_http_post_code @@ -52,14 +52,14 @@ fake_json_response < ${MHTMPDIR}/$$.browser'" \ +"Follow the prompts in your browser to authorize nmh to access test. +Enter the authorization code: mhlogin: error exchanging code for OAuth2 token +mhlogin: error making HTTP request to OAuth2 authorization endpoint: Failed to connect to 127.0.0.1 port ${http_port}: Connection refused" + +cat > "${MHTMPDIR}/$$.browser.expected" <