From patchwork Tue Sep 15 09:58:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han Xin X-Patchwork-Id: 11775949 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9A2B5618 for ; Tue, 15 Sep 2020 09:58:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7040D21D1B for ; Tue, 15 Sep 2020 09:58:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c35QBtw7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726244AbgIOJ6f (ORCPT ); Tue, 15 Sep 2020 05:58:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726169AbgIOJ6e (ORCPT ); Tue, 15 Sep 2020 05:58:34 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E616C06174A for ; Tue, 15 Sep 2020 02:58:34 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id r19so1074478pls.1 for ; Tue, 15 Sep 2020 02:58:34 -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:mime-version :content-transfer-encoding; bh=7IoT8GOmscal161OYichbAoqU3UPkvQAY6LdkJudSZ8=; b=c35QBtw7KJ0ztnc4GJvGJIxTS8JnIUFtWvobcMGWuRABvbWuJ9Qt1Y5PxFAabDl9MZ 70ia/Rp7GoEcglpC7yCOKLx1Cf840565HRs36rRa4edyFMwf05ySBIDHMttaGcj++0BF g7GW2nMNGVo4u8zswYVeiGclIIyRqd4SEFuZSl4yag3y4PgK7Are9tZ5HZ6Dd+nE+Fv9 Jqy4ICOYl0eVLmPewXkMfyQbC2RpNntv6nVpDzE3W/Sx3iA8MFAs2KTlRDh2cMCTXGjk GD/x2mGEZczFeqZniJ0wZyUP1r+NBjwhv4g6Y5fUfbldU9+wB2d+Zg5V+30Rp0LgeeV+ uyKA== 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:mime-version :content-transfer-encoding; bh=7IoT8GOmscal161OYichbAoqU3UPkvQAY6LdkJudSZ8=; b=C5W5uWz8Uf0ufuK3reGsN5Nm6NL9+ygnKgq1mg/71pYAO5BeT0Q5Q+pr4V0npH3uqR I3xe4FRKEkFgZIIuQf4a0MgMs05SQ8U2H5VtoxAPfD3UZkeJq+KM16pPRUTGOwt74ZXg j+HdnuoG2Mbuiz3+wLSD6ulLFYsf0eqFUr3gFYmSOmMooCEgdJSix1wvUIyQlcZQl0HL eaTZmPrmkjFYx2eNXBt8ZuZfB3jVIbh5P6iFN1OFTqwmMFaH50u7KAs/EFWZkP5WQlmx NtReOlNmrNfENiUbU/8jHvsp6/jaZiruy/WrMEQ0eS+wiDHi67ZuYqZywf+MMYPhRzRW +I2A== X-Gm-Message-State: AOAM5306J/vijbto8s/VlA75loBDSdFa0lMiPQIJvjbOfNXEYbdxzrAt dCs871GmGunq714TfHvci1M= X-Google-Smtp-Source: ABdhPJxJORJ5hrB3G4iJiyxgq/uAFru4+4nfcVJhtpqIlZoL7IldNMPIibuf94Xrr39eFOdzrtHJ1g== X-Received: by 2002:a17:90a:d702:: with SMTP id y2mr3469043pju.216.1600163913736; Tue, 15 Sep 2020 02:58:33 -0700 (PDT) Received: from localhost.localdomain ([205.204.117.14]) by smtp.gmail.com with ESMTPSA id i62sm12839400pfe.140.2020.09.15.02.58.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2020 02:58:33 -0700 (PDT) From: Han Xin X-Google-Original-From: Han Xin To: Junio C Hamano , Git List Cc: Han Xin , Jiang Xin Subject: [PATCH 1/2] t5534: new test case for atomic signed push Date: Tue, 15 Sep 2020 17:58:26 +0800 Message-Id: <20200915095827.52047-1-hanxin.hx@alibaba-inc.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In order to test signed atomic push, add a new test case. Reviewed-by: Jiang Xin Signed-off-by: Han Xin --- t/t5534-push-signed.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/t/t5534-push-signed.sh b/t/t5534-push-signed.sh index 030331f1c5..d0fcdc900e 100755 --- a/t/t5534-push-signed.sh +++ b/t/t5534-push-signed.sh @@ -273,4 +273,21 @@ test_expect_success GPGSM 'fail without key and heed user.signingkey x509' ' test_cmp expect dst/push-cert-status ' +test_expect_failure GPG 'check atomic push before running GPG' ' + prepare_dst && + git -C dst config receive.certnonceseed sekrit && + write_script gpg <<-EOF && + echo >&2 "Fake gpg is called." + exit 1 + EOF + test_must_fail env PATH="$TRASH_DIRECTORY:$PATH" git push --signed --atomic \ + dst noop ff noff >out 2>&1 && + grep "^error:" out >actual && + cat >expect <<-EOF && + error: atomic push failed for ref refs/heads/noff. status: 2 + error: failed to push some refs to '"'"'dst'"'"' + EOF + test_i18ncmp expect actual +' + test_done