X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/a3bf69c3a988b0de2126fbfe6804c61ef24a8896..ca2f8cc7e93a21f9f04e0d976ca97feac4802e91:/test/post/test-post-common.sh diff --git a/test/post/test-post-common.sh b/test/post/test-post-common.sh index 856c399f..66feddca 100755 --- a/test/post/test-post-common.sh +++ b/test/post/test-post-common.sh @@ -9,7 +9,8 @@ set -e setup_test -localport=65412 +arith_eval 64000 + $$ % 1000 +localport=$arith_val testname="${MH_TEST_DIR}/$$" # @@ -21,15 +22,14 @@ echo "clientname: nosuchhost.example.com" >> ${MHMTSCONF} # # One "post" test run. Ok, yeah, we're using "send", but that's just # because it's easier. -# +# $1: output filename for fakesmtp, i.e., the sent message +# $2: expected output +# $3: optional switches for send test_post () -{ "${MH_OBJ_DIR}/test/fakesmtp" "$1" $localport & - pid="$!" - - send -draft -server 127.0.0.1 -port $localport || exit 1 +{ pid=`"${MH_OBJ_DIR}/test/fakesmtp" "$1" $localport` - wait ${pid} + run_prog send -draft -server 127.0.0.1 -port $localport $3 # # It's hard to calculate the exact Date: header post is going to @@ -38,7 +38,7 @@ test_post () # sed -e 's/^Date:.*/Date:/' "$1" > "$1".nodate - mv "$1".nodate "$1" + rm -f "$1" - check "$1" "$2" + check "$1".nodate "$2" }