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 2/5] serve tests: use test_cmp in "protocol violations" test
Date: Wed, 14 Jul 2021 02:54:02 +0200 [thread overview]
Message-ID: <patch-2.5-64dfd14865-20210714T005115Z-avarab@gmail.com> (raw)
In-Reply-To: <cover-0.5-0000000000-20210714T005115Z-avarab@gmail.com>
Amend the protocol violations tests to check the full output, not just
grep it. This changes code added in 4845b772458 (upload-pack: handle
unexpected delim packets, 2020-03-27). The newly added test in the
preceding commit already did the full test_cmp.
I have a related series to tweak the output from upload-pack et al, we
really want to make sure we have this exact output, and not fewer or
more lines etc.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
t/t5704-protocol-violations.sh | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/t/t5704-protocol-violations.sh b/t/t5704-protocol-violations.sh
index 95f68e1d4b..038fffd3d0 100755
--- a/t/t5704-protocol-violations.sh
+++ b/t/t5704-protocol-violations.sh
@@ -14,9 +14,12 @@ test_expect_success 'extra delim packet in v2 ls-refs args' '
# protocol expects 0000 flush here
printf 0001
} >input &&
+ cat >err.expect <<-\EOF &&
+ fatal: expected flush after ls-refs arguments
+ EOF
test_must_fail env GIT_PROTOCOL=version=2 \
- git upload-pack . <input 2>err &&
- test_i18ngrep "expected flush after ls-refs arguments" err
+ git upload-pack . <input 2>err.actual &&
+ test_cmp err.expect err.actual
'
test_expect_success 'extra delim packet in v2 fetch args' '
@@ -27,9 +30,12 @@ test_expect_success 'extra delim packet in v2 fetch args' '
# protocol expects 0000 flush here
printf 0001
} >input &&
+ cat >err.expect <<-\EOF &&
+ fatal: expected flush after fetch arguments
+ EOF
test_must_fail env GIT_PROTOCOL=version=2 \
- git upload-pack . <input 2>err &&
- test_i18ngrep "expected flush after fetch arguments" err
+ git upload-pack . <input 2>err.actual &&
+ test_cmp err.expect err.actual
'
test_expect_success 'extra delim packet in v2 object-info args' '
--
2.32.0.788.ge724008458
next prev parent 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 ` [PATCH v3 1/5] serve tests: add missing "extra delim" test Ævar Arnfjörð Bjarmason
2021-07-14 0:54 ` Ævar Arnfjörð Bjarmason [this message]
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=patch-2.5-64dfd14865-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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).