]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic/398: Accept failing with EPERM in addition to ENOKEY for rename without key
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Wed, 7 Jun 2017 08:20:46 +0000 (10:20 +0200)
committerEryu Guan <eguan@redhat.com>
Thu, 8 Jun 2017 02:53:27 +0000 (10:53 +0800)
Some filesystems (e.g. UBIFS) fail with EPERM when trying to move a
file into an encrypted directory via cross rename, without having
access to the encryption key.

Since rename is perfectly allowed to return EPERM, which is also
tested for, and no precise specification seems to exist that
clarifies when to expect EPERM and when ENOKEY, this patch modifies
the generic/398 test to accept both, for the test case where the key
is not available.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tests/generic/398
tests/generic/398.out

index b486b9c5211b7bed94ab3a8af8a267b06612ceb2..f283193b7be95f05b224771a931c3d3fce8ae025 100755 (executable)
@@ -43,6 +43,12 @@ _cleanup()
        rm -f $tmp.*
 }
 
+filter_enokey()
+{
+       # rename without key can also fail with EPERM instead of ENOKEY
+       sed -e "s/Required key not available/Operation not permitted/g"
+}
+
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
@@ -149,9 +155,9 @@ efile1=$(find $edir1 -type f)
 efile2=$(find $edir2 -type f)
 
 echo -e "\n\n*** Exchange encrypted <=> encrypted without key ***"
-src/renameat2 -x $efile1 $efile2
+src/renameat2 -x $efile1 $efile2 |& filter_enokey
 echo -e "\n*** Exchange encrypted <=> unencrypted without key ***"
-src/renameat2 -x $efile1 $udir/ufile
+src/renameat2 -x $efile1 $udir/ufile |& filter_enokey
 
 # success, all done
 status=0
index 8e08270deabb75da687c6b6dc4293871f5fc53f6..f92748782b3e1ad75615b4b2b58f562766335ca5 100644 (file)
@@ -39,7 +39,7 @@ Operation not permitted
 
 
 *** Exchange encrypted <=> encrypted without key ***
-Required key not available
+Operation not permitted
 
 *** Exchange encrypted <=> unencrypted without key ***
-Required key not available
+Operation not permitted