From: Marius Bakke <marius@gnu.org>
To: 42111@debbugs.gnu.org
Subject: bug#42111: tests/syscalls.scm stumbles on network interface aliases
Date: Sun, 28 Jun 2020 17:52:20 +0200 [thread overview]
Message-ID: <87y2o7b32j.fsf@gnu.org> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 559 bytes --]
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:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: diff --]
[-- Type: text/x-patch, Size: 555 bytes --]
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)))))
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
next reply other threads:[~2020-06-28 15:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-28 15:52 Marius Bakke [this message]
2020-06-28 21:02 ` bug#42111: tests/syscalls.scm stumbles on network interface aliases Ludovic Courtès
2020-06-28 21:37 ` Marius Bakke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y2o7b32j.fsf@gnu.org \
--to=marius@gnu.org \
--cc=42111@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).