All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>, "Jeff King" <peff@peff.net>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH v3 1/5] serve tests: add missing "extra delim" test
Date: Wed, 14 Jul 2021 02:54:01 +0200	[thread overview]
Message-ID: <patch-1.5-67aa814115-20210714T005115Z-avarab@gmail.com> (raw)
In-Reply-To: <cover-0.5-0000000000-20210714T005115Z-avarab@gmail.com>

When the object-info protocol v2 call was added in
a2ba162cda2 (object-info: support for retrieving object info,
2021-04-20) we didn't add a corresponding test here.

We had tests for ls-refs and fetch already since
4845b772458 (upload-pack: handle unexpected delim packets,
2020-03-27), but the same behavior in object-info (which is clearly
copied from the template of "ls-refs") did not have the corresponding
tests.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t5704-protocol-violations.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/t/t5704-protocol-violations.sh b/t/t5704-protocol-violations.sh
index 5c941949b9..95f68e1d4b 100755
--- a/t/t5704-protocol-violations.sh
+++ b/t/t5704-protocol-violations.sh
@@ -32,4 +32,21 @@ test_expect_success 'extra delim packet in v2 fetch args' '
 	test_i18ngrep "expected flush after fetch arguments" err
 '
 
+test_expect_success 'extra delim packet in v2 object-info args' '
+	# protocol expects 0000 flush after the 0001
+	test-tool pkt-line pack >input <<-EOF &&
+	command=object-info
+	object-format=$(test_oid algo)
+	0001
+	0001
+	EOF
+
+	cat >err.expect <<-\EOF &&
+	fatal: object-info: expected flush after arguments
+	EOF
+	test_must_fail env GIT_PROTOCOL=version=2 \
+		git upload-pack . <input 2>err.actual &&
+	test_cmp err.expect err.actual
+'
+
 test_done
-- 
2.32.0.788.ge724008458


  reply	other threads:[~2021-07-14  0:54 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07 10:21 [PATCH 0/5] tests: migrate to "test-tool pkt-line" Ævar Arnfjörð Bjarmason
2021-07-07 10:21 ` [PATCH 1/5] serve tests: add missing "extra delim" test Ævar Arnfjörð Bjarmason
2021-07-07 10:21 ` [PATCH 2/5] serve tests: use test_cmp in "protocol violations" test Ævar Arnfjörð Bjarmason
2021-07-07 10:21 ` [PATCH 3/5] tests: replace [de]packetize() shell+perl test-tool pkt-line Ævar Arnfjörð Bjarmason
2021-07-07 10:21 ` [PATCH 4/5] tests: replace remaining packetize() with "test-tool pkt-line" Ævar Arnfjörð Bjarmason
2021-07-07 10:21 ` [PATCH 5/5] test-lib-functions.sh: remove unused [de]packetize() functions Ævar Arnfjörð Bjarmason
2021-07-12 16:44 ` [PATCH v2 0/5] tests: migrate to "test-tool pkt-line" Ævar Arnfjörð Bjarmason
2021-07-12 16:44   ` [PATCH v2 1/5] serve tests: add missing "extra delim" test Ævar Arnfjörð Bjarmason
2021-07-12 16:44   ` [PATCH v2 2/5] serve tests: use test_cmp in "protocol violations" test Ævar Arnfjörð Bjarmason
2021-07-12 16:44   ` [PATCH v2 3/5] tests: replace [de]packetize() shell+perl test-tool pkt-line Ævar Arnfjörð Bjarmason
2021-07-13 20:50     ` Jeff King
2021-07-13 23:41       ` Ævar Arnfjörð Bjarmason
2021-07-14  1:12         ` Jeff King
2021-07-12 16:44   ` [PATCH v2 4/5] tests: replace remaining packetize() with "test-tool pkt-line" Ævar Arnfjörð Bjarmason
2021-07-13 20:58     ` Jeff King
2021-07-13 23:52       ` Ævar Arnfjörð Bjarmason
2021-07-14  1:16         ` Jeff King
2021-07-12 16:44   ` [PATCH v2 5/5] test-lib-functions.sh: remove unused [de]packetize() functions Ævar Arnfjörð Bjarmason
2021-07-12 20:41   ` [PATCH v2 0/5] tests: migrate to "test-tool pkt-line" Junio C Hamano
2021-07-13 21:00     ` Jeff King
2021-07-14  0:54   ` [PATCH v3 " Ævar Arnfjörð Bjarmason
2021-07-14  0:54     ` Ævar Arnfjörð Bjarmason [this message]
2021-07-14  0:54     ` [PATCH v3 2/5] serve tests: use test_cmp in "protocol violations" test Ævar Arnfjörð Bjarmason
2021-07-14  0:54     ` [PATCH v3 3/5] tests: replace [de]packetize() shell+perl test-tool pkt-line Ævar Arnfjörð Bjarmason
2021-07-14  4:04       ` Taylor Blau
2021-07-14 16:22         ` Junio C Hamano
2021-07-14  0:54     ` [PATCH v3 4/5] tests: replace remaining packetize() with "test-tool pkt-line" Ævar Arnfjörð Bjarmason
2021-07-14  0:54     ` [PATCH v3 5/5] test-lib-functions.sh: remove unused [de]packetize() functions Ævar Arnfjörð Bjarmason
2021-07-16 15:41     ` [PATCH v4] test-lib-functions: use test-tool for [de]packetize() Ævar Arnfjörð Bjarmason
2021-07-16 16:53       ` Taylor Blau
2021-07-16 19:08         ` Jeff King
2021-07-16 19:03       ` Jeff King
2021-07-19 18:54       ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=patch-1.5-67aa814115-20210714T005115Z-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.