diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2014-09-18 20:19:56 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2014-09-18 20:19:56 +0200 |
| commit | 715fc9d44d284a0c5e1ded45091eaf979aa5ecd4 (patch) | |
| tree | b13a651a1a624043348cc0d411aca5fbbe42c19a /tests/syscalls.scm | |
| parent | 510f9d8624fb3440e0ec310826258d13e4f58c32 (diff) | |
syscalls: Add 'swapon' and 'swapoff'.
* guix/build/syscalls.scm (swapon, swapoff): New procedures.
* tests/syscalls.scm ("swapon, ENOENT/EPERM", "swapoff, EINVAL/EPERM"):
New tests.
Diffstat (limited to 'tests/syscalls.scm')
| -rw-r--r-- | tests/syscalls.scm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/syscalls.scm b/tests/syscalls.scm index b1dc298a140..51846d3c36c 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm | |||
| @@ -44,6 +44,22 @@ | |||
| 44 | ;; Both return values have been encountered in the wild. | 44 | ;; Both return values have been encountered in the wild. |
| 45 | (memv (system-error-errno args) (list EPERM ENOENT))))) | 45 | (memv (system-error-errno args) (list EPERM ENOENT))))) |
| 46 | 46 | ||
| 47 | (test-assert "swapon, ENOENT/EPERM" | ||
| 48 | (catch 'system-error | ||
| 49 | (lambda () | ||
| 50 | (swapon "/does-not-exist") | ||
| 51 | #f) | ||
| 52 | (lambda args | ||
| 53 | (memv (system-error-errno args) (list EPERM ENOENT))))) | ||
| 54 | |||
| 55 | (test-assert "swapoff, EINVAL/EPERM" | ||
| 56 | (catch 'system-error | ||
| 57 | (lambda () | ||
| 58 | (swapoff "/does-not-exist") | ||
| 59 | #f) | ||
| 60 | (lambda args | ||
| 61 | (memv (system-error-errno args) (list EPERM EINVAL))))) | ||
| 62 | |||
| 47 | (test-assert "all-network-interfaces" | 63 | (test-assert "all-network-interfaces" |
| 48 | (match (all-network-interfaces) | 64 | (match (all-network-interfaces) |
| 49 | (((? string? names) ..1) | 65 | (((? string? names) ..1) |
