From 39507094be62417f76ebd18a0724966ededc7166 Mon Sep 17 00:00:00 2001
From: Simon South <simon@simonsouth.net>
Date: Fri, 29 May 2020 13:53:46 -0400
Subject: [PATCH] tests: Allow passing on systems without support for swap
devices.
* tests/syscalls.scm ("swapon", "swapoff"): Accept ENOSYS as a valid result.
---
tests/syscalls.scm | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
@@ -73,21 +73,21 @@
;; Note: 'utimensat' does not change 'ctime'.
(list (stat:mtime st) (stat:atime st)))))
-(test-assert "swapon, ENOENT/EPERM"
+(test-assert "swapon, ENOSYS/ENOENT/EPERM"
(catch 'system-error
(lambda ()
(swapon "/does-not-exist")
#f)
(lambda args
- (memv (system-error-errno args) (list EPERM ENOENT)))))
+ (memv (system-error-errno args) (list EPERM ENOENT ENOSYS)))))
-(test-assert "swapoff, ENOENT/EINVAL/EPERM"
+(test-assert "swapoff, ENOSYS/ENOENT/EINVAL/EPERM"
(catch 'system-error
(lambda ()
(swapoff "/does-not-exist")
#f)
(lambda args
- (memv (system-error-errno args) (list EPERM EINVAL ENOENT)))))
+ (memv (system-error-errno args) (list EPERM EINVAL ENOENT ENOSYS)))))
(test-assert "mkdtemp!"
(let* ((tmp (or (getenv "TMPDIR") "/tmp"))
--
2.26.2