{"thread":{"id":"48209","subject":"Test 5561 failed","startedAt":"2018-04-03T11:44:14Z","lastAt":"2018-04-03T14:02:04Z","messageCount":6,"participants":["Jens Krüger","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"343678","messageId":"66ac8aec-3e4c-43be-83d1-7bd823ec2b20@frm2.tum.de","threadId":"48209","inReplyTo":null,"subject":"Test 5561 failed","fromName":"Jens Krüger","fromEmail":"jens.krueger@frm2.tum.de","sentAt":"2018-04-03T11:43:37Z","receivedAt":"2018-04-03T11:44:14Z","isPatch":false,"sender":{"key":"jens.krueger@frm2.tum.de","avatar":null},"body":"Git version 2.17.0\n\nOS: Debian 9 (9.4)\n\ngcc: gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516\n\nbuild from github clone:\n\nautoreconf\n./configure\nmake\nmake test\n\n*** t5561-http-backend.sh ***\nok 1 - setup repository\nnot ok 2 - direct refs/heads/master not found\n#\n#               GET refs/heads/master \"404 Not Found\"\n#\nnot ok 3 - static file is ok\n#\n#               get_static_files \"200 OK\"\n#\nnot ok 4 - no export by default\n#\n#               get_static_files \"404 Not Found\"\n#\nnot ok 5 - export if git-daemon-export-ok\n#\n#               (cd \"$HTTPD_DOCUMENT_ROOT_PATH/repo.git\" &&\n#                touch git-daemon-export-ok\n#               ) &&\n#               get_static_files \"200 OK\"\n#\nnot ok 6 - static file if http.getanyfile true is ok\n#\n#               config http.getanyfile true &&\n#               get_static_files \"200 OK\"\n#\nnot ok 7 - static file if http.getanyfile false fails\n#\n#               config http.getanyfile false &&\n#               get_static_files \"403 Forbidden\"\n#\nnot ok 8 - http.uploadpack default enabled\n#\n#               GET info/refs?service=git-upload-pack \"200 OK\" &&\n#               POST git-upload-pack 0000 \"200 OK\"\n#\nnot ok 9 - http.uploadpack true\n#\n#               config http.uploadpack true &&\n#               GET info/refs?service=git-upload-pack \"200 OK\" &&\n#               POST git-upload-pack 0000 \"200 OK\"\n#\nnot ok 10 - http.uploadpack false\n#\n#               config http.uploadpack false &&\n#               GET info/refs?service=git-upload-pack \"403 Forbidden\" &&\n#               POST git-upload-pack 0000 \"403 Forbidden\"\n#\nnot ok 11 - http.receivepack default disabled\n#\n#               GET info/refs?service=git-receive-pack \"403 Forbidden\"  &&\n#               POST git-receive-pack 0000 \"403 Forbidden\"\n#\nnot ok 12 - http.receivepack true\n#\n#               config http.receivepack true &&\n#               GET info/refs?service=git-receive-pack \"200 OK\" &&\n#               POST git-receive-pack 0000 \"200 OK\"\n#\nnot ok 13 - http.receivepack false\n#\n#               config http.receivepack false &&\n#               GET info/refs?service=git-receive-pack \"403 Forbidden\" &&\n#               POST git-receive-pack 0000 \"403 Forbidden\"\n#\nnot ok 14 - server request log matches test results\n#\n#               sed -e \"\n#                       s/^.* \\\"//\n#                       s/\\\"//\n#                       s/ [1-9][0-9]*\\$//\n#                       s/^GET /GET  /\n#               \" >act <\"$HTTPD_ROOT_PATH\"/access.log &&\n#               test_cmp exp act\n#\n# failed 13 among 14 test(s)\n1..14\n\n\n\nInitialized empty Git repository in /home/jkrueger/sources/git/t/trash directory.t5561-http-backend/.git/\nchecking prerequisite: NOT_ROOT\n\nmkdir -p \"$TRASH_DIRECTORY/prereq-test-dir\" &&\n(\n\tcd \"$TRASH_DIRECTORY/prereq-test-dir\" &&\n\tuid=$(id -u) &&\n\ttest \"$uid\" != 0\n\n)\nprerequisite NOT_ROOT ok\nexpecting success: \n\techo content >file &&\n\tgit add file &&\n\tgit commit -m one &&\n\n\tmkdir \"$HTTPD_DOCUMENT_ROOT_PATH/repo.git\" &&\n\t(cd \"$HTTPD_DOCUMENT_ROOT_PATH/repo.git\" &&\n\t git --bare init &&\n\t : >objects/info/alternates &&\n\t : >objects/info/http-alternates\n\t) &&\n\tgit remote add public \"$HTTPD_DOCUMENT_ROOT_PATH/repo.git\" &&\n\tgit push public master:master &&\n\n\t(cd \"$HTTPD_DOCUMENT_ROOT_PATH/repo.git\" &&\n\t git repack -a -d\n\t) &&\n\n\techo other >file &&\n\tgit add file &&\n\tgit commit -m two &&\n\tgit push public master:master &&\n\n\tLOOSE_URL=$(find_file objects/??) &&\n\tPACK_URL=$(find_file objects/pack/*.pack) &&\n\tIDX_URL=$(find_file objects/pack/*.idx)\n\n[master (root-commit) ca879ad] one\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 file\nInitialized empty Git repository in /home/jkrueger/sources/git/t/trash directory.t5561-http-backend/httpd/www/repo.git/\nTo /home/jkrueger/sources/git/t/trash directory.t5561-http-backend/httpd/www/repo.git\n * [new branch]      master -> master\n[master b23ec89] two\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+), 1 deletion(-)\nTo /home/jkrueger/sources/git/t/trash directory.t5561-http-backend/httpd/www/repo.git\n   ca879ad..b23ec89  master -> master\nok 1 - setup repository\n\nexpecting success: \n\tGET refs/heads/master \"404 Not Found\"\n\nnot ok 2 - direct refs/heads/master not found\n#\t\n#\t\tGET refs/heads/master \"404 Not Found\"\n#\t\n"},{"id":"343689","messageId":"20180403131447.GB18824@sigill.intra.peff.net","threadId":"48209","inReplyTo":"66ac8aec-3e4c-43be-83d1-7bd823ec2b20@frm2.tum.de","subject":"Re: Test 5561 failed","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-04-03T13:14:48Z","receivedAt":"2018-04-03T13:15:00Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Apr 03, 2018 at 01:43:37PM +0200, Jens Krüger wrote:\n\n> expecting success: \n> \tGET refs/heads/master \"404 Not Found\"\n> \n> not ok 2 - direct refs/heads/master not found\n\nThat GET function is:\n\n  GET() {\n        curl --include \"$HTTPD_URL/$SMART/repo.git/$1\" >out 2>/dev/null &&\n        tr '\\015' Q <out |\n        sed '\n                s/Q$//\n                1q\n        ' >act &&\n        echo \"HTTP/1.1 $2\" >exp &&\n        test_cmp exp act\n  }\n\nThe tarball you sent shows \"out\" as empty, and \"act\" is missing. So\n\"curl\" produced no output, and we did not make it as far as the tr/sed\npipe. Just a guess, but are you missing the \"curl\" command-line tool on\nyour system? If so, \"apt install curl\" should fix the failure.\n\nAs far as code changes in Git, perhaps (assuming my guess is right):\n\n  - drop the redirect of stderr here; the test suite already handles\n    hiding stderr from the user (without \"-v\"), and in \"-v\" mode you\n    probably would have gotten a useful error like \"curl: not found\"\n\n  - it's rare but possible to have libcurl installed (which is needed\n    for the server side, and what we key on for running the httpd tests)\n    but not the curl binary. This test probably should check for the\n    existence of the curl binary as a prerequisite.\n\n-Peff\n"},{"id":"343692","messageId":"7769193d-f10d-9e3e-6c9d-c21a4a72485f@frm2.tum.de","threadId":"48209","inReplyTo":"20180403131447.GB18824@sigill.intra.peff.net","subject":"Re: Test 5561 failed","fromName":"Jens Krüger","fromEmail":"jens.krueger@frm2.tum.de","sentAt":"2018-04-03T13:29:13Z","receivedAt":"2018-04-03T13:30:00Z","isPatch":false,"sender":{"key":"jens.krueger@frm2.tum.de","avatar":null},"body":"\n\n\nAm 03.04.2018 um 15:14 schrieb Jeff King:\n> On Tue, Apr 03, 2018 at 01:43:37PM +0200, Jens Krüger wrote:\n>\n>> expecting success: GET refs/heads/master \"404 Not Found\" not ok 2 - \n>> direct refs/heads/master not found \n> That GET function is:\n>\n>    GET() {\n>          curl --include \"$HTTPD_URL/$SMART/repo.git/$1\" >out 2>/dev/null &&\n>          tr '\\015' Q <out |\n>          sed '\n>                  s/Q$//\n>                  1q\n>          ' >act &&\n>          echo \"HTTP/1.1 $2\" >exp &&\n>          test_cmp exp act\n>    }\n>\n> The tarball you sent shows \"out\" as empty, and \"act\" is missing. So\n> \"curl\" produced no output, and we did not make it as far as the tr/sed\n> pipe. Just a guess, but are you missing the \"curl\" command-line tool on\n> your system? If so, \"apt install curl\" should fix the failure.\nYes, the missing curl program was the reason, but I didn't find any hint \nabout\nthe missed program in the log output. The output will be suppressed by \nthe '2>/dev/null' in\nlines: 9 and 22 of the t5561-http-backend.sh script.\n\nNevertheless many thanks for helping.\n\n> As far as code changes in Git, perhaps (assuming my guess is right):\n>\n>    - drop the redirect of stderr here; the test suite already handles\n>      hiding stderr from the user (without \"-v\"), and in \"-v\" mode you\n>      probably would have gotten a useful error like \"curl: not found\"\n>\n>    - it's rare but possible to have libcurl installed (which is needed\n>      for the server side, and what we key on for running the httpd tests)\n>      but not the curl binary. This test probably should check for the\n>      existence of the curl binary as a prerequisite.\n>\n> -Peff\n\n"},{"id":"343694","messageId":"20180403140055.GA29556@sigill.intra.peff.net","threadId":"48209","inReplyTo":"20180403131447.GB18824@sigill.intra.peff.net","subject":"[PATCH 0/2] t5561 fails without curl installed","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-04-03T14:00:55Z","receivedAt":"2018-04-03T14:01:01Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Apr 03, 2018 at 09:14:47AM -0400, Jeff King wrote:\n\n> As far as code changes in Git, perhaps (assuming my guess is right):\n> \n>   - drop the redirect of stderr here; the test suite already handles\n>     hiding stderr from the user (without \"-v\"), and in \"-v\" mode you\n>     probably would have gotten a useful error like \"curl: not found\"\n> \n>   - it's rare but possible to have libcurl installed (which is needed\n>     for the server side, and what we key on for running the httpd tests)\n>     but not the curl binary. This test probably should check for the\n>     existence of the curl binary as a prerequisite.\n\nSo let's do this before we forget.\n\n  [1/2]: t5561: drop curl stderr redirects\n  [2/2]: t5561: skip tests if curl is not available\n\n t/t5561-http-backend.sh | 10 ++++++++--\n t/test-lib.sh           |  4 ++++\n 2 files changed, 12 insertions(+), 2 deletions(-)\n\n-Peff\n"},{"id":"343695","messageId":"20180403140140.GA30376@sigill.intra.peff.net","threadId":"48209","inReplyTo":"20180403140055.GA29556@sigill.intra.peff.net","subject":"[PATCH 1/2] t5561: drop curl stderr redirects","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-04-03T14:01:41Z","receivedAt":"2018-04-03T14:01:47Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"For a normal test run, stderr is already redirected to\n/dev/null by the test suite. When used with \"-v\",\nsuppressing stderr is actively harmful, as it may hide the\nreason for curl failing.\n\nReported-by: Jens Krüger <Jens.Krueger@frm2.tum.de>\nSigned-off-by: Jeff King <peff@peff.net>\n---\n t/t5561-http-backend.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t5561-http-backend.sh b/t/t5561-http-backend.sh\nindex 90e0d6f0fe..6167563986 100755\n--- a/t/t5561-http-backend.sh\n+++ b/t/t5561-http-backend.sh\n@@ -6,7 +6,7 @@ test_description='test git-http-backend'\n start_httpd\n \n GET() {\n-\tcurl --include \"$HTTPD_URL/$SMART/repo.git/$1\" >out 2>/dev/null &&\n+\tcurl --include \"$HTTPD_URL/$SMART/repo.git/$1\" >out &&\n \ttr '\\015' Q <out |\n \tsed '\n \t\ts/Q$//\n@@ -19,7 +19,7 @@ GET() {\n POST() {\n \tcurl --include --data \"$2\" \\\n \t--header \"Content-Type: application/x-$1-request\" \\\n-\t\"$HTTPD_URL/smart/repo.git/$1\" >out 2>/dev/null &&\n+\t\"$HTTPD_URL/smart/repo.git/$1\" >out &&\n \ttr '\\015' Q <out |\n \tsed '\n \t\ts/Q$//\n-- \n2.17.0.686.g08b0810b04\n\n"},{"id":"343696","messageId":"20180403140157.GB30376@sigill.intra.peff.net","threadId":"48209","inReplyTo":"20180403140055.GA29556@sigill.intra.peff.net","subject":"[PATCH 2/2] t5561: skip tests if curl is not available","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-04-03T14:01:57Z","receivedAt":"2018-04-03T14:02:04Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"It's possible to have libcurl installed but not the curl\ncommand-line utility. The latter is not generally needed for\nGit's http support, but we use it in t5561 for basic tests\nof http-backend's functionality. Let's detect when it's\nmissing and skip this test.\n\nNote that we can't mark the individual tests with the CURL\nprerequisite. They're in a shared t556x_common that uses the\nGET and POST functions as a level of indirection, and it's\nonly our implementations of those functions in t5561 that\nrequires curl. It's not a problem, though, as literally\nevery test in the script would depend on the prerequisite\nanyway.\n\nReported-by: Jens Krüger <Jens.Krueger@frm2.tum.de>\nSigned-off-by: Jeff King <peff@peff.net>\n---\n t/t5561-http-backend.sh | 6 ++++++\n t/test-lib.sh           | 4 ++++\n 2 files changed, 10 insertions(+)\n\ndiff --git a/t/t5561-http-backend.sh b/t/t5561-http-backend.sh\nindex 6167563986..84a955770a 100755\n--- a/t/t5561-http-backend.sh\n+++ b/t/t5561-http-backend.sh\n@@ -3,6 +3,12 @@\n test_description='test git-http-backend'\n . ./test-lib.sh\n . \"$TEST_DIRECTORY\"/lib-httpd.sh\n+\n+if ! test_have_prereq CURL; then\n+\tskip_all='skipping raw http-backend tests, curl not available'\n+\ttest_done\n+fi\n+\n start_httpd\n \n GET() {\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 7740d511d2..1aa39fe889 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1208,3 +1208,7 @@ test_lazy_prereq LONG_IS_64BIT '\n \n test_lazy_prereq TIME_IS_64BIT 'test-date is64bit'\n test_lazy_prereq TIME_T_IS_64BIT 'test-date time_t-is64bit'\n+\n+test_lazy_prereq CURL '\n+\tcurl --version\n+'\n-- \n2.17.0.686.g08b0810b04\n"}]}