On Thu, Feb 06, 2014 at 02:35:33PM -0500, Jeff King wrote: > On Thu, Feb 06, 2014 at 10:10:35PM +0700, Nguyễn Thái Ngọc Duy wrote: > > > Originally I had t5537 use port 5536 and 5538 use port 5537(!). Then > > Jeff found my fault so I changed port in t5537 from 5536 to 5537 in > > 3b32a7c (t5537: fix incorrect expectation in test case 10 - > > 2014-01-08). Which makes it worse because now both t5537 and t5538 > > both use the same port. Fix it. > [...] Thinking on this more, I wonder if we should just do something like this: diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh index bfdff2a..c82b4ee 100644 --- a/t/lib-httpd.sh +++ b/t/lib-httpd.sh @@ -64,7 +64,9 @@ case $(uname) in esac LIB_HTTPD_PATH=${LIB_HTTPD_PATH-"$DEFAULT_HTTPD_PATH"} -LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'8111'} +if test -z "$LIB_HTTPD_PORT"; then + LIB_HTTPD_PORT=${this_test#t} +fi TEST_PATH="$TEST_DIRECTORY"/lib-httpd HTTPD_ROOT_PATH="$PWD"/httpd and drop the manual LIB_HTTPD_PORT setting in each of the test scripts. That would prevent this type of error in the future, and people can still override if they want to. Any test scripts that are not numbered would need to set it, but we should not have any of those (and if we did, the failure mode would be OK, as Apache would barf on the bogus port number). -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html