From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id SGlAO5h/q1+zfAAA0tVLHw (envelope-from ) for ; Wed, 11 Nov 2020 06:07:20 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id gG8QN5h/q19GBAAAbx9fmQ (envelope-from ) for ; Wed, 11 Nov 2020 06:07:20 +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 83F9B940363 for ; Wed, 11 Nov 2020 06:07:20 +0000 (UTC) Received: from localhost ([::1]:40084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcjHq-0002oF-3w for larch@yhetil.org; Wed, 11 Nov 2020 01:07:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcjHa-0002o6-43 for bug-guix@gnu.org; Wed, 11 Nov 2020 01:07:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56761) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kcjHZ-0006Ux-QW for bug-guix@gnu.org; Wed, 11 Nov 2020 01:07:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kcjHZ-0006vo-MY for bug-guix@gnu.org; Wed, 11 Nov 2020 01:07:01 -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: Wed, 11 Nov 2020 06:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44491 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 44491-submit@debbugs.gnu.org id=B44491.160507481226605 (code B ref 44491); Wed, 11 Nov 2020 06:07:01 +0000 Received: (at 44491) by debbugs.gnu.org; 11 Nov 2020 06:06:52 +0000 Received: from localhost ([127.0.0.1]:40074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcjHQ-0006v3-17 for submit@debbugs.gnu.org; Wed, 11 Nov 2020 01:06:52 -0500 Received: from cascadia.aikidev.net ([173.255.214.101]:40944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcjHO-0006ur-R7 for 44491@debbugs.gnu.org; Wed, 11 Nov 2020 01:06: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 AD6301AA41; Tue, 10 Nov 2020 22:06:44 -0800 (PST) From: Vagrant Cascadian In-Reply-To: <87h7pwtvde.fsf@yucca> References: <87k0uy6um8.fsf@yucca> <87y2jbu4gx.fsf@gnu.org> <87k0utt6zt.fsf@yucca> <87wnysnbs6.fsf@gnu.org> <87h7pwtvde.fsf@yucca> Date: Tue, 10 Nov 2020 22:06:38 -0800 Message-ID: <87eel0tok1.fsf@yucca> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) 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: , Cc: 44491@debbugs.gnu.org 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: -1.11 X-TUID: s+/0RJOPxFuA --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2020-11-10, Vagrant Cascadian wrote: > On 2020-11-10, Ludovic Court=C3=A8s wrote: >> Vagrant Cascadian skribis: >>> On 2020-11-08, Ludovic Court=C3=A8s wrote: >>>> Vagrant Cascadian skribis: >>>> >>>>> If this could be considered for the upcoming 1.2 release, that would = be >>>>> appreciated, though I can also carry the patches in Debian... >>>> >>>> Yay! It should be doable, let=E2=80=99s see. >>> >>> It seems like a simpler workaround is to pass RES_OPTIONS=3Dattempts:0, >>> which should disable name resolution, and thus the network checks will >>> fail. >>> >>> With the RES_OPTIONS workaround, the changes to guix/tests.scm >>> network-reachable are no longer needed ... i think. :) >> >> Oooh nice, the wonders of glibc! >> >>> Might still be worth refactoring some of *.sh tests to use common >>> functions, since the code is basically copied and pasted in several >>> different places. >> >> Yes, that=E2=80=99s still a good idea. Would you like to adjust your pa= tch >> accordingly? > > Thanks for the review! > > Updated patch attached, with changes: > > * Copyright header added to common.sh. > * New function skip_if_network_unreachable in common.sh > * Dropped GUIX_DISABLE_NETWORK_TESTS in favor of using > RES_OPTIONS=3Dattempts:0. > * Updated tests to use skip_if_network_unreachable or network_reachable. ... > diff --git a/tests/common.sh b/tests/common.sh > new file mode 100644 > index 0000000000..f9dd3c2c59 > --- /dev/null > +++ b/tests/common.sh ... > +network_reachable() { > + if ! guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /= dev/null; then > + return 0 > + fi > +} Ooops. I inverted that check... probably "if guile -c ..." and probably should return 1 or something if it isn't... or maybe 77? anyways... testing again. live well, vagrant --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCX6t/bgAKCRDcUY/If5cW qsDDAQC9MpLOI2Du+kqODXDNDMIOK6TXnr6b60ZHW1pfYf01dgD+Kn79V3s1Eneh 9G9UkbXkrqSv6pz/hZR/JDoY27CGQw4= =fcUP -----END PGP SIGNATURE----- --=-=-=--