From patchwork Mon Sep 17 21:46:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gummerer X-Patchwork-Id: 10603477 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 25A3215A6 for ; Mon, 17 Sep 2018 21:46:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A5E62A84D for ; Mon, 17 Sep 2018 21:46:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E3B72A862; Mon, 17 Sep 2018 21:46:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 958B22A84D for ; Mon, 17 Sep 2018 21:46:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728613AbeIRDQE (ORCPT ); Mon, 17 Sep 2018 23:16:04 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:44420 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727329AbeIRDQE (ORCPT ); Mon, 17 Sep 2018 23:16:04 -0400 Received: by mail-wr1-f68.google.com with SMTP id v16-v6so18815967wro.11 for ; Mon, 17 Sep 2018 14:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8DLJfPuQZwc0rk/SrTO3j6mJRIJBfe9/31YGxx6s1Yo=; b=qg+ViggpBMikVtyodeHgE3s1F//K05MTYRFPTxnuPa6JwmsGa9vtecHpIwGWN8Ckir henlFcBACCIb/c4CyzkbwJt0LtIcyDePogRkaDx42/14PiKyFv6jGXaTjFX1Tx3+qgGF chxR2EQb+yC7HgH+9VZw2+0aJcPk5uCy4/Rj4LrVy4raRwHTlXYF2FE8PieHo75v4pgZ aoRG6iI26fa+fqao5d4mKRmr0BIyMlMd3RtGzYJCEzCl6xe4TdU3UhtVbDuDxVD4SjQ0 fD2EIvW5PnQaQU54jZosDsSsbAinKBQlTxOzD2cH5E4HL4Nq8KvmfHY7qXJ9OQC0/qoV tvTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8DLJfPuQZwc0rk/SrTO3j6mJRIJBfe9/31YGxx6s1Yo=; b=b/k3Nyc1bMNRaS3yfx+rSvYxMV4KLtRtI5m1TqUXFQewn665rVDST7B2wfVVrmXYVb te04WUoJJg8qGdkuHLN+oacj8xJfu3RtAWMKzgSaIAPr0aDWY3dm9RtPwQbKzgEsGnl2 PE/KJknLWmY1I7y9KgCf2A10342nMTkMNi1WkjtpDjsAJd4vjglF7x4h8HQznR2kZdbt 2++XNm6+DOZ9DYLfZvGkYioVFotlxo5jqqQYOgebejSY6k9t3kEGBNFx0Ik4O6PsVFVR 9mjGBkGstXMKzPjKeW6b74LUyYEfvrkqrbPVNPvMn6jX8ATSaNaXKYMH22Tpgw/GcPN/ NI4w== X-Gm-Message-State: APzg51CEV9pnJjIyU3kbsgM13sEg1ewidTOOvmO6wvxudwnYCZSrfv8A Mln8YRKkbS9H6h0nnhM0NxiSLeQt X-Google-Smtp-Source: ANB0VdYLtP1Y8JOv//y/vURVg0ooQDnYZFsxhRHe0cCQz1S/h0UivYtPBscqRn3CnomCPuDsdjg47g== X-Received: by 2002:adf:e792:: with SMTP id n18-v6mr20255346wrm.136.1537220810465; Mon, 17 Sep 2018 14:46:50 -0700 (PDT) Received: from localhost ([2.28.194.193]) by smtp.gmail.com with ESMTPSA id d22-v6sm30097591wra.80.2018.09.17.14.46.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Sep 2018 14:46:49 -0700 (PDT) From: Thomas Gummerer To: git@vger.kernel.org Cc: Jonathan Nieder , Junio C Hamano , Todd Zullinger , =?utf-8?q?SZEDER_G=C3=A1bor?= , Jeff King , Thomas Gummerer Subject: [PATCH v2 1/2] t5551: move setup code inside test_expect blocks Date: Mon, 17 Sep 2018 22:46:27 +0100 Message-Id: <20180917214628.28325-2-t.gummerer@gmail.com> X-Mailer: git-send-email 2.19.0.444.g18242da7ef In-Reply-To: <20180917214628.28325-1-t.gummerer@gmail.com> References: <20180917191806.19958-1-t.gummerer@gmail.com> <20180917214628.28325-1-t.gummerer@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move setup code inside test_expect blocks, to catch unexpected failures in the setup steps, and bring the test scripts in line with our modern test style. Suggested-by: Jonathan Nieder Signed-off-by: Thomas Gummerer --- t/t5551-http-fetch-smart.sh | 66 ++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh index 771f36f9ff..71535631d3 100755 --- a/t/t5551-http-fetch-smart.sh +++ b/t/t5551-http-fetch-smart.sh @@ -23,26 +23,26 @@ test_expect_success 'create http-accessible bare repository' ' setup_askpass_helper -cat >exp < GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 -> Accept: */* -> Accept-Encoding: ENCODINGS -> Pragma: no-cache -< HTTP/1.1 200 OK -< Pragma: no-cache -< Cache-Control: no-cache, max-age=0, must-revalidate -< Content-Type: application/x-git-upload-pack-advertisement -> POST /smart/repo.git/git-upload-pack HTTP/1.1 -> Accept-Encoding: ENCODINGS -> Content-Type: application/x-git-upload-pack-request -> Accept: application/x-git-upload-pack-result -> Content-Length: xxx -< HTTP/1.1 200 OK -< Pragma: no-cache -< Cache-Control: no-cache, max-age=0, must-revalidate -< Content-Type: application/x-git-upload-pack-result -EOF test_expect_success 'clone http repository' ' + cat >exp <<-\EOF && + > GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 + > Accept: */* + > Accept-Encoding: ENCODINGS + > Pragma: no-cache + < HTTP/1.1 200 OK + < Pragma: no-cache + < Cache-Control: no-cache, max-age=0, must-revalidate + < Content-Type: application/x-git-upload-pack-advertisement + > POST /smart/repo.git/git-upload-pack HTTP/1.1 + > Accept-Encoding: ENCODINGS + > Content-Type: application/x-git-upload-pack-request + > Accept: application/x-git-upload-pack-result + > Content-Length: xxx + < HTTP/1.1 200 OK + < Pragma: no-cache + < Cache-Control: no-cache, max-age=0, must-revalidate + < Content-Type: application/x-git-upload-pack-result + EOF GIT_TRACE_CURL=true git clone --quiet $HTTPD_URL/smart/repo.git clone 2>err && test_cmp file clone/file && tr '\''\015'\'' Q exp <exp <<-\EOF && + GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200 + POST /smart/repo.git/git-upload-pack HTTP/1.1 200 + GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200 + POST /smart/repo.git/git-upload-pack HTTP/1.1 200 + EOF check_access_log exp ' @@ -203,15 +203,15 @@ test_expect_success 'dumb clone via http-backend respects namespace' ' test_cmp expect actual ' -cat >cookies.txt <expect_cookies.txt <cookies.txt <<-\EOF && + 127.0.0.1 FALSE /smart_cookies/ FALSE 0 othername othervalue + EOF + cat >expect_cookies.txt <<-\EOF && + + 127.0.0.1 FALSE /smart_cookies/ FALSE 0 othername othervalue + 127.0.0.1 FALSE /smart_cookies/repo.git/info/ FALSE 0 name value + EOF git config http.cookiefile cookies.txt && git config http.savecookies true && git ls-remote $HTTPD_URL/smart_cookies/repo.git master && From patchwork Mon Sep 17 21:46:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gummerer X-Patchwork-Id: 10603479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A3E9815A6 for ; Mon, 17 Sep 2018 21:46:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9991B2A84D for ; Mon, 17 Sep 2018 21:46:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DE952A862; Mon, 17 Sep 2018 21:46:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 367342A84D for ; Mon, 17 Sep 2018 21:46:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728617AbeIRDQG (ORCPT ); Mon, 17 Sep 2018 23:16:06 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:35907 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728590AbeIRDQF (ORCPT ); Mon, 17 Sep 2018 23:16:05 -0400 Received: by mail-wm1-f66.google.com with SMTP id j192-v6so285900wmj.1 for ; Mon, 17 Sep 2018 14:46:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cHTy7sYfgj1z0VGG0qPm6khdm4dSvN0GOye07kSaYL4=; b=tCWRCb6hXp6xz9Lo2e1kVegnNqhrjAZdTkQ68Br/ysuwJwzmswEnA4RdCQcGhA4Pgf p3X7GdEPMGtjQoEZJ5htA7FWCzKszU7ooaVsgvsoIBlaMHZUW6f+yQ3nnQInorENXPs9 /ADq0rVj5TxNAwVlKz0gdaCcDHf4jsG14X1pSIi81aDDw9jkVTZ6UBjZRpX9r5GifzOB YxYfh/VQOlbNiVrEW3Hu25DbjVYya1yA8Wt4O3hm5Uc3dV9dlKRRFagKPH68R6nCQ8R2 rbfGq2Zg2rVY/t8dhQUxPWQA1ZWefdHUzOz40EMKpfEtaTkTpgaoeCH97FnHCqVG4t1v pYDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cHTy7sYfgj1z0VGG0qPm6khdm4dSvN0GOye07kSaYL4=; b=nL/IW8utCMR2R2X3HaZ9SWRBroA/rGjx4o6n4SvlR4gNmkT2L7o7p16GoBtb2kD02z yB7+PjK64yiqt+K2s+d+ciKz5V/YWxmcujKvVJCW2/VN5XqXN7o4AOWOAi/UPBdHkjSe mcetGHROuUhSPMoADaOP3TE2diSMmFLYnxMdk4Xl/L6JoDE4eAde4+02jXO5snMv1ouM YaHpeDoDuQwPtAyFpjmj3ku191A1x/i50SgA0qaGNNkDKXZA5yYhvEpCzxJtR4sVG9c5 jhuHY61IQVrBb0CP/+7gsuDMHaKJxD5ggwqN6dSPcU98D24e2NpiGkWQyRx9v909iJ/r MJtg== X-Gm-Message-State: APzg51Di1Q6nYNB8umhFGmo9+bX3dRo5P1HXa0pIb3Vewur3CjgwquCQ x6beVi/R2dQGxoKw2iPJcavebLTu X-Google-Smtp-Source: ANB0VdanZ/5zt58mxnvZSkupYFmeak8ytZ08RdrVrTFQ3IpqE+m19eqCwpQ8kdUriBRn0/dNtKnZaA== X-Received: by 2002:a1c:dd05:: with SMTP id u5-v6mr13372413wmg.107.1537220812265; Mon, 17 Sep 2018 14:46:52 -0700 (PDT) Received: from localhost ([2.28.194.193]) by smtp.gmail.com with ESMTPSA id a203-v6sm172066wmh.31.2018.09.17.14.46.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Sep 2018 14:46:51 -0700 (PDT) From: Thomas Gummerer To: git@vger.kernel.org Cc: Jonathan Nieder , Junio C Hamano , Todd Zullinger , =?utf-8?q?SZEDER_G=C3=A1bor?= , Jeff King , Thomas Gummerer Subject: [PATCH v2 2/2] t5551: compare sorted cookies files Date: Mon, 17 Sep 2018 22:46:28 +0100 Message-Id: <20180917214628.28325-3-t.gummerer@gmail.com> X-Mailer: git-send-email 2.19.0.444.g18242da7ef In-Reply-To: <20180917214628.28325-1-t.gummerer@gmail.com> References: <20180917191806.19958-1-t.gummerer@gmail.com> <20180917214628.28325-1-t.gummerer@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In t5551 we check that we save cookies correctly to a file when http.cookiefile and http.savecookies are set. To do so we create an expect file that expects the cookies in a certain order. However after e2ef8d6fa ("cookies: support creation-time attribute for cookies", 2018-08-28) in curl.git (released in curl 7.61.1) that order changed. We document the file format as "Netscape/Mozilla cookie file format (see curl(1))", so any format produced by libcurl should be fine here. Sort the files, to be agnostic to the order of the cookies, and make the test pass with both curl versions > 7.61.1 and earlier curl versions. Reported-by: Todd Zullinger Helped-by: Jonathan Nieder Signed-off-by: Thomas Gummerer --- t/t5551-http-fetch-smart.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh index 71535631d3..3dc8f8ecec 100755 --- a/t/t5551-http-fetch-smart.sh +++ b/t/t5551-http-fetch-smart.sh @@ -207,7 +207,7 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set cat >cookies.txt <<-\EOF && 127.0.0.1 FALSE /smart_cookies/ FALSE 0 othername othervalue EOF - cat >expect_cookies.txt <<-\EOF && + sort >expect_cookies.txt <<-\EOF && 127.0.0.1 FALSE /smart_cookies/ FALSE 0 othername othervalue 127.0.0.1 FALSE /smart_cookies/repo.git/info/ FALSE 0 name value @@ -215,7 +215,7 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set git config http.cookiefile cookies.txt && git config http.savecookies true && git ls-remote $HTTPD_URL/smart_cookies/repo.git master && - tail -3 cookies.txt >cookies_tail.txt && + tail -3 cookies.txt | sort >cookies_tail.txt && test_cmp expect_cookies.txt cookies_tail.txt '