All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH RESEND] syscalls/swapon03: do not fail if /proc/swaps is absent
@ 2018-04-29 22:06 Steve Muckle
  2018-04-30  7:50 ` Richard Palethorpe
  2018-04-30 11:20 ` Petr Vorel
  0 siblings, 2 replies; 4+ messages in thread
From: Steve Muckle @ 2018-04-29 22:06 UTC (permalink / raw)
  To: ltp

If the /proc/swaps file is absent the test should be skipped due
to incompatible configuration.

Signed-off-by: Steve Muckle <smuckle.linux@gmail.com>
---
 testcases/kernel/syscalls/swapon/swapon03.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/testcases/kernel/syscalls/swapon/swapon03.c b/testcases/kernel/syscalls/swapon/swapon03.c
index d3f73b044fe1..955ac247b6a2 100644
--- a/testcases/kernel/syscalls/swapon/swapon03.c
+++ b/testcases/kernel/syscalls/swapon/swapon03.c
@@ -328,6 +328,9 @@ static void setup(void)
 
 	tst_require_root();
 
+	if (access("/proc/swaps", F_OK))
+		tst_brkm(TCONF, NULL, "swap not supported by kernel");
+
 	tst_tmpdir();
 
 	switch ((fs_type = tst_fs_type(cleanup, "."))) {
-- 
2.16.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [LTP] [PATCH RESEND] syscalls/swapon03: do not fail if /proc/swaps is absent
  2018-04-29 22:06 [LTP] [PATCH RESEND] syscalls/swapon03: do not fail if /proc/swaps is absent Steve Muckle
@ 2018-04-30  7:50 ` Richard Palethorpe
  2018-04-30 11:20 ` Petr Vorel
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Palethorpe @ 2018-04-30  7:50 UTC (permalink / raw)
  To: ltp

Hello Steve,

Steve Muckle writes:

> If the /proc/swaps file is absent the test should be skipped due
> to incompatible configuration.
>
> Signed-off-by: Steve Muckle <smuckle.linux@gmail.com>
> ---
>  testcases/kernel/syscalls/swapon/swapon03.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/testcases/kernel/syscalls/swapon/swapon03.c b/testcases/kernel/syscalls/swapon/swapon03.c
> index d3f73b044fe1..955ac247b6a2 100644
> --- a/testcases/kernel/syscalls/swapon/swapon03.c
> +++ b/testcases/kernel/syscalls/swapon/swapon03.c
> @@ -328,6 +328,9 @@ static void setup(void)
>  
>  	tst_require_root();
>  
> +	if (access("/proc/swaps", F_OK))
> +		tst_brkm(TCONF, NULL, "swap not supported by kernel");
> +
>  	tst_tmpdir();
>  
>  	switch ((fs_type = tst_fs_type(cleanup, "."))) {

LGTM

-- 
Thank you,
Richard.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [LTP] [PATCH RESEND] syscalls/swapon03: do not fail if /proc/swaps is absent
  2018-04-29 22:06 [LTP] [PATCH RESEND] syscalls/swapon03: do not fail if /proc/swaps is absent Steve Muckle
  2018-04-30  7:50 ` Richard Palethorpe
@ 2018-04-30 11:20 ` Petr Vorel
  2018-05-01 20:41   ` Steve Muckle
  1 sibling, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2018-04-30 11:20 UTC (permalink / raw)
  To: ltp

Hi,

> If the /proc/swaps file is absent the test should be skipped due
> to incompatible configuration.

> Signed-off-by: Steve Muckle <smuckle.linux@gmail.com>
> ---
>  testcases/kernel/syscalls/swapon/swapon03.c | 3 +++
>  1 file changed, 3 insertions(+)

> diff --git a/testcases/kernel/syscalls/swapon/swapon03.c b/testcases/kernel/syscalls/swapon/swapon03.c
> index d3f73b044fe1..955ac247b6a2 100644
> --- a/testcases/kernel/syscalls/swapon/swapon03.c
> +++ b/testcases/kernel/syscalls/swapon/swapon03.c
> @@ -328,6 +328,9 @@ static void setup(void)

>  	tst_require_root();

> +	if (access("/proc/swaps", F_OK))
> +		tst_brkm(TCONF, NULL, "swap not supported by kernel");
> +
>  	tst_tmpdir();

>  	switch ((fs_type = tst_fs_type(cleanup, "."))) {

Merged, thanks!

BTW I wonder which distros don't have CONFIG_SWAP=y. Some embedded or Android?

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [LTP] [PATCH RESEND] syscalls/swapon03: do not fail if /proc/swaps is absent
  2018-04-30 11:20 ` Petr Vorel
@ 2018-05-01 20:41   ` Steve Muckle
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Muckle @ 2018-05-01 20:41 UTC (permalink / raw)
  To: ltp

On Mon, Apr 30, 2018 at 4:20 AM, Petr Vorel <pvorel@suse.cz> wrote:

> BTW I wonder which distros don't have CONFIG_SWAP=y. Some embedded or
> Android?
>

Thanks. Yes the platform in my case is Android, though I could see other
embedded platforms not using swap also.

cheers,
Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20180501/4fcb1c2d/attachment.html>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-01 20:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-29 22:06 [LTP] [PATCH RESEND] syscalls/swapon03: do not fail if /proc/swaps is absent Steve Muckle
2018-04-30  7:50 ` Richard Palethorpe
2018-04-30 11:20 ` Petr Vorel
2018-05-01 20:41   ` Steve Muckle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.