public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] syscalls/swapon03: do not fail if /proc/swaps is absent
@ 2018-02-13  5:27 Steve Muckle
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Muckle @ 2018-02-13  5:27 UTC (permalink / raw)
  To: ltp

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

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

diff --git a/testcases/kernel/syscalls/swapon/swapon03.c b/testcases/kernel/syscalls/swapon/swapon03.c
index d3f73b044fe1..f690389c55a3 100644
--- a/testcases/kernel/syscalls/swapon/swapon03.c
+++ b/testcases/kernel/syscalls/swapon/swapon03.c
@@ -165,8 +165,7 @@ static int setup_swap(void)
 
 	/* This includes the first (header) line */
 	if ((fd = open("/proc/swaps", O_RDONLY)) == -1) {
-		tst_brkm(TFAIL | TERRNO, cleanup,
-			 "Failed to find out existing number of swap files");
+		tst_brkm(TCONF, cleanup, "Unable to open /proc/swaps");
 	}
 	do {
 		char *p = buf;
-- 
2.13.6


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

* [LTP] [PATCH] syscalls/swapon03: do not fail if /proc/swaps is absent
@ 2018-02-20 23:55 Steve Muckle
  2018-02-21  9:33 ` Richard Palethorpe
  0 siblings, 1 reply; 4+ messages in thread
From: Steve Muckle @ 2018-02-20 23:55 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, 1 insertion(+), 2 deletions(-)

diff --git a/testcases/kernel/syscalls/swapon/swapon03.c b/testcases/kernel/syscalls/swapon/swapon03.c
index d3f73b044fe1..f690389c55a3 100644
--- a/testcases/kernel/syscalls/swapon/swapon03.c
+++ b/testcases/kernel/syscalls/swapon/swapon03.c
@@ -165,8 +165,7 @@ static int setup_swap(void)
 
 	/* This includes the first (header) line */
 	if ((fd = open("/proc/swaps", O_RDONLY)) == -1) {
-		tst_brkm(TFAIL | TERRNO, cleanup,
-			 "Failed to find out existing number of swap files");
+		tst_brkm(TCONF, cleanup, "Unable to open /proc/swaps");
 	}
 	do {
 		char *p = buf;
-- 
2.13.6


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

* [LTP] [PATCH] syscalls/swapon03: do not fail if /proc/swaps is absent
  2018-02-20 23:55 [LTP] [PATCH] syscalls/swapon03: do not fail if /proc/swaps is absent Steve Muckle
@ 2018-02-21  9:33 ` Richard Palethorpe
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Palethorpe @ 2018-02-21  9:33 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, 1 insertion(+), 2 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/swapon/swapon03.c b/testcases/kernel/syscalls/swapon/swapon03.c
> index d3f73b044fe1..f690389c55a3 100644
> --- a/testcases/kernel/syscalls/swapon/swapon03.c
> +++ b/testcases/kernel/syscalls/swapon/swapon03.c
> @@ -165,8 +165,7 @@ static int setup_swap(void)
>  
>  	/* This includes the first (header) line */
>  	if ((fd = open("/proc/swaps", O_RDONLY)) == -1) {
> -		tst_brkm(TFAIL | TERRNO, cleanup,
> -			 "Failed to find out existing number of swap files");
> +		tst_brkm(TCONF, cleanup, "Unable to open /proc/swaps");

You should probably only return TCONF if ENOENT, otherwise TFAIL or TBROK.

>  	}
>  	do {
>  		char *p = buf;
> -- 
> 2.13.6


-- 
Thank you,
Richard.

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

* [LTP] [PATCH] syscalls/swapon03: do not fail if /proc/swaps is absent
@ 2018-04-25  1:28 Steve Muckle
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Muckle @ 2018-04-25  1:28 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

end of thread, other threads:[~2018-04-25  1:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-20 23:55 [LTP] [PATCH] syscalls/swapon03: do not fail if /proc/swaps is absent Steve Muckle
2018-02-21  9:33 ` Richard Palethorpe
  -- strict thread matches above, loose matches on Subject: below --
2018-04-25  1:28 Steve Muckle
2018-02-13  5:27 Steve Muckle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox