diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2016-03-25 17:29:36 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2016-03-25 17:29:36 +0100 |
| commit | 7adbe85e60fce61d0082a9c46604a26d651cb87a (patch) | |
| tree | 43f2295b341a02d05bc1ce34937121bd287b0568 /tests | |
| parent | 001dae0d7431719655f525a94dc900cc078cca99 (diff) | |
syscalls: 'interface-address' can return #f.
Fixes <http://bugs.gnu.org/22612>.
Reported by Danny Milosavljevic <dannym@scratchpost.org>.
* tests/syscalls.scm ("network-interfaces returns one or more
interfaces"): Accept 'interface-address' value of #f.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/syscalls.scm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/syscalls.scm b/tests/syscalls.scm index a57a9ca9f9d..feeb74c11b5 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2015 David Thompson <davet@gnu.org> | 3 | ;;; Copyright © 2015 David Thompson <davet@gnu.org> |
| 4 | ;;; | 4 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| @@ -223,7 +223,11 @@ | |||
| 223 | ((interfaces ..1) | 223 | ((interfaces ..1) |
| 224 | (list (every interface? interfaces) | 224 | (list (every interface? interfaces) |
| 225 | (every string? (map interface-name interfaces)) | 225 | (every string? (map interface-name interfaces)) |
| 226 | (every vector? (map interface-address interfaces)))))) | 226 | (every (lambda (sockaddr) |
| 227 | ;; Sometimes interfaces have no associated address. | ||
| 228 | (or (vector? sockaddr) | ||
| 229 | (not sockaddr))) | ||
| 230 | (map interface-address interfaces)))))) | ||
| 227 | 231 | ||
| 228 | (test-equal "network-interfaces returns \"lo\"" | 232 | (test-equal "network-interfaces returns \"lo\"" |
| 229 | (list #t (make-socket-address AF_INET (inet-pton AF_INET "127.0.0.1") 0)) | 233 | (list #t (make-socket-address AF_INET (inet-pton AF_INET "127.0.0.1") 0)) |
