From 7585016f53e2e8be1f82ed303ae084464422c2a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 14 Sep 2014 21:39:51 +0200 Subject: 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. --- tests/syscalls.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests') 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) -- cgit v1.2.3