generic: test enforcement of one encryption policy per tree

Add an xfstest which verifies that the filesystem forbids operations
that would violate the constraint that all files in an encrypted
directory tree use the same encryption policy.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Eric Biggers
2016-12-15 12:26:24 -08:00
committed by Eryu Guan
parent 758175fad3
commit 0f7a979130
3 changed files with 204 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
QA output created by 398
*** Link encrypted <= encrypted ***
ln: failed to create hard link 'SCRATCH_MNT/edir2/efile1' => 'SCRATCH_MNT/edir1/efile1': Operation not permitted
*** Rename encrypted => encrypted ***
mv: cannot move 'SCRATCH_MNT/edir1/efile1' to 'SCRATCH_MNT/edir2/efile1': Operation not permitted
*** Link unencrypted <= encrypted ***
ln: failed to create hard link 'SCRATCH_MNT/edir1/ufile' => 'SCRATCH_MNT/udir/ufile': Operation not permitted
*** Rename unencrypted => encrypted ***
mv: cannot move 'SCRATCH_MNT/udir/ufile' to 'SCRATCH_MNT/edir1/ufile': Operation not permitted
*** Link encrypted <= unencrypted ***
'SCRATCH_MNT/udir/efile1' => 'SCRATCH_MNT/edir1/efile1'
*** Rename encrypted => unencrypted ***
'SCRATCH_MNT/edir1/efile1' -> 'SCRATCH_MNT/udir/efile1'
*** Exchange encrypted <=> encrypted ***
Operation not permitted
*** Exchange unencrypted <=> encrypted ***
Operation not permitted
*** Exchange encrypted <=> unencrypted ***
Operation not permitted
*** Special file tests ***
'SCRATCH_MNT/edir1/fifo' -> 'SCRATCH_MNT/edir2/fifo'
'SCRATCH_MNT/edir2/fifo' -> 'SCRATCH_MNT/udir/fifo'
'SCRATCH_MNT/udir/fifo' -> 'SCRATCH_MNT/edir1/fifo'
'SCRATCH_MNT/edir2/fifo' => 'SCRATCH_MNT/edir1/fifo'
*** Exchange encrypted <=> encrypted without key ***
Operation not permitted
*** Exchange encrypted <=> unencrypted without key ***
Operation not permitted