3 test_description
='test git-http-backend'
4 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
8 .
"$TEST_DIRECTORY"/lib-httpd.sh
10 if ! test_have_prereq CURL
; then
11 skip_all
='skipping raw http-backend tests, curl not available'
18 curl
--include "$HTTPD_URL/$SMART/repo.git/$1" >out
&&
24 echo "HTTP/1.1 $2" >exp
&&
29 curl
--include --data "$2" \
30 --header "Content-Type: application/x-$1-request" \
31 "$HTTPD_URL/smart/repo.git/$1" >out
&&
37 echo "HTTP/1.1 $3" >exp
&&
41 .
"$TEST_DIRECTORY"/t556x_common
43 grep '^[^#]' >exp
<<EOF
47 GET /smart/repo.git/refs/heads/main HTTP/1.1 404 -
49 ### getanyfile default
51 GET /smart/repo.git/HEAD HTTP/1.1 200
52 GET /smart/repo.git/info/refs HTTP/1.1 200
53 GET /smart/repo.git/objects/info/packs HTTP/1.1 200
54 GET /smart/repo.git/objects/info/alternates HTTP/1.1 200 -
55 GET /smart/repo.git/objects/info/http-alternates HTTP/1.1 200 -
56 GET /smart/repo.git/$LOOSE_URL HTTP/1.1 200
57 GET /smart/repo.git/$PACK_URL HTTP/1.1 200
58 GET /smart/repo.git/$IDX_URL HTTP/1.1 200
60 ### no git-daemon-export-ok
62 GET /smart_noexport/repo.git/HEAD HTTP/1.1 404 -
63 GET /smart_noexport/repo.git/info/refs HTTP/1.1 404 -
64 GET /smart_noexport/repo.git/objects/info/packs HTTP/1.1 404 -
65 GET /smart_noexport/repo.git/objects/info/alternates HTTP/1.1 404 -
66 GET /smart_noexport/repo.git/objects/info/http-alternates HTTP/1.1 404 -
67 GET /smart_noexport/repo.git/$LOOSE_URL HTTP/1.1 404 -
68 GET /smart_noexport/repo.git/$PACK_URL HTTP/1.1 404 -
69 GET /smart_noexport/repo.git/$IDX_URL HTTP/1.1 404 -
71 ### git-daemon-export-ok
73 GET /smart_noexport/repo.git/HEAD HTTP/1.1 200
74 GET /smart_noexport/repo.git/info/refs HTTP/1.1 200
75 GET /smart_noexport/repo.git/objects/info/packs HTTP/1.1 200
76 GET /smart_noexport/repo.git/objects/info/alternates HTTP/1.1 200 -
77 GET /smart_noexport/repo.git/objects/info/http-alternates HTTP/1.1 200 -
78 GET /smart_noexport/repo.git/$LOOSE_URL HTTP/1.1 200
79 GET /smart_noexport/repo.git/$PACK_URL HTTP/1.1 200
80 GET /smart_noexport/repo.git/$IDX_URL HTTP/1.1 200
84 GET /smart/repo.git/HEAD HTTP/1.1 200
85 GET /smart/repo.git/info/refs HTTP/1.1 200
86 GET /smart/repo.git/objects/info/packs HTTP/1.1 200
87 GET /smart/repo.git/objects/info/alternates HTTP/1.1 200 -
88 GET /smart/repo.git/objects/info/http-alternates HTTP/1.1 200 -
89 GET /smart/repo.git/$LOOSE_URL HTTP/1.1 200
90 GET /smart/repo.git/$PACK_URL HTTP/1.1 200
91 GET /smart/repo.git/$IDX_URL HTTP/1.1 200
95 GET /smart/repo.git/HEAD HTTP/1.1 403 -
96 GET /smart/repo.git/info/refs HTTP/1.1 403 -
97 GET /smart/repo.git/objects/info/packs HTTP/1.1 403 -
98 GET /smart/repo.git/objects/info/alternates HTTP/1.1 403 -
99 GET /smart/repo.git/objects/info/http-alternates HTTP/1.1 403 -
100 GET /smart/repo.git/$LOOSE_URL HTTP/1.1 403 -
101 GET /smart/repo.git/$PACK_URL HTTP/1.1 403 -
102 GET /smart/repo.git/$IDX_URL HTTP/1.1 403 -
104 ### uploadpack default
106 GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
107 POST /smart/repo.git/git-upload-pack HTTP/1.1 200 -
111 GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
112 POST /smart/repo.git/git-upload-pack HTTP/1.1 200 -
116 GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 403 -
117 POST /smart/repo.git/git-upload-pack HTTP/1.1 403 -
119 ### receivepack default
121 GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 403 -
122 POST /smart/repo.git/git-receive-pack HTTP/1.1 403 -
126 GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 200
127 POST /smart/repo.git/git-receive-pack HTTP/1.1 200 -
129 ### receivepack false
131 GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 403 -
132 POST /smart/repo.git/git-receive-pack HTTP/1.1 403 -
134 test_expect_success
'server request log matches test results' '