t5551: test server-side ERR packet
When a smart HTTP server sends an error message via pkt-line, we detect
the error due to using PACKET_READ_DIE_ON_ERR_PACKET. This case was
added by 2d103c31c2
(pack-protocol.txt: accept error packets in any
context, 2018-12-29), but not covered by tests.
Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
cbdb8d1439
commit
30dea56536
@ -131,6 +131,7 @@ prepare_httpd() {
|
|||||||
mkdir -p "$HTTPD_DOCUMENT_ROOT_PATH"
|
mkdir -p "$HTTPD_DOCUMENT_ROOT_PATH"
|
||||||
cp "$TEST_PATH"/passwd "$HTTPD_ROOT_PATH"
|
cp "$TEST_PATH"/passwd "$HTTPD_ROOT_PATH"
|
||||||
install_script broken-smart-http.sh
|
install_script broken-smart-http.sh
|
||||||
|
install_script error-smart-http.sh
|
||||||
install_script error.sh
|
install_script error.sh
|
||||||
install_script apply-one-time-sed.sh
|
install_script apply-one-time-sed.sh
|
||||||
|
|
||||||
|
@ -119,6 +119,7 @@ Alias /auth/dumb/ www/auth/dumb/
|
|||||||
ScriptAliasMatch /error_git_upload_pack/(.*)/git-upload-pack error.sh/
|
ScriptAliasMatch /error_git_upload_pack/(.*)/git-upload-pack error.sh/
|
||||||
ScriptAliasMatch /smart_*[^/]*/(.*) ${GIT_EXEC_PATH}/git-http-backend/$1
|
ScriptAliasMatch /smart_*[^/]*/(.*) ${GIT_EXEC_PATH}/git-http-backend/$1
|
||||||
ScriptAlias /broken_smart/ broken-smart-http.sh/
|
ScriptAlias /broken_smart/ broken-smart-http.sh/
|
||||||
|
ScriptAlias /error_smart/ error-smart-http.sh/
|
||||||
ScriptAlias /error/ error.sh/
|
ScriptAlias /error/ error.sh/
|
||||||
ScriptAliasMatch /one_time_sed/(.*) apply-one-time-sed.sh/$1
|
ScriptAliasMatch /one_time_sed/(.*) apply-one-time-sed.sh/$1
|
||||||
<Directory ${GIT_EXEC_PATH}>
|
<Directory ${GIT_EXEC_PATH}>
|
||||||
@ -127,6 +128,9 @@ ScriptAliasMatch /one_time_sed/(.*) apply-one-time-sed.sh/$1
|
|||||||
<Files broken-smart-http.sh>
|
<Files broken-smart-http.sh>
|
||||||
Options ExecCGI
|
Options ExecCGI
|
||||||
</Files>
|
</Files>
|
||||||
|
<Files error-smart-http.sh>
|
||||||
|
Options ExecCGI
|
||||||
|
</Files>
|
||||||
<Files error.sh>
|
<Files error.sh>
|
||||||
Options ExecCGI
|
Options ExecCGI
|
||||||
</Files>
|
</Files>
|
||||||
|
3
t/lib-httpd/error-smart-http.sh
Normal file
3
t/lib-httpd/error-smart-http.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
echo "Content-Type: application/x-git-upload-pack-advertisement"
|
||||||
|
echo
|
||||||
|
printf "%s" "0019ERR server-side error"
|
@ -429,5 +429,10 @@ test_expect_success 'GIT_TRACE_CURL_NO_DATA prevents data from being traced' '
|
|||||||
! grep "=> Send data" err
|
! grep "=> Send data" err
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'server-side error detected' '
|
||||||
|
test_must_fail git clone $HTTPD_URL/error_smart/repo.git 2>actual &&
|
||||||
|
grep "server-side error" actual
|
||||||
|
'
|
||||||
|
|
||||||
stop_httpd
|
stop_httpd
|
||||||
test_done
|
test_done
|
||||||
|
Loading…
Reference in New Issue
Block a user