All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] syscalls/statx05, 07: Move e4crypt, exportfs to tst_test structure
@ 2021-12-01  3:15 Yang Xu
  2021-12-06 12:43 ` Cyril Hrubis
  0 siblings, 1 reply; 5+ messages in thread
From: Yang Xu @ 2021-12-01  3:15 UTC (permalink / raw)
  To: ltp

Also remove duplicated e4crypt metadata info in statx05 description.

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 testcases/kernel/syscalls/statx/statx05.c | 9 ++-------
 testcases/kernel/syscalls/statx/statx07.c | 6 ++++--
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/testcases/kernel/syscalls/statx/statx05.c b/testcases/kernel/syscalls/statx/statx05.c
index a3184e7e3..a948a30b0 100644
--- a/testcases/kernel/syscalls/statx/statx05.c
+++ b/testcases/kernel/syscalls/statx/statx05.c
@@ -10,8 +10,6 @@
  * Test statx syscall with STATX_ATTR_ENCRYPTED flag, setting a key is required
  * for the file to be encrypted by the filesystem.
  *
- * e4crypt is used to set the encrypt flag (currently supported only by ext4).
- *
  * Two directories are tested.
  * First directory has all flags set.
  * Second directory has no flags set.
@@ -110,11 +108,7 @@ static void setup(void)
 	SAFE_MKDIR(TESTDIR_UNFLAGGED, 0777);
 
 	ret = tst_system("echo qwery | e4crypt add_key "TESTDIR_FLAGGED);
-
-	if (WEXITSTATUS(ret) == 127)
-		tst_brk(TCONF, "e4crypt not installed!");
-
-	if (WEXITSTATUS(ret))
+	if (ret)
 		tst_brk(TCONF, "e4crypt failed (CONFIG_EXT4_ENCRYPTION not set?)");
 }
 
@@ -136,6 +130,7 @@ static struct tst_test test = {
 	.dev_fs_type = "ext4",
 	.needs_cmds = (const char *[]) {
 		"mkfs.ext4",
+		"e4crypt",
 		NULL
 	}
 };
diff --git a/testcases/kernel/syscalls/statx/statx07.c b/testcases/kernel/syscalls/statx/statx07.c
index 89de0c487..e1ae36a35 100644
--- a/testcases/kernel/syscalls/statx/statx07.c
+++ b/testcases/kernel/syscalls/statx/statx07.c
@@ -135,8 +135,6 @@ static void setup(void)
 	exported = 1;
 
 	ret = tst_system(cmd);
-	if (WEXITSTATUS(ret) == 127)
-		tst_brk(TCONF | TST_ERR, "%s not found", cmd);
 	if (ret)
 		tst_brk(TBROK | TST_ERR, "failed to exportfs");
 
@@ -172,4 +170,8 @@ static struct tst_test test = {
 	.needs_tmpdir = 1,
 	.dev_fs_type = "nfs",
 	.needs_root = 1,
+	.needs_cmds = (const char *[]) {
+		"exportfs",
+		NULL
+	}
 };
-- 
2.23.0


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

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

* Re: [LTP] [PATCH] syscalls/statx05, 07: Move e4crypt, exportfs to tst_test structure
  2021-12-01  3:15 [LTP] [PATCH] syscalls/statx05, 07: Move e4crypt, exportfs to tst_test structure Yang Xu
@ 2021-12-06 12:43 ` Cyril Hrubis
  2021-12-07  1:44   ` xuyang2018.jy
  2021-12-07  7:56   ` [LTP] [PATCH v2] " Yang Xu
  0 siblings, 2 replies; 5+ messages in thread
From: Cyril Hrubis @ 2021-12-06 12:43 UTC (permalink / raw)
  To: Yang Xu; +Cc: ltp

Hi!
> --- a/testcases/kernel/syscalls/statx/statx05.c
> +++ b/testcases/kernel/syscalls/statx/statx05.c
> @@ -10,8 +10,6 @@
>   * Test statx syscall with STATX_ATTR_ENCRYPTED flag, setting a key is required
>   * for the file to be encrypted by the filesystem.
>   *
> - * e4crypt is used to set the encrypt flag (currently supported only by ext4).

Maybe we should keep the info that it's currently supported on ext4 only
with something as:

* Encrypted files are currently supported by ext4 only.


Other than this it's obviously fine:

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz

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

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

* Re: [LTP] [PATCH] syscalls/statx05, 07: Move e4crypt, exportfs to tst_test structure
  2021-12-06 12:43 ` Cyril Hrubis
@ 2021-12-07  1:44   ` xuyang2018.jy
  2021-12-07  7:56   ` [LTP] [PATCH v2] " Yang Xu
  1 sibling, 0 replies; 5+ messages in thread
From: xuyang2018.jy @ 2021-12-07  1:44 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Hi Cyril
> Hi!
>> --- a/testcases/kernel/syscalls/statx/statx05.c
>> +++ b/testcases/kernel/syscalls/statx/statx05.c
>> @@ -10,8 +10,6 @@
>>    * Test statx syscall with STATX_ATTR_ENCRYPTED flag, setting a key is required
>>    * for the file to be encrypted by the filesystem.
>>    *
>> - * e4crypt is used to set the encrypt flag (currently supported only by ext4).
>
> Maybe we should keep the info that it's currently supported on ext4 only
> with something as:
>
> * Encrypted files are currently supported by ext4 only.
It seems this message refers to e4crypt tools(like xfs filesystem 
xfs_io/xfs_quota command supports foreign mode that can support other 
filesystem.).

e4crypt tools may supports foreign mode in the feature. So I prefer to use
"Using e4crypt to encrypt files are currently supported by ext4 only" 
message.

Best Regards
Yang Xu
>
>
> Other than this it's obviously fine:
>
> Reviewed-by: Cyril Hrubis<chrubis@suse.cz>
>

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

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

* [LTP] [PATCH v2] syscalls/statx05, 07: Move e4crypt, exportfs to tst_test structure
  2021-12-06 12:43 ` Cyril Hrubis
  2021-12-07  1:44   ` xuyang2018.jy
@ 2021-12-07  7:56   ` Yang Xu
  2021-12-08  5:44     ` xuyang2018.jy
  1 sibling, 1 reply; 5+ messages in thread
From: Yang Xu @ 2021-12-07  7:56 UTC (permalink / raw)
  To: ltp

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
v1-v2: keep e4crypt info in statx05 description instead of removing
 testcases/kernel/syscalls/statx/statx05.c | 6 ++----
 testcases/kernel/syscalls/statx/statx07.c | 6 ++++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/testcases/kernel/syscalls/statx/statx05.c b/testcases/kernel/syscalls/statx/statx05.c
index a3184e7e3..86bd3ace1 100644
--- a/testcases/kernel/syscalls/statx/statx05.c
+++ b/testcases/kernel/syscalls/statx/statx05.c
@@ -111,10 +111,7 @@ static void setup(void)
 
 	ret = tst_system("echo qwery | e4crypt add_key "TESTDIR_FLAGGED);
 
-	if (WEXITSTATUS(ret) == 127)
-		tst_brk(TCONF, "e4crypt not installed!");
-
-	if (WEXITSTATUS(ret))
+	if (ret)
 		tst_brk(TCONF, "e4crypt failed (CONFIG_EXT4_ENCRYPTION not set?)");
 }
 
@@ -136,6 +133,7 @@ static struct tst_test test = {
 	.dev_fs_type = "ext4",
 	.needs_cmds = (const char *[]) {
 		"mkfs.ext4",
+		"e4crypt",
 		NULL
 	}
 };
diff --git a/testcases/kernel/syscalls/statx/statx07.c b/testcases/kernel/syscalls/statx/statx07.c
index 89de0c487..e1ae36a35 100644
--- a/testcases/kernel/syscalls/statx/statx07.c
+++ b/testcases/kernel/syscalls/statx/statx07.c
@@ -135,8 +135,6 @@ static void setup(void)
 	exported = 1;
 
 	ret = tst_system(cmd);
-	if (WEXITSTATUS(ret) == 127)
-		tst_brk(TCONF | TST_ERR, "%s not found", cmd);
 	if (ret)
 		tst_brk(TBROK | TST_ERR, "failed to exportfs");
 
@@ -172,4 +170,8 @@ static struct tst_test test = {
 	.needs_tmpdir = 1,
 	.dev_fs_type = "nfs",
 	.needs_root = 1,
+	.needs_cmds = (const char *[]) {
+		"exportfs",
+		NULL
+	}
 };
-- 
2.23.0


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

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

* Re: [LTP] [PATCH v2] syscalls/statx05, 07: Move e4crypt, exportfs to tst_test structure
  2021-12-07  7:56   ` [LTP] [PATCH v2] " Yang Xu
@ 2021-12-08  5:44     ` xuyang2018.jy
  0 siblings, 0 replies; 5+ messages in thread
From: xuyang2018.jy @ 2021-12-08  5:44 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Hi Cyril

Thanks for your review, merged.

Best Regards
Yang Xu
> Reviewed-by: Cyril Hrubis<chrubis@suse.cz>
> Signed-off-by: Yang Xu<xuyang2018.jy@fujitsu.com>
> ---
> v1-v2: keep e4crypt info in statx05 description instead of removing
>   testcases/kernel/syscalls/statx/statx05.c | 6 ++----
>   testcases/kernel/syscalls/statx/statx07.c | 6 ++++--
>   2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/statx/statx05.c b/testcases/kernel/syscalls/statx/statx05.c
> index a3184e7e3..86bd3ace1 100644
> --- a/testcases/kernel/syscalls/statx/statx05.c
> +++ b/testcases/kernel/syscalls/statx/statx05.c
> @@ -111,10 +111,7 @@ static void setup(void)
> 
>   	ret = tst_system("echo qwery | e4crypt add_key "TESTDIR_FLAGGED);
> 
> -	if (WEXITSTATUS(ret) == 127)
> -		tst_brk(TCONF, "e4crypt not installed!");
> -
> -	if (WEXITSTATUS(ret))
> +	if (ret)
>   		tst_brk(TCONF, "e4crypt failed (CONFIG_EXT4_ENCRYPTION not set?)");
>   }
> 
> @@ -136,6 +133,7 @@ static struct tst_test test = {
>   	.dev_fs_type = "ext4",
>   	.needs_cmds = (const char *[]) {
>   		"mkfs.ext4",
> +		"e4crypt",
>   		NULL
>   	}
>   };
> diff --git a/testcases/kernel/syscalls/statx/statx07.c b/testcases/kernel/syscalls/statx/statx07.c
> index 89de0c487..e1ae36a35 100644
> --- a/testcases/kernel/syscalls/statx/statx07.c
> +++ b/testcases/kernel/syscalls/statx/statx07.c
> @@ -135,8 +135,6 @@ static void setup(void)
>   	exported = 1;
> 
>   	ret = tst_system(cmd);
> -	if (WEXITSTATUS(ret) == 127)
> -		tst_brk(TCONF | TST_ERR, "%s not found", cmd);
>   	if (ret)
>   		tst_brk(TBROK | TST_ERR, "failed to exportfs");
> 
> @@ -172,4 +170,8 @@ static struct tst_test test = {
>   	.needs_tmpdir = 1,
>   	.dev_fs_type = "nfs",
>   	.needs_root = 1,
> +	.needs_cmds = (const char *[]) {
> +		"exportfs",
> +		NULL
> +	}
>   };

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

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

end of thread, other threads:[~2021-12-08  5:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01  3:15 [LTP] [PATCH] syscalls/statx05, 07: Move e4crypt, exportfs to tst_test structure Yang Xu
2021-12-06 12:43 ` Cyril Hrubis
2021-12-07  1:44   ` xuyang2018.jy
2021-12-07  7:56   ` [LTP] [PATCH v2] " Yang Xu
2021-12-08  5:44     ` xuyang2018.jy

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.