From 715fc9d44d284a0c5e1ded45091eaf979aa5ecd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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') 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 v1.2.3