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

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



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@xxxxxxxxxxxxxx>
---
 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

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
-- 
2.41.0




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux