diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-05-19 18:27:07 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-05-19 18:27:07 +0200 |
commit | 646ca8955861b9e3d4b1d130b15fd59673c3c76b (patch) | |
tree | 76efba07e9b6ccc0b99411f400bb740d1e2db8b1 /t | |
parent | Merge branch 'bc/clone-empty-repo-via-protocol-v0' (diff) | |
parent | t/lib-httpd: make CGIPassAuth support conditional (diff) | |
download | git-646ca8955861b9e3d4b1d130b15fd59673c3c76b.tar.xz git-646ca8955861b9e3d4b1d130b15fd59673c3c76b.zip |
Merge branch 'jk/http-test-cgipassauth-unavailable-in-older-apache'
We started unconditionally testing with CGIPassAuth directive but
it is unavailable in older Apache that ships with CentOS 7 that has
about a year of shelf-life still left. The test has conditionally
been disabled when running with an ancient Apache. This was a fix
for a recent regression caught before the release, so no need to
mention it in the release notes.
* jk/http-test-cgipassauth-unavailable-in-older-apache:
t/lib-httpd: make CGIPassAuth support conditional
Diffstat (limited to 't')
-rw-r--r-- | t/lib-httpd.sh | 14 | ||||
-rw-r--r-- | t/lib-httpd/apache.conf | 2 | ||||
-rwxr-xr-x | t/t5563-simple-http-auth.sh | 6 |
3 files changed, 22 insertions, 0 deletions
diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh index 6805229dcb..2fb1b2ae56 100644 --- a/t/lib-httpd.sh +++ b/t/lib-httpd.sh @@ -191,6 +191,20 @@ enable_http2 () { test_set_prereq HTTP2 } +enable_cgipassauth () { + # We are looking for 2.4.13 or more recent. Since we only support + # 2.4 and up, no need to check for older major/minor. + if test "$HTTPD_VERSION_MAJOR" = 2 && + test "$HTTPD_VERSION_MINOR" = 4 && + test "$(echo $HTTPD_VERSION | cut -d. -f3)" -lt 13 + then + echo >&4 "apache $HTTPD_VERSION too old for CGIPassAuth" + return + fi + HTTPD_PARA="$HTTPD_PARA -DUSE_CGIPASSAUTH" + test_set_prereq CGIPASSAUTH +} + start_httpd() { prepare_httpd >&3 2>&4 diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf index 9e6892970d..a22d138605 100644 --- a/t/lib-httpd/apache.conf +++ b/t/lib-httpd/apache.conf @@ -146,7 +146,9 @@ SetEnv PERL_PATH ${PERL_PATH} <LocationMatch /custom_auth/> SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH} SetEnv GIT_HTTP_EXPORT_ALL + <IfDefine USE_CGIPASSAUTH> CGIPassAuth on + </IfDefine> </LocationMatch> ScriptAlias /smart/incomplete_length/git-upload-pack incomplete-length-upload-pack-v2-http.sh/ ScriptAlias /smart/incomplete_body/git-upload-pack incomplete-body-upload-pack-v2-http.sh/ diff --git a/t/t5563-simple-http-auth.sh b/t/t5563-simple-http-auth.sh index f45a43b4b5..ab8a721ccc 100755 --- a/t/t5563-simple-http-auth.sh +++ b/t/t5563-simple-http-auth.sh @@ -5,6 +5,12 @@ test_description='test http auth header and credential helper interop' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-httpd.sh +enable_cgipassauth +if ! test_have_prereq CGIPASSAUTH +then + skip_all="no CGIPassAuth support" + test_done +fi start_httpd test_expect_success 'setup_credential_helper' ' |