diff options
author | Ludovic Courtès <ludo@gnu.org> | 2014-09-14 22:56:12 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2014-09-14 23:49:02 +0200 |
commit | 4d54785c69602b0714b3f9021b9bf6a5d619d40c (patch) | |
tree | d0c20e7ae64af801857c9a1ec2a69f3f3e6eee7a /tests/syscalls.scm | |
parent | 973eea34781078091869143602d4f1dfdfd82e19 (diff) | |
download | patches-4d54785c69602b0714b3f9021b9bf6a5d619d40c.tar patches-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/syscalls.scm')
-rw-r--r-- | tests/syscalls.scm | 8 |
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)) |