From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v5 7/8] swapon/off: enable all_filesystem in swap test
Date: Sun, 28 Jan 2024 10:48:37 +0800 [thread overview]
Message-ID: <20240128024838.2699248-8-liwang@redhat.com> (raw)
In-Reply-To: <20240128024838.2699248-1-liwang@redhat.com>
Signed-off-by: Li Wang <liwang@redhat.com>
---
testcases/kernel/syscalls/swapoff/swapoff02.c | 11 ++++++-----
testcases/kernel/syscalls/swapon/swapon02.c | 4 ++++
testcases/kernel/syscalls/swapon/swapon03.c | 4 ++++
3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/testcases/kernel/syscalls/swapoff/swapoff02.c b/testcases/kernel/syscalls/swapoff/swapoff02.c
index cd940b1e7..53060b320 100644
--- a/testcases/kernel/syscalls/swapoff/swapoff02.c
+++ b/testcases/kernel/syscalls/swapoff/swapoff02.c
@@ -18,6 +18,8 @@
#include "lapi/syscalls.h"
#include "libswap.h"
+#define MNTPOINT "mntpoint"
+
static int setup01(void);
static void cleanup01(void);
@@ -84,14 +86,13 @@ static void setup(void)
is_swap_supported("./tstswap");
- if (!tst_fs_has_free(".", 1, TST_KB))
- tst_brk(TBROK, "Insufficient disk space to create swap file");
-
- if (tst_fill_file("./swapfile01", 0x00, 1024, 1))
- tst_brk(TBROK, "Failed to create swapfile");
+ if (make_swapfile("swapfile01", 10, 1))
+ tst_brk(TBROK, "Failed to create file for swap");
}
static struct tst_test test = {
+ .mntpoint = MNTPOINT,
+ .all_filesystems = 1,
.needs_root = 1,
.needs_tmpdir = 1,
.test = verify_swapoff,
diff --git a/testcases/kernel/syscalls/swapon/swapon02.c b/testcases/kernel/syscalls/swapon/swapon02.c
index f5b0d6d56..acb789fc4 100644
--- a/testcases/kernel/syscalls/swapon/swapon02.c
+++ b/testcases/kernel/syscalls/swapon/swapon02.c
@@ -20,6 +20,8 @@
#include "lapi/syscalls.h"
#include "libswap.h"
+#define MNTPOINT "mntpoint"
+
static uid_t nobody_uid;
static int do_swapoff;
@@ -78,6 +80,8 @@ static void verify_swapon(unsigned int i)
}
static struct tst_test test = {
+ .mntpoint = MNTPOINT,
+ .all_filesystems = 1,
.needs_root = 1,
.needs_tmpdir = 1,
.test = verify_swapon,
diff --git a/testcases/kernel/syscalls/swapon/swapon03.c b/testcases/kernel/syscalls/swapon/swapon03.c
index e13009111..249cb12c3 100644
--- a/testcases/kernel/syscalls/swapon/swapon03.c
+++ b/testcases/kernel/syscalls/swapon/swapon03.c
@@ -22,6 +22,8 @@
#include "swaponoff.h"
#include "libswap.h"
+#define MNTPOINT "mntpoint"
+
static int setup_swap(void);
static int clean_swap(void);
static int check_and_swapoff(const char *filename);
@@ -265,6 +267,8 @@ static void cleanup(void)
}
static struct tst_test test = {
+ .mntpoint = MNTPOINT,
+ .all_filesystems = 1,
.needs_root = 1,
.needs_tmpdir = 1,
.forks_child = 1,
--
2.40.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2024-01-28 2:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-28 2:48 [LTP] [PATCH v5 0/8] improvement work on libswap library Li Wang
2024-01-28 2:48 ` [LTP] [PATCH v5 1/8] libswap: add known swap supported fs check Li Wang
2024-01-28 2:48 ` [LTP] [PATCH v5 2/8] swapon01: Test on all filesystems Li Wang
2024-01-28 2:48 ` [LTP] [PATCH v5 3/8] swapon01: Improving test with memory limits and swap reporting Li Wang
2024-01-28 2:48 ` [LTP] [PATCH v5 4/8] libswap: add function to prealloc contiguous file Li Wang
2024-01-28 2:48 ` [LTP] [PATCH v5 5/8] libswap: Introduce file contiguity check Li Wang
2024-01-28 2:48 ` [LTP] [PATCH v5 6/8] libswap: customize swapfile size Li Wang
2024-01-28 2:48 ` Li Wang [this message]
2024-01-29 8:03 ` [LTP] [PATCH v5 7/8] swapon/off: enable all_filesystem in swap test Petr Vorel
2024-01-29 8:26 ` Li Wang
2024-01-28 2:48 ` [LTP] [PATCH v5 8/8] libswap: Refactor is_swap_supported function to return status Li Wang
2024-01-29 8:03 ` Petr Vorel
2024-01-29 11:36 ` Li Wang
2024-01-29 12:22 ` Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240128024838.2699248-8-liwang@redhat.com \
--to=liwang@redhat.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox