diff mbox series

[12/12] fstest: add a fsstress+fscrypt test

Message ID 936037a6c2bcf5553145862c5358e175621983b0.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
I noticed we don't run fsstress with fscrypt in any of our tests, and
this was helpful in uncovering a couple of symlink related corner cases
for the btrfs support work.  Add a basic test that creates a encrypted
directory and runs fsstress in that directory.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 tests/generic/736     | 38 ++++++++++++++++++++++++++++++++++++++
 tests/generic/736.out |  3 +++
 2 files changed, 41 insertions(+)
 create mode 100644 tests/generic/736
 create mode 100644 tests/generic/736.out

Comments

Eric Biggers Oct. 17, 2023, 5:23 a.m. UTC | #1
On Tue, Oct 10, 2023 at 04:26:05PM -0400, Josef Bacik wrote:
> I noticed we don't run fsstress with fscrypt in any of our tests, and
> this was helpful in uncovering a couple of symlink related corner cases
> for the btrfs support work.  Add a basic test that creates a encrypted
> directory and runs fsstress in that directory.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> ---
>  tests/generic/736     | 38 ++++++++++++++++++++++++++++++++++++++
>  tests/generic/736.out |  3 +++
>  2 files changed, 41 insertions(+)
>  create mode 100644 tests/generic/736
>  create mode 100644 tests/generic/736.out

This might be worth adding, but the way this sort of thing is tested on other
filesystems is through implementing the test_dummy_encryption mount option and
then doing a full run of xfstests with test_dummy_encryption enabled.  That's
more comprehensive than just running fsstress.

- Eric
Anand Jain Nov. 7, 2023, 10:12 a.m. UTC | #2
On 10/11/23 04:26, Josef Bacik wrote:
> I noticed we don't run fsstress with fscrypt in any of our tests, and
> this was helpful in uncovering a couple of symlink related corner cases
> for the btrfs support work.  Add a basic test that creates a encrypted
> directory and runs fsstress in that directory.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Looks good.

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

Patch

diff --git a/tests/generic/736 b/tests/generic/736
new file mode 100644
index 00000000..0ef37d7e
--- /dev/null
+++ b/tests/generic/736
@@ -0,0 +1,38 @@ 
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright 2023 Meta
+#
+# FS QA Test No. generic/5736
+#
+# Run fscrypt on an encrypted directory
+#
+
+. ./common/preamble
+_begin_fstest auto quick encrypt
+echo
+
+# Import common functions.
+. ./common/filter
+. ./common/encrypt
+
+# real QA test starts here
+_supported_fs generic
+_require_scratch_encryption -v 2
+
+_scratch_mkfs_encrypted &>> $seqres.full
+_scratch_mount
+
+dir=$SCRATCH_MNT/dir
+mkdir $dir
+
+_set_encpolicy $dir $TEST_KEY_IDENTIFIER
+_add_enckey $SCRATCH_MNT "$TEST_RAW_KEY"
+
+args=$(_scale_fsstress_args -p 4 -n 10000 -p 2 $FSSTRESS_AVOID -d $dir)
+echo "Run fsstress $args" >>$seqres.full
+
+$FSSTRESS_PROG $args >> $seqres.full
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/736.out b/tests/generic/736.out
new file mode 100644
index 00000000..022754df
--- /dev/null
+++ b/tests/generic/736.out
@@ -0,0 +1,3 @@ 
+QA output created by 736
+
+Added encryption key with identifier 69b2f6edeee720cce0577937eb8a6751