]> granicus.if.org Git - git/commitdiff
tests: auto-set LIB_HTTPD_PORT from test name
authorJeff King <peff@peff.net>
Mon, 10 Feb 2014 14:39:48 +0000 (09:39 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Feb 2014 18:20:45 +0000 (10:20 -0800)
We set the default apache port for each of the httpd tests
to the 4-digit test number of the test script. We want these
to remain unique so that the tests do not conflict with each
other when run in parallel.

Instead of doing it manually in each test script, let's just
set it from the test name at run time. This is simpler, and
is one less thing to be updated when test scripts are
renamed (e.g., when being re-rolled or when conflicting
after being merged with another topic).

Incidentally, this fixes a case where t5537 and t5538 used
the same port number (5537), and could conflict with each
other when run in parallel.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-httpd.sh
t/t5537-fetch-shallow.sh
t/t5538-push-shallow.sh
t/t5540-http-push.sh
t/t5541-http-push.sh
t/t5550-http-fetch.sh
t/t5551-http-fetch.sh
t/t5561-http-backend.sh

index bfdff2a8c93091c8e2db8e03a74eae5c5a53991c..b43162ea2a932deb521381863900279c8d87f2b1 100644 (file)
@@ -64,7 +64,7 @@ case $(uname) in
 esac
 
 LIB_HTTPD_PATH=${LIB_HTTPD_PATH-"$DEFAULT_HTTPD_PATH"}
-LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'8111'}
+LIB_HTTPD_PORT=${LIB_HTTPD_PORT-${this_test#t}}
 
 TEST_PATH="$TEST_DIRECTORY"/lib-httpd
 HTTPD_ROOT_PATH="$PWD"/httpd
index b0fa7387cbe082a72e26590be8e621c922e91eba..adf215a1937cf2ab2049e3e942497860e49d67cb 100755 (executable)
@@ -178,7 +178,6 @@ if test -n "$NO_CURL" -o -z "$GIT_TEST_HTTPD"; then
        test_done
 fi
 
-LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5537'}
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
 
index 0a6e40f144a767cba03818cffca8b8b2aa6a16e2..8e54ac57462987567b11623d502ffc68fca3d9a0 100755 (executable)
@@ -126,7 +126,6 @@ if test -n "$NO_CURL" -o -z "$GIT_TEST_HTTPD"; then
        test_done
 fi
 
-LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5537'}
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
 
index 5b0198cbc88ad54ea4e6f102429697c2da2ed2ba..8d7b3c57e31dd3bc76df3124c31351862e9fb811 100755 (executable)
@@ -16,7 +16,6 @@ then
 fi
 
 LIB_HTTPD_DAV=t
-LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5540'}
 . "$TEST_DIRECTORY"/lib-httpd.sh
 ROOT_PATH="$PWD"
 start_httpd
index bfd241ea8ae4e51f69194f4a08685e9cd9d78b61..73af16f481836d3cbfa8a2f82c260d10a3a43c09 100755 (executable)
@@ -12,7 +12,6 @@ if test -n "$NO_CURL"; then
 fi
 
 ROOT_PATH="$PWD"
-LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5541'}
 . "$TEST_DIRECTORY"/lib-httpd.sh
 . "$TEST_DIRECTORY"/lib-terminal.sh
 start_httpd
index 83926247142458323298c844ec99a74c369107e7..1a3a2b6c1a20558a019143d1abbd2168af0caf53 100755 (executable)
@@ -8,7 +8,6 @@ if test -n "$NO_CURL"; then
        test_done
 fi
 
-LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5550'}
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
 
index a124efe11459905a11d91bfb32f8388bf4876c1d..e07eaf35f118893da9240f12d115da1affd5eb05 100755 (executable)
@@ -8,7 +8,6 @@ if test -n "$NO_CURL"; then
        test_done
 fi
 
-LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5551'}
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
 
index b5d7fbc3815aed53ec50bdf7f5dbf2c796fed1fe..d23fb0238483520e77004a208f15db808941b4af 100755 (executable)
@@ -8,7 +8,6 @@ if test -n "$NO_CURL"; then
        test_done
 fi
 
-LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5561'}
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd