]> git.ipfire.org Git - thirdparty/git.git/blame - t/t5704-protocol-violations.sh
upload-pack: move allow_unadvertised_object_request to upload_pack_data
[thirdparty/git.git] / t / t5704-protocol-violations.sh
CommitLineData
4845b772
JK
1#!/bin/sh
2
3test_description='Test responses to violations of the network protocol. In most
4of these cases it will generally be acceptable for one side to break off
5communications if the other side says something unexpected. We are mostly
6making sure that we do not segfault or otherwise behave badly.'
7. ./test-lib.sh
8
9test_expect_success 'extra delim packet in v2 ls-refs args' '
10 {
11 packetize command=ls-refs &&
12 printf 0001 &&
13 # protocol expects 0000 flush here
14 printf 0001
15 } >input &&
16 test_must_fail env GIT_PROTOCOL=version=2 \
17 git upload-pack . <input 2>err &&
18 test_i18ngrep "expected flush after ls-refs arguments" err
19'
20
21test_expect_success 'extra delim packet in v2 fetch args' '
22 {
23 packetize command=fetch &&
24 printf 0001 &&
25 # protocol expects 0000 flush here
26 printf 0001
27 } >input &&
28 test_must_fail env GIT_PROTOCOL=version=2 \
29 git upload-pack . <input 2>err &&
30 test_i18ngrep "expected flush after fetch arguments" err
31'
32
33test_done