1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-23 09:35:56 +02:00

syscalls: Add 'swapon' and 'swapoff'.

* guix/build/syscalls.scm (swapon, swapoff): New procedures.
* tests/syscalls.scm ("swapon, ENOENT/EPERM", "swapoff, EINVAL/EPERM"):
  New tests.
This commit is contained in:
Ludovic Courtès
2014-09-18 20:19:56 +02:00
parent 510f9d8624
commit 715fc9d44d
2 changed files with 42 additions and 0 deletions
+16
View File
@@ -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)