public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] swapoff01: make use of make_swapfile
Date: Tue, 23 Jan 2024 16:43:05 +0100	[thread overview]
Message-ID: <20240123154305.GA201093@pevik> (raw)
In-Reply-To: <20240123132207.2646026-1-liwang@redhat.com>

Hi Li,

> This patch updates the swapoff01 test setup by replacing the previous
> swapfile creation method with a single call to make_swapfile, which
> now creates a contiguous swap file.

> This change simplifies the setup and fix failure on TMPDIR on btrfs.

> Note: it is a single fix but better applied with behind the libswap updates.

Reviewed-by: Petr Vorel <pvorel@suse.cz>

This fixes issue on SLES. The only problem is that we makes swap partition much
smaller than before (e.g. we loose coverage of testing on big swap).

Kind regards,
Petr

> Suggested-by: Petr Vorel <pvorel@suse.cz>
> Signed-off-by: Li Wang <liwang@redhat.com>
> ---
>  testcases/kernel/syscalls/swapoff/swapoff01.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)

> diff --git a/testcases/kernel/syscalls/swapoff/swapoff01.c b/testcases/kernel/syscalls/swapoff/swapoff01.c
> index b27eecdad..f36f7f17c 100644
> --- a/testcases/kernel/syscalls/swapoff/swapoff01.c
> +++ b/testcases/kernel/syscalls/swapoff/swapoff01.c
> @@ -44,11 +44,8 @@ static void setup(void)
>  		tst_brk(TBROK,
>  			"Insufficient disk space to create swap file");

> -	if (tst_fill_file("swapfile01", 0x00, 1024, 65536))
> +	if (make_swapfile("swapfile01", 1))
>  		tst_brk(TBROK, "Failed to create file for swap");
> -
> -	if (system("mkswap swapfile01 > tmpfile 2>&1") != 0)
> -		tst_brk(TBROK, "Failed to make swapfile");
>  }

>  static struct tst_test test = {

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

      reply	other threads:[~2024-01-23 15:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23 13:22 [LTP] [PATCH] swapoff01: make use of make_swapfile Li Wang
2024-01-23 15:43 ` Petr Vorel [this message]

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=20240123154305.GA201093@pevik \
    --to=pvorel@suse.cz \
    --cc=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