X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/2e04b8ea0e57e411665aa6a8814ff65db0d4cd2b..e5f339f3bb5b9bbea11d45a4f9c98c56c53d71ea:/test/oauth/test-mhlogin diff --git a/test/oauth/test-mhlogin b/test/oauth/test-mhlogin index 7454576b..682fbc86 100755 --- a/test/oauth/test-mhlogin +++ b/test/oauth/test-mhlogin @@ -303,11 +303,17 @@ mhlogin: bad OAuth request; re-run with -snoop and send REDACTED output to nmh-w # TEST start_test 'mhlogin -browser' -run_test "eval echo code | mhlogin -saslmech xoauth2 -authservice test\ - -user nobody@example.com -browser 'echo \$@ > ${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" +#### Strip off the error string because it can vary, e.g., +#### "Failed to connect to 127.0.0.1 port 64546: Connection refused", or +#### "Connection timed out after 1004 milliseconds" +echo code | mhlogin -saslmech xoauth2 -authservice test -user nobody@example.com \ + -browser "echo \$@ > ${MHTMPDIR}/$$.browser" 2>&1 1>/dev/null | \ + sed 's/\( endpoint:\) .*/\1/' > "${MHTMPDIR}/$$.mhlogin.err" +cat > "${MHTMPDIR}/$$.mhlogin.err.expected" < "${MHTMPDIR}/$$.browser.expected" <