From d99194822b8d8d3c7c2c8985b720b0e6a5542263 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 19 Feb 2019 10:18:15 -0800 Subject: [PATCH 1/2] Revert "t5562: replace /dev/zero with a pipe from generate_zero_bytes" Revert cc95bc20 ("t5562: replace /dev/zero with a pipe from generate_zero_bytes", 2019-02-09), as not feeding anything to the command is a better way to test it. --- t/t5562-http-backend-content-length.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t5562-http-backend-content-length.sh b/t/t5562-http-backend-content-length.sh index bbadde2c6e..90d890d02f 100755 --- a/t/t5562-http-backend-content-length.sh +++ b/t/t5562-http-backend-content-length.sh @@ -143,14 +143,14 @@ test_expect_success GZIP 'push gzipped empty' ' test_expect_success 'CONTENT_LENGTH overflow ssite_t' ' NOT_FIT_IN_SSIZE=$(ssize_b100dots) && - generate_zero_bytes infinity | env \ + env \ CONTENT_TYPE=application/x-git-upload-pack-request \ QUERY_STRING=/repo.git/git-upload-pack \ PATH_TRANSLATED="$PWD"/.git/git-upload-pack \ GIT_HTTP_EXPORT_ALL=TRUE \ REQUEST_METHOD=POST \ CONTENT_LENGTH="$NOT_FIT_IN_SSIZE" \ - git http-backend >/dev/null 2>err && + git http-backend /dev/null 2>err && grep "fatal:.*CONTENT_LENGTH" err ' From 709417507567d1423acd06f55fb6256af7ad3847 Mon Sep 17 00:00:00 2001 From: Max Kirillov Date: Fri, 15 Feb 2019 18:42:37 +0200 Subject: [PATCH 2/2] t5562: do not depend on /dev/zero It was reported [1] that NonStop platform does not have /dev/zero. The test uses /dev/zero as a dummy input. Passing case (http-backed failed because of too big input size) should not be reading anything from it. If http-backend would erroneously try to read any data returning EOF probably would be even safer than providing some meaningless data. Replace /dev/zero with /dev/null to avoid issues with platforms which do not have /dev/zero. [1] https://public-inbox.org/git/20190209185930.5256-4-randall.s.becker@rogers.com/ Reported-by: Randall S. Becker Signed-off-by: Max Kirillov Signed-off-by: Junio C Hamano --- t/t5562-http-backend-content-length.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t5562-http-backend-content-length.sh b/t/t5562-http-backend-content-length.sh index 90d890d02f..436c261c86 100755 --- a/t/t5562-http-backend-content-length.sh +++ b/t/t5562-http-backend-content-length.sh @@ -150,7 +150,7 @@ test_expect_success 'CONTENT_LENGTH overflow ssite_t' ' GIT_HTTP_EXPORT_ALL=TRUE \ REQUEST_METHOD=POST \ CONTENT_LENGTH="$NOT_FIT_IN_SSIZE" \ - git http-backend /dev/null 2>err && + git http-backend /dev/null 2>err && grep "fatal:.*CONTENT_LENGTH" err '