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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user