diff mbox series

syscalls/swapon03: do not fail if /proc/swaps is absent

Message ID 20180425012857.15100-1-smuckle.linux@gmail.com
State Accepted
Delegated to: Petr Vorel
Headers show
Series syscalls/swapon03: do not fail if /proc/swaps is absent | expand

Commit Message

Steve Muckle April 25, 2018, 1:28 a.m. UTC
If the /proc/swaps file is absent the test should be skipped due
to incompatible configuration.

Signed-off-by: Steve Muckle <smuckle.linux@gmail.com>
---
 testcases/kernel/syscalls/swapon/swapon03.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/swapon/swapon03.c b/testcases/kernel/syscalls/swapon/swapon03.c
index d3f73b044fe1..955ac247b6a2 100644
--- a/testcases/kernel/syscalls/swapon/swapon03.c
+++ b/testcases/kernel/syscalls/swapon/swapon03.c
@@ -328,6 +328,9 @@  static void setup(void)
 
 	tst_require_root();
 
+	if (access("/proc/swaps", F_OK))
+		tst_brkm(TCONF, NULL, "swap not supported by kernel");
+
 	tst_tmpdir();
 
 	switch ((fs_type = tst_fs_type(cleanup, "."))) {