1
#!/bin/sh
2
3
-test_description='test git-serve and server commands'
3
+test_description='test protocol v2 server commands'
4
5
. ./test-lib.sh
6
14
0000
15
EOF
16
17
- GIT_TEST_SIDEBAND_ALL=0 git serve --advertise-capabilities >out &&
17
+ GIT_TEST_SIDEBAND_ALL=0 test-tool serve-v2 \
18
+ --advertise-capabilities >out &&
19
test-tool pkt-line unpack <out >actual &&
20
test_cmp expect actual
21
'
25
test-tool pkt-line pack >in <<-EOF &&
26
0000
27
EOF
27
- git serve --stateless-rpc >out <in &&
28
+ test-tool serve-v2 --stateless-rpc >out <in &&
29
test_must_be_empty out &&
30
31
# EOF
31
- git serve --stateless-rpc >out &&
32
+ test-tool serve-v2 --stateless-rpc >out &&
33
test_must_be_empty out
34
'
35
38
foobar
39
0000
40
EOF
40
- test_must_fail git serve --stateless-rpc 2>err <in &&
41
+ test_must_fail test-tool serve-v2 --stateless-rpc 2>err <in &&
42
test_i18ngrep "unknown capability" err
43
'
44
47
agent=git/test
48
0000
49
EOF
49
- test_must_fail git serve --stateless-rpc 2>err <in &&
50
+ test_must_fail test-tool serve-v2 --stateless-rpc 2>err <in &&
51
test_i18ngrep "no command requested" err
52
'
53
57
agent=git/test
58
0000
59
EOF
59
- test_must_fail git serve --stateless-rpc 2>err <in &&
60
+ test_must_fail test-tool serve-v2 --stateless-rpc 2>err <in &&
61
test_i18ngrep "invalid command" err
62
'
63
88
0000
89
EOF
90
90
- git serve --stateless-rpc <in >out &&
91
+ test-tool serve-v2 --stateless-rpc <in >out &&
92
test-tool pkt-line unpack <out >actual &&
93
test_cmp expect actual
94
'
108
0000
109
EOF
110
110
- git serve --stateless-rpc <in >out &&
111
+ test-tool serve-v2 --stateless-rpc <in >out &&
112
test-tool pkt-line unpack <out >actual &&
113
test_cmp expect actual
114
'
128
0000
129
EOF
130
130
- git serve --stateless-rpc <in >out &&
131
+ test-tool serve-v2 --stateless-rpc <in >out &&
132
test-tool pkt-line unpack <out >actual &&
133
test_cmp expect actual
134
'
149
0000
150
EOF
151
151
- git serve --stateless-rpc <in >out &&
152
+ test-tool serve-v2 --stateless-rpc <in >out &&
153
test-tool pkt-line unpack <out >actual &&
154
test_cmp expect actual
155
'
170
0000
171
EOF
172
172
- git serve --stateless-rpc <in >out &&
173
+ test-tool serve-v2 --stateless-rpc <in >out &&
174
test-tool pkt-line unpack <out >actual &&
175
test_cmp expect actual
176
'
190
0000
191
EOF
192
192
- git serve --stateless-rpc <in >out &&
193
+ test-tool serve-v2 --stateless-rpc <in >out &&
194
test-tool pkt-line unpack <out >actual &&
195
test_cmp expect actual
196
'
205
0000
206
EOF
207
207
- test_must_fail git -C server serve --stateless-rpc <in >/dev/null 2>err &&
208
+ (
209
+ cd server &&
210
+ test_must_fail test-tool serve-v2 --stateless-rpc
211
+ ) <in >/dev/null 2>err &&
212
grep "unexpected line: .this-is-not-a-command." err
213
'
214