Skip to content

Commit bd62e7c

Browse files
committed
Merge branch 'jk/test-ports'
Avoid having to assign port number to be used in tests manually. * jk/test-ports: tests: auto-set git-daemon port tests: auto-set LIB_HTTPD_PORT from test name
2 parents 8336832 + c44132f commit bd62e7c

10 files changed

+2
-10
lines changed

t/lib-git-daemon.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ then
2222
test_done
2323
fi
2424

25-
LIB_GIT_DAEMON_PORT=${LIB_GIT_DAEMON_PORT-'8121'}
25+
LIB_GIT_DAEMON_PORT=${LIB_GIT_DAEMON_PORT-${this_test#t}}
2626

2727
GIT_DAEMON_PID=
2828
GIT_DAEMON_DOCUMENT_ROOT_PATH="$PWD"/repo

t/lib-httpd.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ case $(uname) in
6464
esac
6565

6666
LIB_HTTPD_PATH=${LIB_HTTPD_PATH-"$DEFAULT_HTTPD_PATH"}
67-
LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'8111'}
67+
LIB_HTTPD_PORT=${LIB_HTTPD_PORT-${this_test#t}}
6868

6969
TEST_PATH="$TEST_DIRECTORY"/lib-httpd
7070
HTTPD_ROOT_PATH="$PWD"/httpd

t/t5537-fetch-shallow.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ if test -n "$NO_CURL" -o -z "$GIT_TEST_HTTPD"; then
178178
test_done
179179
fi
180180

181-
LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5537'}
182181
. "$TEST_DIRECTORY"/lib-httpd.sh
183182
start_httpd
184183

t/t5538-push-shallow.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ if test -n "$NO_CURL" -o -z "$GIT_TEST_HTTPD"; then
126126
test_done
127127
fi
128128

129-
LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5537'}
130129
. "$TEST_DIRECTORY"/lib-httpd.sh
131130
start_httpd
132131

t/t5540-http-push.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ then
1616
fi
1717

1818
LIB_HTTPD_DAV=t
19-
LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5540'}
2019
. "$TEST_DIRECTORY"/lib-httpd.sh
2120
ROOT_PATH="$PWD"
2221
start_httpd

t/t5541-http-push.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ if test -n "$NO_CURL"; then
1212
fi
1313

1414
ROOT_PATH="$PWD"
15-
LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5541'}
1615
. "$TEST_DIRECTORY"/lib-httpd.sh
1716
. "$TEST_DIRECTORY"/lib-terminal.sh
1817
start_httpd

t/t5550-http-fetch.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ if test -n "$NO_CURL"; then
88
test_done
99
fi
1010

11-
LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5550'}
1211
. "$TEST_DIRECTORY"/lib-httpd.sh
1312
start_httpd
1413

t/t5551-http-fetch.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ if test -n "$NO_CURL"; then
88
test_done
99
fi
1010

11-
LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5551'}
1211
. "$TEST_DIRECTORY"/lib-httpd.sh
1312
start_httpd
1413

t/t5561-http-backend.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ if test -n "$NO_CURL"; then
88
test_done
99
fi
1010

11-
LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5561'}
1211
. "$TEST_DIRECTORY"/lib-httpd.sh
1312
start_httpd
1413

t/t5570-git-daemon.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
test_description='test fetching over git protocol'
44
. ./test-lib.sh
55

6-
LIB_GIT_DAEMON_PORT=${LIB_GIT_DAEMON_PORT-5570}
76
. "$TEST_DIRECTORY"/lib-git-daemon.sh
87
start_git_daemon
98

0 commit comments

Comments
 (0)