mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
common/encrypt: introduce helpers for set_encpolicy and get_encpolicy
For conciseness in tests, add helper functions that wrap the xfs_io commands 'set_encpolicy' and 'get_encpolicy'. Then update all encryption tests to use them. Signed-off-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
+1
-2
@@ -33,7 +33,6 @@ rm -f $seqres.full
|
||||
_supported_fs ext4
|
||||
_supported_os Linux
|
||||
_require_scratch_encryption
|
||||
_require_xfs_io_command "set_encpolicy"
|
||||
_require_command "$KEYCTL_PROG" keyctl
|
||||
|
||||
_new_session_keyring
|
||||
@@ -55,7 +54,7 @@ _scratch_mkfs_encrypted &>>$seqres.full
|
||||
_scratch_mount
|
||||
mkdir $SCRATCH_MNT/edir
|
||||
keydesc=$(_generate_encryption_key)
|
||||
$XFS_IO_PROG -c "set_encpolicy $keydesc" $SCRATCH_MNT/edir
|
||||
_set_encpolicy $SCRATCH_MNT/edir $keydesc
|
||||
echo foo > $SCRATCH_MNT/edir/file
|
||||
inum=$(stat -c '%i' $SCRATCH_MNT/edir/file)
|
||||
_scratch_unmount
|
||||
|
||||
Reference in New Issue
Block a user