]> diplodocus.org Git - nmh/blobdiff - test/oauth/common.sh
get_file_info(): Don't return filename from quote onwards on error.
[nmh] / test / oauth / common.sh
index 3f3dc598d26abaa916f948b482ad45bb91a3a7f3..342e5786367e045e1e990d58ad6ccb54b2f6bfac 100644 (file)
@@ -10,13 +10,13 @@ fi
 
 testname="${MH_TEST_DIR}/$$"
 
-arith_eval 64001 + `id -u` % 1000
+arith_eval 64001 + $$ % 1000
 http_port=${arith_val}
 
-arith_eval 64000 + `id -u` % 1000
+arith_eval ${http_port} + 1
 pop_port=${arith_val}
 
-arith_eval 64002 + `id -u` % 1000
+arith_eval ${pop_port} + 1
 smtp_port=${arith_val}
 
 cat >> ${MH} <<EOF
@@ -131,7 +131,7 @@ expect_creds() {
 }
 
 test_inc() {
-    run_test "inc -host 127.0.0.1 -port ${pop_port} -saslmech xoauth2 -authservice test -user nobody@example.com -width 80" "$@"
+    run_test "inc -host 127.0.0.1 -port ${pop_port} -sasl -saslmech xoauth2 -authservice test -user nobody@example.com -width 80" "$@"
 }
 
 test_inc_success() {
@@ -142,7 +142,7 @@ test_inc_success() {
 }
 
 test_send_no_servers() {
-    run_test "send -draft -server 127.0.0.1 -port ${smtp_port} -saslmech xoauth2 -authservice test -user nobody@example.com" "$@"
+    run_test "send -draft -server 127.0.0.1 -port ${smtp_port} -sasl -saslmech xoauth2 -authservice test -user nobody@example.com" "$@"
 }
 
 test_send_only_fakesmtp() {
@@ -180,7 +180,7 @@ check_creds() {
     # it against our "correct" output.
     f="${MHTMPDIR}/oauth-test"
 
-    sed 's/^expire:.*/expire:/' "$f" > "$f".notime
+    sed 's/^\(expire.*:\).*/\1/' "$f" > "$f".notime
     check "$f".notime "${MHTMPDIR}/$$.expected-creds"
     rm "$f"
 }