diff mbox series

[08/12] fstests: properly test for v1 encryption policies in encrypt tests

Message ID c77a1a8ca09b2738f432d586177801a579a775e4.1696969376.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series fstests: fscrypt test updates | expand

Commit Message

Josef Bacik Oct. 10, 2023, 8:26 p.m. UTC
With btrfs adding fscrypt support we're limiting the usage to plain v2
policies only.  This means we need to update the _require's for
generic/593 that tests both v1 and v2 policies.  The other sort of tests
will be split into two tests in later patches.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 common/encrypt    | 2 ++
 tests/generic/593 | 1 +
 2 files changed, 3 insertions(+)

Comments

Eric Biggers Oct. 17, 2023, 5:37 a.m. UTC | #1
On Tue, Oct 10, 2023 at 04:26:01PM -0400, Josef Bacik wrote:
> With btrfs adding fscrypt support we're limiting the usage to plain v2
> policies only.  This means we need to update the _require's for
> generic/593 that tests both v1 and v2 policies.  The other sort of tests
> will be split into two tests in later patches.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> ---
>  common/encrypt    | 2 ++
>  tests/generic/593 | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/common/encrypt b/common/encrypt
> index 1372af66..120ca612 100644
> --- a/common/encrypt
> +++ b/common/encrypt
> @@ -59,6 +59,8 @@ _require_scratch_encryption()
>  	# policy required by the test.
>  	if [ $# -ne 0 ]; then
>  		_require_encryption_policy_support $SCRATCH_MNT "$@"
> +	else
> +		_require_encryption_policy_support $SCRATCH_MNT -v 1
>  	fi

I guess this is okay for a start, but even after the test splits that this
patchset does, this will result in quite a few of the encrypt tests being
skipped on btrfs: generic/{395-399,419,429,435,440}.

I'm hoping that we can migrate most of them to support a v2-only world.  I'm not
sure what the best way to go about it would be.  I suppose one option would be
to just make copies of them and change those copies to test v2 instead of v1...
We could then consider removing or stripping down the v1 tests as appropriate.

- Eric
Anand Jain Nov. 1, 2023, 11:33 a.m. UTC | #2
On 11/10/2023 04:26, Josef Bacik wrote:
> With btrfs adding fscrypt support we're limiting the usage to plain v2
> policies only.  This means we need to update the _require's for
> generic/593 that tests both v1 and v2 policies.  The other sort of tests
> will be split into two tests in later patches.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> ---

For now this looks good;

Reviewed-by: Anand Jain <anand.jain@oracle.com>

Thanks, Anand
diff mbox series

Patch

diff --git a/common/encrypt b/common/encrypt
index 1372af66..120ca612 100644
--- a/common/encrypt
+++ b/common/encrypt
@@ -59,6 +59,8 @@  _require_scratch_encryption()
 	# policy required by the test.
 	if [ $# -ne 0 ]; then
 		_require_encryption_policy_support $SCRATCH_MNT "$@"
+	else
+		_require_encryption_policy_support $SCRATCH_MNT -v 1
 	fi
 
 	_scratch_unmount
diff --git a/tests/generic/593 b/tests/generic/593
index 2dda5d76..7907236c 100755
--- a/tests/generic/593
+++ b/tests/generic/593
@@ -17,6 +17,7 @@  _begin_fstest auto quick encrypt
 
 # real QA test starts here
 _supported_fs generic
+_require_scratch_encryption -v 1
 _require_scratch_encryption -v 2
 _require_command "$KEYCTL_PROG" keyctl