GNU bug report logs - #44491
Support GUIX_DISABLE_NETWORK_TESTS environment variable

Previous Next

Package: guix;

Reported by: Vagrant Cascadian <vagrant <at> debian.org>

Date: Fri, 6 Nov 2020 21:31:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Vagrant Cascadian <vagrant <at> debian.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 44491 <at> debbugs.gnu.org
Subject: bug#44491: Support GUIX_DISABLE_NETWORK_TESTS environment variable
Date: Tue, 10 Nov 2020 22:06:38 -0800
[Message part 1 (text/plain, inline)]
On 2020-11-10, Vagrant Cascadian wrote:
> On 2020-11-10, Ludovic Courtès wrote:
>> Vagrant Cascadian <vagrant <at> debian.org> skribis:
>>> On 2020-11-08, Ludovic Courtès wrote:
>>>> Vagrant Cascadian <vagrant <at> debian.org> 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’s see.
>>>
>>> It seems like a simpler workaround is to pass RES_OPTIONS=attempts: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’s still a good idea.  Would you like to adjust your patch
>> 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=attempts: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
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 4 years and 246 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.