From patchwork Mon Mar 23 13:09:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Arver via GitGitGadget X-Patchwork-Id: 11452927 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 A96311731 for ; Mon, 23 Mar 2020 13:10:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 861DC2072E for ; Mon, 23 Mar 2020 13:10:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sOBHbLwU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728474AbgCWNJ4 (ORCPT ); Mon, 23 Mar 2020 09:09:56 -0400 Received: from mail-ed1-f47.google.com ([209.85.208.47]:43866 "EHLO mail-ed1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728454AbgCWNJz (ORCPT ); Mon, 23 Mar 2020 09:09:55 -0400 Received: by mail-ed1-f47.google.com with SMTP id bd14so2231117edb.10 for ; Mon, 23 Mar 2020 06:09:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=d+CdihV/MaXlOsmdA1HIYg2dPk7X4+olTFP2vNVSVCU=; b=sOBHbLwUc5Nufz9+xSurAFofCBJDGhrivljevKDLIKXpCfUbqY3NU3oo1pEQwx7Bkq JeWSbQNyiV8XI6Zkrk2URqOE2xBdYSbi6fbo9GnI7uBmQeKGPxl1zjTLXuhJmbissSAh /auvoQSkBSc/WgE6iQwU+xSpN+PCUuVhr7X0Q9tE+ydl9uKtRF9baAcWktfTVC8ays3C CP/ZoqNnwFtjElMrYoWfWO9SHORb+yjK2Z2QepYl51iI8nO1B6s44q07AoAE3e7R0jwV wF1w8spCrh16vcSuTinkyojEagPKRZDB1A+XBaXiw0+19OxFl9nCpcDGZmtmEuDCyPyt ogrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=d+CdihV/MaXlOsmdA1HIYg2dPk7X4+olTFP2vNVSVCU=; b=Pw+pLEpzKGaPaVYHX1NB5ZB6wd0b5ZXZoYKPzAcUWgsmJK/FrZ6wVC1E87Mn1ky9Dw P0vUYlwdDG6FHV4g9emEmW8WSaI9jo1+Kqbv9u4n9BoVrrNxQOMMdBk2qO1VMXYPcnkl SQQ794Uba8sfw6/P7EBJffmFeedeiXy+x6rIbW2SPyZ0ETEiOk7MibjaBwtQ7WI4zBBf d19t2juVJDgTtGG+/dcNZwa4PvYLXCdwKWTlxVMsPeA6oKd+c4RhX+K1t61x+s4L9gvG QNSclebVqpslIA7iygM6W47GwnUojhbrFPrHTmng0O/i0e5P+l/4D81UbIfYai0T2Zw1 vKfA== X-Gm-Message-State: ANhLgQ1MtmVp1dqZMHhFGFDDwa7u+rExqPCfxMrcWUDJUI5oBz9HRpCA ZrxYiS9fbmuWtGoGHcp8MDyn2rkn X-Google-Smtp-Source: ADFU+vvt+KHNpGKAYwY2nV19cAgl/J7ROyzRY2D+YXfLZ+u+iZypP63LdoFo/1jzmuL+8A3bxAojQQ== X-Received: by 2002:a17:906:259:: with SMTP id 25mr1319841ejl.105.1584968992548; Mon, 23 Mar 2020 06:09:52 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id rl28sm881983ejb.28.2020.03.23.06.09.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2020 06:09:52 -0700 (PDT) Message-Id: <287a21f1033b2a74420029c529ad4db956051a85.1584968990.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Mon, 23 Mar 2020 13:09:49 +0000 Subject: [PATCH 1/2] tests(gpg): allow the gpg-agent to start on Windows Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Johannes Schindelin , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin In Git for Windows' SDK, we use the MSYS2 version of OpenSSH, meaning that the `gpg-agent` will fail horribly when being passed a `--homedir` that contains colons. Previously, we did pass the Windows version of the absolute path, though, which starts in the drive letter followed by, you guessed it, a colon. Let's use the same trick found elsewhere in our test suite where `$PWD` is used to refer to the pseudo-Unix path (which works only within the MSYS2 Bash/OpenSSH/Perl/etc, as opposed to `$(pwd)` which refers to the Windows path that `git.exe` understands, too). Signed-off-by: Johannes Schindelin --- t/lib-gpg.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh index 8d28652b729..11b83b8c24a 100755 --- a/t/lib-gpg.sh +++ b/t/lib-gpg.sh @@ -29,7 +29,7 @@ then # > lib-gpg/ownertrust mkdir ./gpghome && chmod 0700 ./gpghome && - GNUPGHOME="$(pwd)/gpghome" && + GNUPGHOME="$PWD/gpghome" && export GNUPGHOME && (gpgconf --kill gpg-agent >/dev/null 2>&1 || : ) && gpg --homedir "${GNUPGHOME}" 2>/dev/null --import \ From patchwork Mon Mar 23 13:09:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Arver via GitGitGadget X-Patchwork-Id: 11452923 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 585436CA for ; Mon, 23 Mar 2020 13:09:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 31D0120735 for ; Mon, 23 Mar 2020 13:09:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bAdPeDWi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728479AbgCWNJ4 (ORCPT ); Mon, 23 Mar 2020 09:09:56 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:37643 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728443AbgCWNJz (ORCPT ); Mon, 23 Mar 2020 09:09:55 -0400 Received: by mail-ed1-f67.google.com with SMTP id b23so16127021edx.4 for ; Mon, 23 Mar 2020 06:09:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=bH40N9bh2GlGKo+JoKJ53SDoMaOqCQezpdTv8F+37dM=; b=bAdPeDWiHGZXxA8c0b8+Ae7v8YVsTZmvxMGEKIuEbOopbUTfE2idXCMdpwNzVtKFCK wgBaUAT/vgfpPYYbrf5mSgS8luqCuBu8fZVtTk/Jm3ZQaDoKItCwKzGSPIA9iIlN3S0A /sc56BwxZhkVPUZGWs8D9X3/DLY9UlOgd7HPB0FXbl3ei6npdlL4gLJdIMTEY93feOCf Ej8F4eeCabyvxYOMeoLZZKPx74cdOZW9/EyMRTRotCpeUWUzMRlsmdi4qAUfwPPW+Eaf ohWJL0Qfl+rkpfWP+HxXUVEe+T7Frd4QHOmN0PfK5sOngOLseLmn6xfqGr7bmvp9DopL v/2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=bH40N9bh2GlGKo+JoKJ53SDoMaOqCQezpdTv8F+37dM=; b=p74DisyYcXfBGBoL8CIfeDzKg1mQkUt1S95mVtg3GRypKfNlLhjIxZxpPVolMXZ+31 liUP0S4iEywwSP1d+s3umWmQTVZdmv8yQ3QBa5jCq6gG3BmfmptrB8f0pL3Fwhc7YC2K KpfNwP4BVLbhTPf4Bo5fqi5hU80eMiUikGkeYSWb6vkKl6llNuCoSXHiUG/liir0oJNn qEHsLiav1ImSrLq1P8z6OSjmDK8RzRBqhxWTGcWR8AVmrkHuGwDYA4j3eVyzvS2mQ/DS Zmk3J1goOqVYvCuDwa+tYGnbXAeF0yhfn7rBDMhy4bvoPwjb5Xm/7spHOJu6Je2nLgYX ZvbQ== X-Gm-Message-State: ANhLgQ29AKgCoO+RuSIWOeoKKV5xDlRxVpamwRQk0HRBU5LpZ0T6xBtL TDOdDZUl9IgR7k12dn0RbjG1PA/2 X-Google-Smtp-Source: ADFU+vus+JTA7H7FQH8kcWDASBiHRs7guvAdYafL/EApm6XyiuE4mvDwBApAcr36Z8jlcLhNFYGuBw== X-Received: by 2002:a17:906:ad92:: with SMTP id la18mr20090242ejb.326.1584968993286; Mon, 23 Mar 2020 06:09:53 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id 91sm1018917edq.78.2020.03.23.06.09.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2020 06:09:52 -0700 (PDT) Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Mon, 23 Mar 2020 13:09:50 +0000 Subject: [PATCH 2/2] tests(gpg): increase verbosity to allow debugging Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Johannes Schindelin , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin Especially when debugging a test failure that can only be reproduced in the CI build (e.g. when the developer has no access to a macOS machine other than running the tests on a macOS build agent), output should not be suppressed. In the instance of `hi/gpg-prefer-check-signature`, where one GPG-related test failed for no apparent reason, the entire output of `gpg` and `gpgsm` was suppressed, even in verbose mode, leaving interested readers no clue what was going wrong. Let's fix this by redirecting the output not to `/dev/null`, but to the file descriptors that may, or may not, be redirected via `--verbose-log`. For good measure, also turn on tracing if the user asked for it, and prefix it with a helpful info message. Signed-off-by: Johannes Schindelin Signed-off-by: Jeff King --- t/lib-gpg.sh | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh index 11b83b8c24a..a7d0708f5df 100755 --- a/t/lib-gpg.sh +++ b/t/lib-gpg.sh @@ -11,6 +11,8 @@ then say "Your version of gpg (1.0.6) is too buggy for testing" ;; *) + say_color info >&4 "Trying to set up GPG" + want_trace && set -x # Available key info: # * Type DSA and Elgamal, size 2048 bits, no expiration date, # name and email: C O Mitter @@ -31,13 +33,13 @@ then chmod 0700 ./gpghome && GNUPGHOME="$PWD/gpghome" && export GNUPGHOME && - (gpgconf --kill gpg-agent >/dev/null 2>&1 || : ) && - gpg --homedir "${GNUPGHOME}" 2>/dev/null --import \ - "$TEST_DIRECTORY"/lib-gpg/keyring.gpg && - gpg --homedir "${GNUPGHOME}" 2>/dev/null --import-ownertrust \ - "$TEST_DIRECTORY"/lib-gpg/ownertrust && - gpg --homedir "${GNUPGHOME}" /dev/null 2>&1 \ - --sign -u committer@example.com && + (gpgconf --kill gpg-agent >&3 2>&4 || : ) && + gpg --homedir "${GNUPGHOME}" --import \ + "$TEST_DIRECTORY"/lib-gpg/keyring.gpg >&3 2>&4 && + gpg --homedir "${GNUPGHOME}" --import-ownertrust \ + "$TEST_DIRECTORY"/lib-gpg/ownertrust >&3 2>&4 && + gpg --homedir "${GNUPGHOME}" &3 2>&4 && test_set_prereq GPG && # Available key info: # * see t/lib-gpg/gpgsm-gen-key.in @@ -54,28 +56,29 @@ then # gpgsm --homedir /tmp/gpghome/ \ # -o t/lib-gpg/gpgsm_cert.p12 \ # --export-secret-key-p12 "committer@example.com" - echo | gpgsm --homedir "${GNUPGHOME}" 2>/dev/null \ + echo | gpgsm --homedir "${GNUPGHOME}" >&3 2>&4 \ --passphrase-fd 0 --pinentry-mode loopback \ --import "$TEST_DIRECTORY"/lib-gpg/gpgsm_cert.p12 && - gpgsm --homedir "${GNUPGHOME}" 2>/dev/null -K | + gpgsm --homedir "${GNUPGHOME}" -K 2>&4 | grep fingerprint: | cut -d" " -f4 | tr -d '\n' >"${GNUPGHOME}/trustlist.txt" && echo " S relax" >>"${GNUPGHOME}/trustlist.txt" && - echo hello | gpgsm --homedir "${GNUPGHOME}" >/dev/null \ - -u committer@example.com -o /dev/null --sign - 2>&1 && + echo hello | gpgsm --homedir "${GNUPGHOME}" >&3 2>&4 \ + -u committer@example.com -o /dev/null --sign - && test_set_prereq GPGSM ;; esac fi if test_have_prereq GPG && - echo | gpg --homedir "${GNUPGHOME}" -b --rfc1991 >/dev/null 2>&1 + echo | gpg --homedir "${GNUPGHOME}" -b --rfc1991 >&3 2>&4 then test_set_prereq RFC1991 fi +want_trace && set +x sanitize_pgp() { perl -ne '