FS/XFS testing framework
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: fstests@vger.kernel.org
Cc: "Theodore Ts'o" <tytso@mit.edu>
Subject: [PATCH 2/4] generic/556: add a check to make sure ext4 supports encrypted casefolding
Date: Wed, 20 Jul 2022 12:43:54 -0400	[thread overview]
Message-ID: <20220720164356.4078789-3-tytso@mit.edu> (raw)
In-Reply-To: <20220720164356.4078789-1-tytso@mit.edu>

Some older kernels support ext4 file systems with encryption enabled,
and with casefold enabled, but not file systems have both encryption
*and* casefolding enabled.  On those kernels, generic/556 will fail.
Fortunately, we can test if ext4 supports encrypted casefold via the
presence of /sys/fs/ext4/features/encrypted_casefold.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 common/casefold   | 17 +++++++++++++++++
 tests/generic/556 |  1 +
 2 files changed, 18 insertions(+)

diff --git a/common/casefold b/common/casefold
index d9126f4c..e3e89508 100644
--- a/common/casefold
+++ b/common/casefold
@@ -43,6 +43,23 @@ _require_scratch_casefold()
 	_require_command "$LSATTR_PROG" lsattr
 }
 
+_require_encrypted_casefold ()
+{
+    case $FSTYP in
+	ext4)
+	    if test ! -f /sys/fs/ext4/features/casefold ; then
+		_notrun "casefolding not supported"
+	    fi
+	    if test ! -f /sys/fs/ext4/features/encryption ; then
+		_notrun "file system encryption not supported"
+	    fi
+	    if test ! -f /sys/fs/ext4/features/encrypted_casefold ; then
+		_notrun "encrypted casefolding not supported"
+	    fi
+	    ;;
+	esac
+}
+
 _scratch_mkfs_casefold()
 {
 	case $FSTYP in
diff --git a/tests/generic/556 b/tests/generic/556
index 404a3243..80563502 100755
--- a/tests/generic/556
+++ b/tests/generic/556
@@ -13,6 +13,7 @@ _begin_fstest auto quick casefold
 . ./common/attr
 
 _supported_fs generic
+_require_encrypted_casefold
 _require_scratch_nocheck
 _require_scratch_casefold
 _require_symlinks
-- 
2.31.0


  parent reply	other threads:[~2022-07-20 16:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-20 16:43 [PATCH 0/4] fstests: more random fixes from Ted Theodore Ts'o
2022-07-20 16:43 ` [PATCH 1/4] report: add support for the xunit-quiet format Theodore Ts'o
2022-07-20 18:35   ` Darrick J. Wong
2022-07-20 16:43 ` Theodore Ts'o [this message]
2022-07-21  2:40   ` [PATCH 2/4] generic/556: add a check to make sure ext4 supports encrypted casefolding Eric Biggers
2022-07-20 16:43 ` [PATCH 3/4] dmflakey: don't run dmflakey tests with an external log device Theodore Ts'o
2022-07-20 17:35   ` Darrick J. Wong
2022-07-20 16:43 ` [PATCH 4/4] generic/475: skip test when using " Theodore Ts'o
2022-07-20 18:29   ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220720164356.4078789-3-tytso@mit.edu \
    --to=tytso@mit.edu \
    --cc=fstests@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox