diff mbox series

[1/3] swapoff0[12]: Remove unneeded tst_brk()

Message ID 20240418141312.99794-2-pvorel@suse.cz
State Accepted
Headers show
Series swap{on,off} fixes for page size > 4KB | expand

Commit Message

Petr Vorel April 18, 2024, 2:13 p.m. UTC
SAFE_MAKE_SWAPFILE_BLKS() calls make_swapfile() with safe parameter == 1,
therefore passes TST_CMD_PASS_RETVAL | TST_CMD_TCONF_ON_MISSING to
tst_cmd() and following functions, which leads to quit testing due
tst_brkm(TCONF, ...).

This is a left over from transition from tst_fill_file() which does not
have safe parameter to make_swapfile() in 6249e87b5 (swapoff01.c) and
009a407a0 (swapoff02.c).

Fixes: 6249e87b5 ("libswap: customize swapfile size")
Fixes: 009a407a0 ("swapon/off: enable all_filesystem in swap test")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/swapoff/swapoff01.c | 4 +---
 testcases/kernel/syscalls/swapoff/swapoff02.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

Comments

Cyril Hrubis April 18, 2024, 2:56 p.m. UTC | #1
Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Petr Vorel April 18, 2024, 6:02 p.m. UTC | #2
Hi Cyril,

merged this first patch, thanks!

Kind regards,
Petr
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/swapoff/swapoff01.c b/testcases/kernel/syscalls/swapoff/swapoff01.c
index cf13907e7..314630267 100644
--- a/testcases/kernel/syscalls/swapoff/swapoff01.c
+++ b/testcases/kernel/syscalls/swapoff/swapoff01.c
@@ -43,9 +43,7 @@  static void verify_swapoff(void)
 static void setup(void)
 {
 	is_swap_supported(TEST_FILE);
-
-	if (SAFE_MAKE_SWAPFILE_BLKS(SWAP_FILE, 65536))
-		tst_brk(TBROK, "Failed to create file for swap");
+	SAFE_MAKE_SWAPFILE_BLKS(SWAP_FILE, 65536);
 }
 
 static struct tst_test test = {
diff --git a/testcases/kernel/syscalls/swapoff/swapoff02.c b/testcases/kernel/syscalls/swapoff/swapoff02.c
index 61536dda4..5a15826e4 100644
--- a/testcases/kernel/syscalls/swapoff/swapoff02.c
+++ b/testcases/kernel/syscalls/swapoff/swapoff02.c
@@ -87,9 +87,7 @@  static void setup(void)
 	nobody_uid = nobody->pw_uid;
 
 	is_swap_supported(TEST_FILE);
-
-	if (SAFE_MAKE_SWAPFILE_BLKS(SWAP_FILE, 10))
-		tst_brk(TBROK, "Failed to create file for swap");
+	SAFE_MAKE_SWAPFILE_BLKS(SWAP_FILE, 10);
 }
 
 static struct tst_test test = {