3 test_description='test git-http-backend'
6 if test -n "$NO_CURL"; then
7 say 'skipping test, git built without http support'
11 LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5561'}
12 . "$TEST_DIRECTORY"/lib-httpd.sh
16 curl --include "$HTTPD_URL/$SMART/repo.git/$1" >out 2>/dev/null &&
22 echo "HTTP/1.1 $2" >exp &&
27 curl --include --data "$2" \
28 --header "Content-Type: application/x-$1-request" \
29 "$HTTPD_URL/smart/repo.git/$1" >out 2>/dev/null &&
35 echo "HTTP/1.1 $3" >exp &&
40 echo >>"$HTTPD_ROOT_PATH"/access.log
41 echo "### $1" >>"$HTTPD_ROOT_PATH"/access.log
42 echo "###" >>"$HTTPD_ROOT_PATH"/access.log
45 . "$TEST_DIRECTORY"/t556x_common
51 GET /smart/repo.git/refs/heads/master HTTP/1.1 404 -
53 ### getanyfile default
55 GET /smart/repo.git/HEAD HTTP/1.1 200
56 GET /smart/repo.git/info/refs HTTP/1.1 200
57 GET /smart/repo.git/objects/info/packs HTTP/1.1 200
58 GET /smart/repo.git/objects/info/alternates HTTP/1.1 200 -
59 GET /smart/repo.git/objects/info/http-alternates HTTP/1.1 200 -
60 GET /smart/repo.git/$LOOSE_URL HTTP/1.1 200
61 GET /smart/repo.git/$PACK_URL HTTP/1.1 200
62 GET /smart/repo.git/$IDX_URL HTTP/1.1 200
64 ### no git-daemon-export-ok
66 GET /smart_noexport/repo.git/HEAD HTTP/1.1 404 -
67 GET /smart_noexport/repo.git/info/refs HTTP/1.1 404 -
68 GET /smart_noexport/repo.git/objects/info/packs HTTP/1.1 404 -
69 GET /smart_noexport/repo.git/objects/info/alternates HTTP/1.1 404 -
70 GET /smart_noexport/repo.git/objects/info/http-alternates HTTP/1.1 404 -
71 GET /smart_noexport/repo.git/$LOOSE_URL HTTP/1.1 404 -
72 GET /smart_noexport/repo.git/$PACK_URL HTTP/1.1 404 -
73 GET /smart_noexport/repo.git/$IDX_URL HTTP/1.1 404 -
75 ### git-daemon-export-ok
77 GET /smart_noexport/repo.git/HEAD HTTP/1.1 200
78 GET /smart_noexport/repo.git/info/refs HTTP/1.1 200
79 GET /smart_noexport/repo.git/objects/info/packs HTTP/1.1 200
80 GET /smart_noexport/repo.git/objects/info/alternates HTTP/1.1 200 -
81 GET /smart_noexport/repo.git/objects/info/http-alternates HTTP/1.1 200 -
82 GET /smart_noexport/repo.git/$LOOSE_URL HTTP/1.1 200
83 GET /smart_noexport/repo.git/$PACK_URL HTTP/1.1 200
84 GET /smart_noexport/repo.git/$IDX_URL HTTP/1.1 200
88 GET /smart/repo.git/HEAD HTTP/1.1 200
89 GET /smart/repo.git/info/refs HTTP/1.1 200
90 GET /smart/repo.git/objects/info/packs HTTP/1.1 200
91 GET /smart/repo.git/objects/info/alternates HTTP/1.1 200 -
92 GET /smart/repo.git/objects/info/http-alternates HTTP/1.1 200 -
93 GET /smart/repo.git/$LOOSE_URL HTTP/1.1 200
94 GET /smart/repo.git/$PACK_URL HTTP/1.1 200
95 GET /smart/repo.git/$IDX_URL HTTP/1.1 200
99 GET /smart/repo.git/HEAD HTTP/1.1 403 -
100 GET /smart/repo.git/info/refs HTTP/1.1 403 -
101 GET /smart/repo.git/objects/info/packs HTTP/1.1 403 -
102 GET /smart/repo.git/objects/info/alternates HTTP/1.1 403 -
103 GET /smart/repo.git/objects/info/http-alternates HTTP/1.1 403 -
104 GET /smart/repo.git/$LOOSE_URL HTTP/1.1 403 -
105 GET /smart/repo.git/$PACK_URL HTTP/1.1 403 -
106 GET /smart/repo.git/$IDX_URL HTTP/1.1 403 -
108 ### uploadpack default
110 GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
111 POST /smart/repo.git/git-upload-pack HTTP/1.1 200 -
115 GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
116 POST /smart/repo.git/git-upload-pack HTTP/1.1 200 -
120 GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 403 -
121 POST /smart/repo.git/git-upload-pack HTTP/1.1 403 -
123 ### receivepack default
125 GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 403 -
126 POST /smart/repo.git/git-receive-pack HTTP/1.1 403 -
130 GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 200
131 POST /smart/repo.git/git-receive-pack HTTP/1.1 200 -
133 ### receivepack false
135 GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 403 -
136 POST /smart/repo.git/git-receive-pack HTTP/1.1 403 -
138 test_expect_success 'server request log matches test results' '
144 " >act <"$HTTPD_ROOT_PATH"/access.log &&