aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-09-14 22:56:12 +0200
committerLudovic Courtès <ludo@gnu.org>2014-09-14 23:49:02 +0200
commit4d54785c69602b0714b3f9021b9bf6a5d619d40c (patch)
treed0c20e7ae64af801857c9a1ec2a69f3f3e6eee7a /tests
parent973eea34781078091869143602d4f1dfdfd82e19 (diff)
downloadgnu-guix-4d54785c69602b0714b3f9021b9bf6a5d619d40c.tar
gnu-guix-4d54785c69602b0714b3f9021b9bf6a5d619d40c.tar.gz
syscalls: Add 'all-network-interfaces'.
* guix/build/syscalls.scm (network-interfaces): Update docstring. (%interface-line): New variable. (all-network-interfaces): New procedure. * tests/syscalls.scm ("all-network-interfaces"): New test. ("network-interfaces"): Change to make sure the result is a subset of (all-network-interfaces).
Diffstat (limited to 'tests')
-rw-r--r--tests/syscalls.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index c3550ac31a..b1dc298a14 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -18,6 +18,7 @@
(define-module (test-syscalls)
#:use-module (guix build syscalls)
+ #:use-module (srfi srfi-1)
#:use-module (srfi srfi-64)
#:use-module (ice-9 match))
@@ -43,10 +44,15 @@
;; Both return values have been encountered in the wild.
(memv (system-error-errno args) (list EPERM ENOENT)))))
+(test-assert "all-network-interfaces"
+ (match (all-network-interfaces)
+ (((? string? names) ..1)
+ (member "lo" names))))
+
(test-assert "network-interfaces"
(match (network-interfaces)
(((? string? names) ..1)
- (member "lo" names))))
+ (lset<= string=? names (all-network-interfaces)))))
(test-assert "network-interface-flags"
(let* ((sock (socket SOCK_STREAM AF_INET 0))