From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2OsWG87ApV9GXAAA0tVLHw (envelope-from ) for ; Fri, 06 Nov 2020 21:31:58 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 0EnoFs7ApV+CCwAAB5/wlQ (envelope-from ) for ; Fri, 06 Nov 2020 21:31:58 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A1799940111 for ; Fri, 6 Nov 2020 21:31:57 +0000 (UTC) Received: from localhost ([::1]:43662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kb9Ku-0003KQ-9S for larch@yhetil.org; Fri, 06 Nov 2020 16:31:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kb9K3-0002oA-D9 for bug-guix@gnu.org; Fri, 06 Nov 2020 16:31:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45932) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kb9K2-0002h6-8Q for bug-guix@gnu.org; Fri, 06 Nov 2020 16:31:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kb9K2-0001JR-4M for bug-guix@gnu.org; Fri, 06 Nov 2020 16:31:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#44491: Support GUIX_DISABLE_NETWORK_TESTS environment variable Resent-From: Vagrant Cascadian Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 06 Nov 2020 21:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44491 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 44491@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16046982605035 (code B ref -1); Fri, 06 Nov 2020 21:31:01 +0000 Received: (at submit) by debbugs.gnu.org; 6 Nov 2020 21:31:00 +0000 Received: from localhost ([127.0.0.1]:57478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kb9Jt-0001J3-TD for submit@debbugs.gnu.org; Fri, 06 Nov 2020 16:31:00 -0500 Received: from lists.gnu.org ([209.51.188.17]:59380) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kb9Jr-0001Iv-Tb for submit@debbugs.gnu.org; Fri, 06 Nov 2020 16:30:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34486) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kb9Jr-0002iz-N9 for bug-guix@gnu.org; Fri, 06 Nov 2020 16:30:51 -0500 Received: from cascadia.aikidev.net ([173.255.214.101]:58090) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kb9Jp-0002gE-KF for bug-guix@gnu.org; Fri, 06 Nov 2020 16:30:51 -0500 Received: from localhost (unknown [IPv6:2600:3c01:e000:21:21:21:0:100b]) (Authenticated sender: vagrant@cascadia.debian.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id 502F61AA41 for ; Fri, 6 Nov 2020 13:30:44 -0800 (PST) From: Vagrant Cascadian Date: Fri, 06 Nov 2020 13:30:39 -0800 Message-ID: <87k0uy6um8.fsf@yucca> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: none client-ip=173.255.214.101; envelope-from=vagrant@debian.org; helo=cascadia.aikidev.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/06 16:30:46 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -2.61 X-TUID: nRWueiZv4Pcj --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain The following patch adds a GUIX_DISABLE_NETWORK_TESTS environment variable and disables tests that require network access when it is set. This is needed for packaging GNU Guix in Debian, where packaging policies prohibit network access during builds, but may not technically block network access during builds. If this could be considered for the upcoming 1.2 release, that would be appreciated, though I can also carry the patches in Debian... live well, vagrant --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-tests-Support-disabling-network-tests.patch Content-Transfer-Encoding: quoted-printable From=2036516e767f68dbc2bd3dc186f956c0b0fd7de9f1 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Thu, 5 Nov 2020 17:35:52 -0800 Subject: [PATCH] tests: Support disabling network tests. This is needed for packaging GNU Guix in Debian, where packaging policies prohibit network access during builds, but may not technically block network access during builds. * guix/tests.scm (network-reachable): Return #f when GUIX_DISABLE_NETWORK_TESTS is set. * tests/common.sh: New file. * tests/guix-build-branch.sh, tests/guix-environment.sh, tests/guix-pack.sh, tests/guix-package-net.sh: Use network_reachable function from common.sh. =2D-- guix/tests.scm | 7 +++++-- tests/common.sh | 8 ++++++++ tests/guix-build-branch.sh | 8 ++------ tests/guix-environment.sh | 5 ++--- tests/guix-pack.sh | 5 ++--- tests/guix-package-net.sh | 9 ++------- 6 files changed, 21 insertions(+), 21 deletions(-) create mode 100644 tests/common.sh diff --git a/guix/tests.scm b/guix/tests.scm index fc3d521163..9f98cef33f 100644 =2D-- a/guix/tests.scm +++ b/guix/tests.scm @@ -204,8 +204,11 @@ too expensive to build entirely in the test store." (zero? (logand #o222 (stat:mode st))))))) =20 (define (network-reachable?) =2D "Return true if we can reach the Internet." =2D (false-if-exception (getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV))) + "Return true if we can reach the Internet and GUIX_DISABLE_NETWORK_TESTS +is not set." + (if (getenv "GUIX_DISABLE_NETWORK_TESTS") + #f + (false-if-exception (getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV))= )) =20 (define-syntax-rule (mock (module proc replacement) body ...) "Within BODY, replace the definition of PROC from MODULE with the defini= tion diff --git a/tests/common.sh b/tests/common.sh new file mode 100644 index 0000000000..b91c0bdcd4 =2D-- /dev/null +++ b/tests/common.sh @@ -0,0 +1,8 @@ +network_reachable() { + if [ -n "$GUIX_DISABLE_NETWORK_TESTS" ]; then + exit 77 + fi + if ! guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /de= v/null; then + exit 77 + fi +} diff --git a/tests/guix-build-branch.sh b/tests/guix-build-branch.sh index 79aa06a58f..55f8f388ab 100644 =2D-- a/tests/guix-build-branch.sh +++ b/tests/guix-build-branch.sh @@ -24,12 +24,8 @@ guix build --version =20 # 'guix build --with-branch' requires access to the network to clone the # Git repository below. =2D =2Dif ! guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/= null =2Dthen =2D # Skipping. =2D exit 77 =2Dfi +. $(dirname $0)/common.sh +network_reachable =20 orig_drv=3D"`guix build guile-gcrypt -d`" latest_drv=3D"`guix build guile-gcrypt --with-branch=3Dguile-gcrypt=3Dmast= er -d`" diff --git a/tests/guix-environment.sh b/tests/guix-environment.sh index f8be48f0c0..d140566aef 100644 =2D-- a/tests/guix-environment.sh +++ b/tests/guix-environment.sh @@ -174,9 +174,9 @@ case "$transformed_drv" in *) false;; esac =20 +. $(dirname $0)/common.sh +network_reachable =20 =2Dif guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/nu= ll =2Dthen # Compute the build environment for the initial GNU Make. guix environment --bootstrap --no-substitutes --search-paths --pure \ -e '(@ (guix tests) gnu-make-for-tests)' > "$tmpdir/a" @@ -244,4 +244,3 @@ then do guix gc --references "$profile" | grep "$dep" done =2Dfi diff --git a/tests/guix-pack.sh b/tests/guix-pack.sh index 0339221ac2..bc902c7e90 100644 =2D-- a/tests/guix-pack.sh +++ b/tests/guix-pack.sh @@ -23,9 +23,8 @@ =20 # A network connection is required to build %bootstrap-coreutils&co, # which is required to run these tests with the --bootstrap option. =2Dif ! guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/= null; then =2D exit 77 =2Dfi +. $(dirname $0)/common.sh +network_reachable =20 guix pack --version =20 diff --git a/tests/guix-package-net.sh b/tests/guix-package-net.sh index 6d21c6cff6..ec7952f63d 100644 =2D-- a/tests/guix-package-net.sh +++ b/tests/guix-package-net.sh @@ -38,13 +38,8 @@ shebang_too_long () -ge 128 } =20 =2Dif ! guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/= null \ =2D || shebang_too_long =2Dthen =2D # Skipping. =2D exit 77 =2Dfi =2D +. $(dirname $0)/common.sh +network_reachable =20 profile=3D"t-profile-$$" profile_alt=3D"t-profile-alt-$$" =2D-=20 2.20.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCX6XAfwAKCRDcUY/If5cW qqS3AP9xHOh0mV9gisiPEKxYc5qbg2qRZnOq7F3sNFD5WqYe2QEA/RQPsPQGm7cH a9ldBpc0KYxfLfybPxyBtWIy2x34ng4= =KzMF -----END PGP SIGNATURE----- --==-=-=--