git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tay Ray Chuan <rctay89@gmail.com>
To: "Git Mailing List" <git@vger.kernel.org>
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Shawn O. Pearce" <spearce@spearce.org>,
	Dan McGee <dpmcgee@gmail.com>
Subject: [PATCH v4 1/4] t5541-http-push: add test for chunked
Date: Wed,  4 May 2011 18:11:33 +0800	[thread overview]
Message-ID: <1304503896-5988-2-git-send-email-rctay89@gmail.com> (raw)
In-Reply-To: <1304503896-5988-1-git-send-email-rctay89@gmail.com>

Trigger the chunked type of pushing for smart HTTP. This can serve as a
regression test for the issue fixed in 1e41827 (http: clear POSTFIELDS
when initializing a slot).

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---

Changed in v4: simplified the way chunked pushing is triggered. The test
now runs in a tarball extract.

 t/t5541-http-push.sh |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index 0492877..0c0917a 100755
--- a/t/t5541-http-push.sh
+++ b/t/t5541-http-push.sh
@@ -65,14 +65,16 @@ test_expect_success 'clone remote repository' '
 	git clone $HTTPD_URL/smart/test_repo.git test_repo_clone
 '
 
-test_expect_success 'push to remote repository' '
+test_expect_success 'push to remote repository (standard)' '
 	cd "$ROOT_PATH"/test_repo_clone &&
 	: >path2 &&
 	git add path2 &&
 	test_tick &&
 	git commit -m path2 &&
 	HEAD=$(git rev-parse --verify HEAD) &&
-	git push &&
+	GIT_CURL_VERBOSE=1 git push -v -v 2>err &&
+	! grep "Expect: 100-continue" err &&
+	grep "POST git-receive-pack (376 bytes)" err &&
 	(cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
 	 test $HEAD = $(git rev-parse --verify HEAD))
 '
@@ -140,5 +142,17 @@ test_expect_success C_LOCALE_OUTPUT 'push fails for non-fast-forward refs unmatc
 		output
 '
 
+test_expect_success 'push (chunked)' '
+	git checkout master &&
+	test_commit commit path3 &&
+	HEAD=$(git rev-parse --verify HEAD) &&
+	git config http.postbuffer 4 &&
+	git push -v -v origin $BRANCH 2>err &&
+	grep "POST git-receive-pack (chunked)" err &&
+	(cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
+	 test $HEAD = $(git rev-parse --verify HEAD)) &&
+	git config --unset http.postbuffer
+'
+
 stop_httpd
 test_done
-- 
1.7.3.3.585.g74f6e

  reply	other threads:[~2011-05-04 10:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-03 15:47 [PATCH v3 0/4] http cleanups Tay Ray Chuan
2011-05-03 15:47 ` [PATCH v3 1/4] t5541-http-push: add test for chunked Tay Ray Chuan
2011-05-03 15:47   ` [PATCH v3 2/4] http: make curl callbacks match contracts from curl header Tay Ray Chuan
2011-05-03 15:47     ` [PATCH v3 3/4] http-push: use const for strings in signatures Tay Ray Chuan
2011-05-03 15:47       ` [PATCH v3 4/4] http-push: refactor curl_easy_setup madness Tay Ray Chuan
2011-05-03 16:32   ` [PATCH v3 1/4] t5541-http-push: add test for chunked Shawn Pearce
2011-05-03 17:18     ` Tay Ray Chuan
2011-05-04  4:07   ` Junio C Hamano
2011-05-04  4:09 ` [PATCH v3 0/4] http cleanups Junio C Hamano
2011-05-04  9:50   ` Tay Ray Chuan
2011-05-04 10:11 ` [PATCH v4 " Tay Ray Chuan
2011-05-04 10:11   ` Tay Ray Chuan [this message]
2011-05-04 10:11     ` [PATCH v4 2/4] http: make curl callbacks match contracts from curl header Tay Ray Chuan
2011-05-04 10:11       ` [PATCH v4 3/4] http-push: use const for strings in signatures Tay Ray Chuan
2011-05-04 10:11         ` [PATCH v4 4/4] http-push: refactor curl_easy_setup madness Tay Ray Chuan
2011-05-04 11:51     ` [PATCH v4 1/4] t5541-http-push: add test for chunked Jakub Narebski
2011-05-04 18:23       ` Junio C Hamano
     [not found]   ` <1304529590-1032-1-git-send-email-rctay89@gmail.com>
2011-05-04 18:23     ` [PATCH v5 " Junio C Hamano
2011-05-04 18:44     ` Junio C Hamano
2011-05-04 20:28       ` 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=1304503896-5988-2-git-send-email-rctay89@gmail.com \
    --to=rctay89@gmail.com \
    --cc=dpmcgee@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=spearce@spearce.org \
    /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 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 NNTP newsgroup(s).