summaryrefslogtreecommitdiff
path: root/tests/syscalls.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-09-14 21:39:51 +0200
committerLudovic Courtès <ludo@gnu.org>2014-09-14 23:49:02 +0200
commit7585016f53e2e8be1f82ed303ae084464422c2a8 (patch)
treec318e4e69fd0aa7d24d5631c2ff62a0df30c1245 /tests/syscalls.scm
parent150d8e6414cad90e1da7d767251b874688e89e26 (diff)
syscalls: Add 'network-interfaces'.
* guix/build/syscalls.scm (SIOCGIFCONF, ifconf-struct, ifreq-struct-size): New variables. (%ioctl, bytevector->string-list, network-interfaces): New procedures. * tests/syscalls.scm ("network-interfaces"): New test.
Diffstat (limited to 'tests/syscalls.scm')
-rw-r--r--tests/syscalls.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index ab34fc825b..fa6b67bf39 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -18,7 +18,8 @@
(define-module (test-syscalls)
#:use-module (guix build syscalls)
- #:use-module (srfi srfi-64))
+ #:use-module (srfi srfi-64)
+ #:use-module (ice-9 match))
;; Test the (guix build syscalls) module, although there's not much that can
;; actually be tested without being root.
@@ -42,6 +43,11 @@
;; Both return values have been encountered in the wild.
(memv (system-error-errno args) (list EPERM ENOENT)))))
+(test-assert "network-interfaces"
+ (match (network-interfaces)
+ (((? string? names) ..1)
+ (member "lo" names))))
+
(test-end)