guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/02: tests: Adjust syscall tests for 2.6ish Linux.


From: Ludovic Courtès
Subject: 01/02: tests: Adjust syscall tests for 2.6ish Linux.
Date: Mon, 19 Jan 2015 15:37:20 +0000

civodul pushed a commit to branch master
in repository guix.

commit d35c5e29b6cae013aa0f4e8b075670010b9c9ce1
Author: Ludovic Courtès <address@hidden>
Date:   Mon Jan 19 15:44:12 2015 +0100

    tests: Adjust syscall tests for 2.6ish Linux.
    
    * tests/syscalls.scm ("set-network-interface-flags",
      "set-network-interface-address"): Accept EACCES as a valid result.
---
 tests/syscalls.scm |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index 21d6637..f26331e 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014 Ludovic Courtès <address@hidden>
+;;; Copyright © 2014, 2015 Ludovic Courtès <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -91,15 +91,15 @@
            (system-error-errno args)))))
 
 (test-skip (if (zero? (getuid)) 1 0))
-(test-equal "set-network-interface-flags"
-  EPERM
+(test-assert "set-network-interface-flags"
   (let ((sock (socket AF_INET SOCK_STREAM 0)))
     (catch 'system-error
       (lambda ()
         (set-network-interface-flags sock "lo" IFF_UP))
       (lambda args
         (close-port sock)
-        (system-error-errno args)))))
+        ;; We get EPERM with Linux 3.18ish and EACCES with 2.6.32.
+        (memv (system-error-errno args) (list EPERM EACCES))))))
 
 (test-equal "network-interface-address lo"
   (make-socket-address AF_INET (inet-pton AF_INET "127.0.0.1") 0)
@@ -108,8 +108,7 @@
     (close-port sock)
     addr))
 
-(test-equal "set-network-interface-address"
-  EPERM
+(test-assert "set-network-interface-address"
   (let ((sock (socket AF_INET SOCK_STREAM 0)))
     (catch 'system-error
       (lambda ()
@@ -120,7 +119,8 @@
                                         0)))
       (lambda args
         (close-port sock)
-        (system-error-errno args)))))
+        ;; We get EPERM with Linux 3.18ish and EACCES with 2.6.32.
+        (memv (system-error-errno args) (list EPERM EACCES))))))
 
 (test-end)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]