3 test_description='test git-http-backend'
6 if test -n "$NO_CURL"; then
7 skip_all='skipping test, git built without http support'
11 . "$TEST_DIRECTORY"/lib-httpd.sh
15 curl --include "$HTTPD_URL/$SMART/repo.git/$1" >out 2>/dev/null &&
21 echo "HTTP/1.1 $2" >exp &&
26 curl --include --data "$2" \
27 --header "Content-Type: application/x-$1-request" \
28 "$HTTPD_URL/smart/repo.git/$1" >out 2>/dev/null &&
34 echo "HTTP/1.1 $3" >exp &&
39 echo >>"$HTTPD_ROOT_PATH"/access.log
40 echo "### $1" >>"$HTTPD_ROOT_PATH"/access.log
41 echo "###" >>"$HTTPD_ROOT_PATH"/access.log
44 . "$TEST_DIRECTORY"/t556x_common
50 GET /smart/repo.git/refs/heads/master HTTP/1.1 404 -
52 ### getanyfile default
54 GET /smart/repo.git/HEAD HTTP/1.1 200
55 GET /smart/repo.git/info/refs HTTP/1.1 200
56 GET /smart/repo.git/objects/info/packs HTTP/1.1 200
57 GET /smart/repo.git/objects/info/alternates HTTP/1.1 200 -
58 GET /smart/repo.git/objects/info/http-alternates HTTP/1.1 200 -
59 GET /smart/repo.git/$LOOSE_URL HTTP/1.1 200
60 GET /smart/repo.git/$PACK_URL HTTP/1.1 200
61 GET /smart/repo.git/$IDX_URL HTTP/1.1 200
63 ### no git-daemon-export-ok
65 GET /smart_noexport/repo.git/HEAD HTTP/1.1 404 -
66 GET /smart_noexport/repo.git/info/refs HTTP/1.1 404 -
67 GET /smart_noexport/repo.git/objects/info/packs HTTP/1.1 404 -
68 GET /smart_noexport/repo.git/objects/info/alternates HTTP/1.1 404 -
69 GET /smart_noexport/repo.git/objects/info/http-alternates HTTP/1.1 404 -
70 GET /smart_noexport/repo.git/$LOOSE_URL HTTP/1.1 404 -
71 GET /smart_noexport/repo.git/$PACK_URL HTTP/1.1 404 -
72 GET /smart_noexport/repo.git/$IDX_URL HTTP/1.1 404 -
74 ### git-daemon-export-ok
76 GET /smart_noexport/repo.git/HEAD HTTP/1.1 200
77 GET /smart_noexport/repo.git/info/refs HTTP/1.1 200
78 GET /smart_noexport/repo.git/objects/info/packs HTTP/1.1 200
79 GET /smart_noexport/repo.git/objects/info/alternates HTTP/1.1 200 -
80 GET /smart_noexport/repo.git/objects/info/http-alternates HTTP/1.1 200 -
81 GET /smart_noexport/repo.git/$LOOSE_URL HTTP/1.1 200
82 GET /smart_noexport/repo.git/$PACK_URL HTTP/1.1 200
83 GET /smart_noexport/repo.git/$IDX_URL HTTP/1.1 200
87 GET /smart/repo.git/HEAD HTTP/1.1 200
88 GET /smart/repo.git/info/refs HTTP/1.1 200
89 GET /smart/repo.git/objects/info/packs HTTP/1.1 200
90 GET /smart/repo.git/objects/info/alternates HTTP/1.1 200 -
91 GET /smart/repo.git/objects/info/http-alternates HTTP/1.1 200 -
92 GET /smart/repo.git/$LOOSE_URL HTTP/1.1 200
93 GET /smart/repo.git/$PACK_URL HTTP/1.1 200
94 GET /smart/repo.git/$IDX_URL HTTP/1.1 200
98 GET /smart/repo.git/HEAD HTTP/1.1 403 -
99 GET /smart/repo.git/info/refs HTTP/1.1 403 -
100 GET /smart/repo.git/objects/info/packs HTTP/1.1 403 -
101 GET /smart/repo.git/objects/info/alternates HTTP/1.1 403 -
102 GET /smart/repo.git/objects/info/http-alternates HTTP/1.1 403 -
103 GET /smart/repo.git/$LOOSE_URL HTTP/1.1 403 -
104 GET /smart/repo.git/$PACK_URL HTTP/1.1 403 -
105 GET /smart/repo.git/$IDX_URL HTTP/1.1 403 -
107 ### uploadpack default
109 GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
110 POST /smart/repo.git/git-upload-pack HTTP/1.1 200 -
114 GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
115 POST /smart/repo.git/git-upload-pack HTTP/1.1 200 -
119 GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 403 -
120 POST /smart/repo.git/git-upload-pack HTTP/1.1 403 -
122 ### receivepack default
124 GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 403 -
125 POST /smart/repo.git/git-receive-pack HTTP/1.1 403 -
129 GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 200
130 POST /smart/repo.git/git-receive-pack HTTP/1.1 200 -
132 ### receivepack false
134 GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 403 -
135 POST /smart/repo.git/git-receive-pack HTTP/1.1 403 -
137 test_expect_success 'server request log matches test results' '
143 " >act <"$HTTPD_ROOT_PATH"/access.log &&