[LTP] [PATCH 2/2] swapon01: Simplify code, add copyright
Cyril Hrubis
chrubis@suse.cz
Fri Jan 19 12:59:37 CET 2024
Hi!
> /*\
> @@ -21,18 +22,11 @@
>
> static void verify_swapon(void)
> {
> - TEST(tst_syscall(__NR_swapon, SWAP_FILE, 0));
> + TST_EXP_PASS(tst_syscall(__NR_swapon, SWAP_FILE, 0));
>
> - if (TST_RET == -1) {
> - tst_res(TFAIL | TTERRNO, "Failed to turn on swapfile");
> - } else {
> - tst_res(TPASS, "Succeeded to turn on swapfile");
> - /*we need to turn this swap file off for -i option */
> - if (tst_syscall(__NR_swapoff, SWAP_FILE) != 0) {
> - tst_brk(TBROK | TERRNO, "Failed to turn off swapfile,"
> - " system reboot after execution of LTP "
> - "test suite is recommended.");
> - }
> + if (tst_syscall(__NR_swapoff, SWAP_FILE) != 0) {
Maybe if (TST_PASS && tst_syscall(__NR_swapoff, ...) != 0) {
Otherwise it looks good, with that change:
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
> + tst_brk(TBROK | TERRNO,
> + "Failed to turn off swapfile, system reboot recommended");
> }
> }
>
> --
> 2.42.0
>
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list