GNU bug report logs -
#42111
tests/syscalls.scm stumbles on network interface aliases
Previous Next
Reported by: Marius Bakke <marius <at> gnu.org>
Date: Sun, 28 Jun 2020 15:53:02 UTC
Severity: normal
Done: Marius Bakke <marius <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 42111 in the body.
You can then email your comments to 42111 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-guix <at> gnu.org
:
bug#42111
; Package
guix
.
(Sun, 28 Jun 2020 15:53:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Marius Bakke <marius <at> gnu.org>
:
New bug report received and forwarded. Copy sent to
bug-guix <at> gnu.org
.
(Sun, 28 Jun 2020 15:53:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello,
The "network-interface-names" test from tests/syscalls.scm fails if a
network interface alias is configured.
I.e. this command:
ip addr add 127.0.0.2/8 dev lo label lo:lcat
causes the interface to show up in (network-interface-names), but not
(all-network-interface-names), breaking the test.
I could not find a procfs file that displays network aliases, so ISTM
we either need to add syscalls to check IFLA_IFALIAS, or simply ignore
interfaces with a colon (which seems to be required).
This patch does the latter and makes the test succeed:
[diff (text/x-patch, inline)]
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index 6acaa0b131..7aa16ce3f4 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -382,7 +382,10 @@
(member "lo" names))))
(test-assert "network-interface-names"
- (match (network-interface-names)
+ (match (filter (lambda (if)
+ ;; Ignore interface aliases.
+ (not (string-contains if ":")))
+ (network-interface-names))
(((? string? names) ..1)
(lset<= string=? names (all-network-interface-names)))))
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
bug-guix <at> gnu.org
:
bug#42111
; Package
guix
.
(Sun, 28 Jun 2020 21:03:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 42111 <at> debbugs.gnu.org (full text, mbox):
Hi!
Marius Bakke <marius <at> gnu.org> skribis:
> The "network-interface-names" test from tests/syscalls.scm fails if a
> network interface alias is configured.
>
> I.e. this command:
>
> ip addr add 127.0.0.2/8 dev lo label lo:lcat
Woow. 🐈
> diff --git a/tests/syscalls.scm b/tests/syscalls.scm
> index 6acaa0b131..7aa16ce3f4 100644
> --- a/tests/syscalls.scm
> +++ b/tests/syscalls.scm
> @@ -382,7 +382,10 @@
> (member "lo" names))))
>
> (test-assert "network-interface-names"
> - (match (network-interface-names)
> + (match (filter (lambda (if)
> + ;; Ignore interface aliases.
Perhaps add “since they don’t show up in (all-network-interface-names)”.
> + (not (string-contains if ":")))
> + (network-interface-names))
You can use ‘remove’ instead of ‘filter’ + ‘not’.
Otherwise LGTM, thanks!
Ludo’.
Reply sent
to
Marius Bakke <marius <at> gnu.org>
:
You have taken responsibility.
(Sun, 28 Jun 2020 21:38:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Marius Bakke <marius <at> gnu.org>
:
bug acknowledged by developer.
(Sun, 28 Jun 2020 21:38:01 GMT)
Full text and
rfc822 format available.
Message #13 received at 42111-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:
>> diff --git a/tests/syscalls.scm b/tests/syscalls.scm
>> index 6acaa0b131..7aa16ce3f4 100644
>> --- a/tests/syscalls.scm
>> +++ b/tests/syscalls.scm
>> @@ -382,7 +382,10 @@
>> (member "lo" names))))
>>
>> (test-assert "network-interface-names"
>> - (match (network-interface-names)
>> + (match (filter (lambda (if)
>> + ;; Ignore interface aliases.
>
> Perhaps add “since they don’t show up in (all-network-interface-names)”.
>
>> + (not (string-contains if ":")))
>> + (network-interface-names))
>
> You can use ‘remove’ instead of ‘filter’ + ‘not’.
ah, much clearer with those suggestions, thanks!
Pushed in 5e113cf4424b2746cbf3633cd2106c62b89e5b49.
[signature.asc (application/pgp-signature, inline)]
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 27 Jul 2020 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 3 years and 265 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.