(address . bug-guix@gnu.org)
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:
Toggle diff (15 lines)
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)))))
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl74vLQACgkQoqBt8qM6
VPqy0AgA1ayZ5xwX81s2CnxRJltT0DCBZNNr8Ob8BcecJu3jlcHFJTA2gqMPaDeu
nKF7l7s3pdNecb9Dc4BbOWKdH1xrRTCg1rsFPg1hO2SsqinBo/r+7VFvsBBj8XIu
zT48pxRnmpOn0JM53QfVYJCHFUAAjViT7uX2LMPoE/8PMhaBWiWu8jVDjoQaBfBW
BuCXpNVsrGxEjxuvNMOfo8DixU4fCNU1v1kkPqRikcNhBY1JiecJNewh+fJjAaEv
lTUlf2jSYJBZbY36PtC6VZTCRdjHZvSWAuXaJaL7A/oVdQrittvUObTBSNxhQlZ1
EijuYebEjcEmYg5oM+M/qlo/eCXJrw==
=5nLf
-----END PGP SIGNATURE-----