public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 2/3] fix make check warnings: use octal permission.
  2024-08-14 10:00 lufei
@ 2024-08-14 10:00 ` lufei
  0 siblings, 0 replies; 6+ messages in thread
From: lufei @ 2024-08-14 10:00 UTC (permalink / raw)
  To: ltp; +Cc: lufei

Replace symbolic permission with octal.

Signed-off-by: lufei <lufei@uniontech.com>
---
 testcases/kernel/syscalls/acct/acct01.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/testcases/kernel/syscalls/acct/acct01.c b/testcases/kernel/syscalls/acct/acct01.c
index b9b08ef67..de653d810 100644
--- a/testcases/kernel/syscalls/acct/acct01.c
+++ b/testcases/kernel/syscalls/acct/acct01.c
@@ -25,8 +25,7 @@
 
 #include "tst_test.h"
 
-#define DIR_MODE	(S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \
-			 S_IXGRP|S_IROTH|S_IXOTH)
+#define DIR_MODE	0755
 #define FILE_EISDIR		"."
 #define FILE_EACCESS		"/dev/null"
 #define FILE_ENOENT		"/tmp/does/not/exist"
-- 
2.39.3


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

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

* [LTP] [PATCH 1/3] fix make check errors: replace space with tabs, remove unecessary spaces.
@ 2024-08-14 10:11 lufei
  2024-08-14 10:11 ` [LTP] [PATCH 2/3] fix make check warnings: use octal permission lufei
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: lufei @ 2024-08-14 10:11 UTC (permalink / raw)
  To: ltp; +Cc: lufei

replace space with tabs, remove unecessary spaces.

Signed-off-by: lufei <lufei@uniontech.com>
---
 testcases/kernel/syscalls/acct/acct01.c | 6 +++---
 testcases/kernel/syscalls/acct/acct02.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/testcases/kernel/syscalls/acct/acct01.c b/testcases/kernel/syscalls/acct/acct01.c
index 60cf4681e..b9b08ef67 100644
--- a/testcases/kernel/syscalls/acct/acct01.c
+++ b/testcases/kernel/syscalls/acct/acct01.c
@@ -73,8 +73,8 @@ static struct test_case {
 	char **filename;
 	char *desc;
 	int exp_errno;
-	void (*setupfunc) ();
-	void (*cleanfunc) ();
+	void (*setupfunc)();
+	void (*cleanfunc)();
 } tcases[] = {
 	{&file_eisdir,  FILE_EISDIR,  EISDIR,  NULL,   NULL},
 	{&file_eaccess, FILE_EACCESS, EACCES,  NULL,   NULL},
@@ -126,7 +126,7 @@ static void verify_acct(unsigned int nr)
 		tcase->setupfunc();
 
 	TST_EXP_FAIL(acct(*tcase->filename), tcase->exp_errno,
-	             "acct(%s)", tcase->desc);
+		"acct(%s)", tcase->desc);
 
 	if (tcase->cleanfunc)
 		tcase->cleanfunc();
diff --git a/testcases/kernel/syscalls/acct/acct02.c b/testcases/kernel/syscalls/acct/acct02.c
index d3f3d9d04..74019f430 100644
--- a/testcases/kernel/syscalls/acct/acct02.c
+++ b/testcases/kernel/syscalls/acct/acct02.c
@@ -186,7 +186,7 @@ static void run(void)
 
 		if (read_bytes != acct_size) {
 			tst_res(TFAIL, "incomplete read %i bytes, expected %i",
-			        read_bytes, acct_size);
+					read_bytes, acct_size);
 			goto exit;
 		}
 
-- 
2.39.3


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

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

* [LTP] [PATCH 2/3] fix make check warnings: use octal permission.
  2024-08-14 10:11 [LTP] [PATCH 1/3] fix make check errors: replace space with tabs, remove unecessary spaces lufei
@ 2024-08-14 10:11 ` lufei
  2024-08-14 10:11 ` [LTP] [PATCH 3/3] fix make check warning: using .needs_kconfigs instead of ENOSYS lufei
  2025-01-14 14:40 ` [LTP] [PATCH 1/3] fix make check errors: replace space with tabs, remove unecessary spaces Andrea Cervesato via ltp
  2 siblings, 0 replies; 6+ messages in thread
From: lufei @ 2024-08-14 10:11 UTC (permalink / raw)
  To: ltp; +Cc: lufei

Replace symbolic permission with octal.

Signed-off-by: lufei <lufei@uniontech.com>
---
 testcases/kernel/syscalls/acct/acct01.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/testcases/kernel/syscalls/acct/acct01.c b/testcases/kernel/syscalls/acct/acct01.c
index b9b08ef67..de653d810 100644
--- a/testcases/kernel/syscalls/acct/acct01.c
+++ b/testcases/kernel/syscalls/acct/acct01.c
@@ -25,8 +25,7 @@
 
 #include "tst_test.h"
 
-#define DIR_MODE	(S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \
-			 S_IXGRP|S_IROTH|S_IXOTH)
+#define DIR_MODE	0755
 #define FILE_EISDIR		"."
 #define FILE_EACCESS		"/dev/null"
 #define FILE_ENOENT		"/tmp/does/not/exist"
-- 
2.39.3


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

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

* [LTP] [PATCH 3/3] fix make check warning: using .needs_kconfigs instead of ENOSYS
  2024-08-14 10:11 [LTP] [PATCH 1/3] fix make check errors: replace space with tabs, remove unecessary spaces lufei
  2024-08-14 10:11 ` [LTP] [PATCH 2/3] fix make check warnings: use octal permission lufei
@ 2024-08-14 10:11 ` lufei
  2025-01-14 16:32   ` Petr Vorel
  2025-01-14 14:40 ` [LTP] [PATCH 1/3] fix make check errors: replace space with tabs, remove unecessary spaces Andrea Cervesato via ltp
  2 siblings, 1 reply; 6+ messages in thread
From: lufei @ 2024-08-14 10:11 UTC (permalink / raw)
  To: ltp; +Cc: lufei

Replace ENOSYS with .needs_kconfigs `CONFIG_BSD_PROCESS_ACCT=y`

Signed-off-by: lufei <lufei@uniontech.com>
---
 testcases/kernel/syscalls/acct/acct01.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/syscalls/acct/acct01.c b/testcases/kernel/syscalls/acct/acct01.c
index de653d810..cfd25c665 100644
--- a/testcases/kernel/syscalls/acct/acct01.c
+++ b/testcases/kernel/syscalls/acct/acct01.c
@@ -92,8 +92,6 @@ static void setup(void)
 	int fd;
 
 	TEST(acct(NULL));
-	if (TST_RET == -1 && TST_ERR == ENOSYS)
-		tst_brk(TCONF, "acct() system call isn't configured in kernel");
 
 	ltpuser = SAFE_GETPWNAM("nobody");
 
@@ -148,5 +146,8 @@ static struct tst_test test = {
 		{&file_enametoolong, .size = PATH_MAX+2},
 		{&file_erofs, .str = FILE_EROFS},
 		{}
+	},
+	.needs_kconfigs = (const char *[]) {
+		"CONFIG_BSD_PROCESS_ACCT=y",
 	}
 };
-- 
2.39.3


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

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

* Re: [LTP] [PATCH 1/3] fix make check errors: replace space with tabs, remove unecessary spaces.
  2024-08-14 10:11 [LTP] [PATCH 1/3] fix make check errors: replace space with tabs, remove unecessary spaces lufei
  2024-08-14 10:11 ` [LTP] [PATCH 2/3] fix make check warnings: use octal permission lufei
  2024-08-14 10:11 ` [LTP] [PATCH 3/3] fix make check warning: using .needs_kconfigs instead of ENOSYS lufei
@ 2025-01-14 14:40 ` Andrea Cervesato via ltp
  2 siblings, 0 replies; 6+ messages in thread
From: Andrea Cervesato via ltp @ 2025-01-14 14:40 UTC (permalink / raw)
  To: ltp, lufei

Hi!

Thanks, pushed.

Kind regards,
Andrea Cervesato

On 8/14/24 12:11, lufei wrote:
> replace space with tabs, remove unecessary spaces.
>
> Signed-off-by: lufei <lufei@uniontech.com>
> ---
>   testcases/kernel/syscalls/acct/acct01.c | 6 +++---
>   testcases/kernel/syscalls/acct/acct02.c | 2 +-
>   2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/acct/acct01.c b/testcases/kernel/syscalls/acct/acct01.c
> index 60cf4681e..b9b08ef67 100644
> --- a/testcases/kernel/syscalls/acct/acct01.c
> +++ b/testcases/kernel/syscalls/acct/acct01.c
> @@ -73,8 +73,8 @@ static struct test_case {
>   	char **filename;
>   	char *desc;
>   	int exp_errno;
> -	void (*setupfunc) ();
> -	void (*cleanfunc) ();
> +	void (*setupfunc)();
> +	void (*cleanfunc)();
>   } tcases[] = {
>   	{&file_eisdir,  FILE_EISDIR,  EISDIR,  NULL,   NULL},
>   	{&file_eaccess, FILE_EACCESS, EACCES,  NULL,   NULL},
> @@ -126,7 +126,7 @@ static void verify_acct(unsigned int nr)
>   		tcase->setupfunc();
>   
>   	TST_EXP_FAIL(acct(*tcase->filename), tcase->exp_errno,
> -	             "acct(%s)", tcase->desc);
> +		"acct(%s)", tcase->desc);
>   
>   	if (tcase->cleanfunc)
>   		tcase->cleanfunc();
> diff --git a/testcases/kernel/syscalls/acct/acct02.c b/testcases/kernel/syscalls/acct/acct02.c
> index d3f3d9d04..74019f430 100644
> --- a/testcases/kernel/syscalls/acct/acct02.c
> +++ b/testcases/kernel/syscalls/acct/acct02.c
> @@ -186,7 +186,7 @@ static void run(void)
>   
>   		if (read_bytes != acct_size) {
>   			tst_res(TFAIL, "incomplete read %i bytes, expected %i",
> -			        read_bytes, acct_size);
> +					read_bytes, acct_size);
>   			goto exit;
>   		}
>   

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

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

* Re: [LTP] [PATCH 3/3] fix make check warning: using .needs_kconfigs instead of ENOSYS
  2024-08-14 10:11 ` [LTP] [PATCH 3/3] fix make check warning: using .needs_kconfigs instead of ENOSYS lufei
@ 2025-01-14 16:32   ` Petr Vorel
  0 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2025-01-14 16:32 UTC (permalink / raw)
  To: lufei; +Cc: ltp

Hi all,

> Replace ENOSYS with .needs_kconfigs `CONFIG_BSD_PROCESS_ACCT=y`

> Signed-off-by: lufei <lufei@uniontech.com>
> ---
>  testcases/kernel/syscalls/acct/acct01.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

> diff --git a/testcases/kernel/syscalls/acct/acct01.c b/testcases/kernel/syscalls/acct/acct01.c
> index de653d810..cfd25c665 100644
> --- a/testcases/kernel/syscalls/acct/acct01.c
> +++ b/testcases/kernel/syscalls/acct/acct01.c
> @@ -92,8 +92,6 @@ static void setup(void)
>  	int fd;

>  	TEST(acct(NULL));
> -	if (TST_RET == -1 && TST_ERR == ENOSYS)
> -		tst_brk(TCONF, "acct() system call isn't configured in kernel");

>  	ltpuser = SAFE_GETPWNAM("nobody");

> @@ -148,5 +146,8 @@ static struct tst_test test = {
>  		{&file_enametoolong, .size = PATH_MAX+2},
>  		{&file_erofs, .str = FILE_EROFS},
>  		{}
> +	},
> +	.needs_kconfigs = (const char *[]) {
> +		"CONFIG_BSD_PROCESS_ACCT=y",
>  	}
>  };

For a record, the warning was:

acct01.c:95: WARNING: ENOSYS means 'invalid syscall nr' and nothing else

This is relevant for kernel code, but not for LTP.

We in the past tried to avoid on kernel configs. Now we on many places use
.needs_kconfigs. Does it mean we just request kernel config? Nobody complained
about it and .needs_kconfigs is kind of documentation, but still I hope that
there aren't many quiet users who see many TCONF. Due this reason I think twice
before I add .needs_kconfigs, specially when ENOSYS is valid detection we use in
tst_syscall().

lib/tst_test.c
	if (tst_test->needs_kconfigs && tst_kconfig_check(tst_test->needs_kconfigs))
		tst_brk(TCONF, "Aborting due to unsuitable kernel config, see above!");

Kind regards,
Petr

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

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

end of thread, other threads:[~2025-01-14 16:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-14 10:11 [LTP] [PATCH 1/3] fix make check errors: replace space with tabs, remove unecessary spaces lufei
2024-08-14 10:11 ` [LTP] [PATCH 2/3] fix make check warnings: use octal permission lufei
2024-08-14 10:11 ` [LTP] [PATCH 3/3] fix make check warning: using .needs_kconfigs instead of ENOSYS lufei
2025-01-14 16:32   ` Petr Vorel
2025-01-14 14:40 ` [LTP] [PATCH 1/3] fix make check errors: replace space with tabs, remove unecessary spaces Andrea Cervesato via ltp
  -- strict thread matches above, loose matches on Subject: below --
2024-08-14 10:00 lufei
2024-08-14 10:00 ` [LTP] [PATCH 2/3] fix make check warnings: use octal permission lufei

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