From 715fc9d44d284a0c5e1ded45091eaf979aa5ecd4 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 18 Sep 2014 20:19:56 +0200 Subject: syscalls: Add 'swapon' and 'swapoff'. * guix/build/syscalls.scm (swapon, swapoff): New procedures. * tests/syscalls.scm ("swapon, ENOENT/EPERM", "swapoff, EINVAL/EPERM"): New tests. --- tests/syscalls.scm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/syscalls.scm') diff --git a/tests/syscalls.scm b/tests/syscalls.scm index b1dc298a14..51846d3c36 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm @@ -44,6 +44,22 @@ ;; Both return values have been encountered in the wild. (memv (system-error-errno args) (list EPERM ENOENT))))) +(test-assert "swapon, ENOENT/EPERM" + (catch 'system-error + (lambda () + (swapon "/does-not-exist") + #f) + (lambda args + (memv (system-error-errno args) (list EPERM ENOENT))))) + +(test-assert "swapoff, EINVAL/EPERM" + (catch 'system-error + (lambda () + (swapoff "/does-not-exist") + #f) + (lambda args + (memv (system-error-errno args) (list EPERM EINVAL))))) + (test-assert "all-network-interfaces" (match (all-network-interfaces) (((? string? names) ..1) -- cgit 1.4.1