public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>,
	ltp@lists.linux.it, Li Wang <liwang@redhat.com>
Subject: Re: [LTP] [PATCH v4 1/1] swapon03: Try to swapon() as many files until it fails
Date: Fri, 19 Dec 2025 15:41:02 +0100	[thread overview]
Message-ID: <20251219144102.GA325483@pevik> (raw)
In-Reply-To: <20251219140216.GA247368@pevik>

> [ Removing Michal to not bother him with LTP internals ]

> > Hi!
> > >  	tst_res(TINFO, "Successfully created %d swap files", swapfiles);
> > > -	MAKE_SMALL_SWAPFILE(TEST_FILE);

> > This should stay here, right? I suppose that the test works even when we
> > pass non-existing file in the verify_swapon() but we shouldn't bet on
> > that.

> FYI swap file is created by is_swap_supported(TEST_FILE). But sure, I can
> also keep MAKE_SMALL_SWAPFILE(TEST_FILE) to make sure file is also created.
> We talked about related cleanup, which I wanted to postpone, but should I
> refactor is_swap_supported() to not include swapon() call. Because when there
> are too many swap files already mounted, tests is skipped with:

> libswap.c:224: TCONF: Permission denied for swapon()
> due EPERM, which is actually subject of testing for swapon03.c

And, as I posted in v3 [1], we can avoid this work, if we require at least
single swap created by the test. Or, allow a corner case all swaps are used,
but just verify that by counting swap in /proc/swaps.

Kind regards,
Petr

[1] https://lore.kernel.org/ltp/20251219142512.GC247368@pevik/

> I'm not sure about naming. Maybe have is_swap_supported() without swapon() call
> (for swapon03.c) and create new function is_swapon_supported(), which would call
> is_swap_supported() + swapon() and swapoff() (for all other tests).

> Kind regards,
> Petr

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

  reply	other threads:[~2025-12-19 14:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-19  9:42 [LTP] [PATCH v4 1/1] swapon03: Try to swapon() as many files until it fails Petr Vorel
2025-12-19 10:48 ` Cyril Hrubis
2025-12-19 12:41   ` Li Wang via ltp
2025-12-19 14:03     ` Petr Vorel
2025-12-19 14:04     ` Cyril Hrubis
2025-12-19 14:02   ` Petr Vorel
2025-12-19 14:41     ` Petr Vorel [this message]
2025-12-20  4:27       ` Li Wang via ltp
2025-12-20  4:32         ` Li Wang via ltp
2025-12-22  7:59           ` Petr Vorel
2025-12-22  8:55             ` Li Wang via ltp
2025-12-19 13:06 ` Li Wang via ltp
2025-12-19 14:18   ` 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=20251219144102.GA325483@pevik \
    --to=pvorel@suse.cz \
    --cc=chrubis@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