From: Adam Sampson Date: Wed, 22 Jan 2014 13:32:44 +0000 (+0000) Subject: Don't depend on having a host for testing timeouts against. X-Git-Tag: v2.19~5 X-Git-Url: http://git.ozo.com/?a=commitdiff_plain;h=07ee0c340c81116a9e66878d9149a2cc1c6a50c6;p=rawdog%2F.git Don't depend on having a host for testing timeouts against. The hardcoded one that used to be in there (which I was never very happy with) doesn't work any more, so it now defaults to not running that test at all, unless you give it the -T option. --- diff --git a/NEWS b/NEWS index aa94a39..c9a2567 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +- rawdog 2.19 + +Make test-rawdog not depend on having a host it can test connection +timeouts against, and add a -T option if you do have one. + - rawdog 2.18 Be consistent about catching AttributeError when looking for attributes diff --git a/test-rawdog b/test-rawdog index 50d4770..752e43e 100644 --- a/test-rawdog +++ b/test-rawdog @@ -39,7 +39,7 @@ httpport="8432" # (This is distinct from timeoutport above: if you connect to timeoutport, it # will accept the connection but not do anything, whereas this will timeout # while connecting.) -timeouthost="81.91.98.19" +timeouthost="" httpdir="$statedir/pub" httpurl="http://$serverhost:$httpport" @@ -51,6 +51,7 @@ Usage: test-rawdog [OPTION]... -b Include tests that are known to fail -k Keep going when a test fails -r COMMAND How to invoke rawdog (default: "./rawdog") +-T HOST Host to test connection timeout with Report bugs to . EOF @@ -60,7 +61,7 @@ EOF knownbad=false keepgoing=false rawdog="./rawdog" -while getopts bkr: OPT; do +while getopts bkr:T: OPT; do case "$OPT" in b) knownbad=true @@ -71,6 +72,9 @@ while getopts bkr: OPT; do r) rawdog="$OPTARG" ;; + T) + timeouthost="$OPTARG" + ;; ?) usage ;; @@ -825,10 +829,12 @@ add "feed 0 $httpurl/notthere" rune "404" -u for proto in http https ftp; do - begin "$proto: connect timeout" - add "timeout 1s" - add "feed 0 $proto://$timeouthost/feed.xml" - rune "Timeout while reading" -u + if [ -n "$timeouthost" ]; then + begin "$proto: connect timeout" + add "timeout 1s" + add "feed 0 $proto://$timeouthost/feed.xml" + rune "Timeout while reading" -u + fi begin "$proto: response timeout" add "timeout 1s"