3 test_description='test git-http-backend'
5 . "$TEST_DIRECTORY"/lib-httpd.sh
9 curl --include "$HTTPD_URL/$SMART/repo.git/$1" >out 2>/dev/null &&
15 echo "HTTP/1.1 $2" >exp &&
20 curl --include --data "$2" \
21 --header "Content-Type: application/x-$1-request" \
22 "$HTTPD_URL/smart/repo.git/$1" >out 2>/dev/null &&
28 echo "HTTP/1.1 $3" >exp &&
32 . "$TEST_DIRECTORY"/t556x_common
34 grep '^[^#]' >exp <<EOF
38 GET /smart/repo.git/refs/heads/master HTTP/1.1 404 -
40 ### getanyfile default
42 GET /smart/repo.git/HEAD HTTP/1.1 200
43 GET /smart/repo.git/info/refs HTTP/1.1 200
44 GET /smart/repo.git/objects/info/packs HTTP/1.1 200
45 GET /smart/repo.git/objects/info/alternates HTTP/1.1 200 -
46 GET /smart/repo.git/objects/info/http-alternates HTTP/1.1 200 -
47 GET /smart/repo.git/$LOOSE_URL HTTP/1.1 200
48 GET /smart/repo.git/$PACK_URL HTTP/1.1 200
49 GET /smart/repo.git/$IDX_URL HTTP/1.1 200
51 ### no git-daemon-export-ok
53 GET /smart_noexport/repo.git/HEAD HTTP/1.1 404 -
54 GET /smart_noexport/repo.git/info/refs HTTP/1.1 404 -
55 GET /smart_noexport/repo.git/objects/info/packs HTTP/1.1 404 -
56 GET /smart_noexport/repo.git/objects/info/alternates HTTP/1.1 404 -
57 GET /smart_noexport/repo.git/objects/info/http-alternates HTTP/1.1 404 -
58 GET /smart_noexport/repo.git/$LOOSE_URL HTTP/1.1 404 -
59 GET /smart_noexport/repo.git/$PACK_URL HTTP/1.1 404 -
60 GET /smart_noexport/repo.git/$IDX_URL HTTP/1.1 404 -
62 ### git-daemon-export-ok
64 GET /smart_noexport/repo.git/HEAD HTTP/1.1 200
65 GET /smart_noexport/repo.git/info/refs HTTP/1.1 200
66 GET /smart_noexport/repo.git/objects/info/packs HTTP/1.1 200
67 GET /smart_noexport/repo.git/objects/info/alternates HTTP/1.1 200 -
68 GET /smart_noexport/repo.git/objects/info/http-alternates HTTP/1.1 200 -
69 GET /smart_noexport/repo.git/$LOOSE_URL HTTP/1.1 200
70 GET /smart_noexport/repo.git/$PACK_URL HTTP/1.1 200
71 GET /smart_noexport/repo.git/$IDX_URL HTTP/1.1 200
75 GET /smart/repo.git/HEAD HTTP/1.1 200
76 GET /smart/repo.git/info/refs HTTP/1.1 200
77 GET /smart/repo.git/objects/info/packs HTTP/1.1 200
78 GET /smart/repo.git/objects/info/alternates HTTP/1.1 200 -
79 GET /smart/repo.git/objects/info/http-alternates HTTP/1.1 200 -
80 GET /smart/repo.git/$LOOSE_URL HTTP/1.1 200
81 GET /smart/repo.git/$PACK_URL HTTP/1.1 200
82 GET /smart/repo.git/$IDX_URL HTTP/1.1 200
86 GET /smart/repo.git/HEAD HTTP/1.1 403 -
87 GET /smart/repo.git/info/refs HTTP/1.1 403 -
88 GET /smart/repo.git/objects/info/packs HTTP/1.1 403 -
89 GET /smart/repo.git/objects/info/alternates HTTP/1.1 403 -
90 GET /smart/repo.git/objects/info/http-alternates HTTP/1.1 403 -
91 GET /smart/repo.git/$LOOSE_URL HTTP/1.1 403 -
92 GET /smart/repo.git/$PACK_URL HTTP/1.1 403 -
93 GET /smart/repo.git/$IDX_URL HTTP/1.1 403 -
95 ### uploadpack default
97 GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
98 POST /smart/repo.git/git-upload-pack HTTP/1.1 200 -
102 GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
103 POST /smart/repo.git/git-upload-pack HTTP/1.1 200 -
107 GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 403 -
108 POST /smart/repo.git/git-upload-pack HTTP/1.1 403 -
110 ### receivepack default
112 GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 403 -
113 POST /smart/repo.git/git-receive-pack HTTP/1.1 403 -
117 GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 200
118 POST /smart/repo.git/git-receive-pack HTTP/1.1 200 -
120 ### receivepack false
122 GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 403 -
123 POST /smart/repo.git/git-receive-pack HTTP/1.1 403 -
125 test_expect_success 'server request log matches test results' '
131 " >act <"$HTTPD_ROOT_PATH"/access.log &&