generic/421: stop test from hanging on buggy kernels
authorEric Biggers <ebiggers@google.com>
Wed, 19 Jul 2017 20:35:51 +0000 (13:35 -0700)
committerEryu Guan <eguan@redhat.com>
Thu, 20 Jul 2017 03:14:56 +0000 (11:14 +0800)
On some buggy kernels, the 'find' command in generic/421 encounters
a "Permission denied" error when trying to search $dir, so it
doesn't find the file it's supposed to.  This causes 'cat' to read
from stdin, hanging the test.  Quote the argument to cat to make the
test fail right away rather than hanging.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tests/generic/421

index 1b2f66f9fd262ef42259ee595c73fdda001b1f65..9ab48d478b801ea0508d45614f757ddba730f98a 100755 (executable)
@@ -98,7 +98,7 @@ keyid=$(_revoke_encryption_key $keydesc)
 # ciphertext on key revocation.  Therefore, the name of the file we're opening
 # here may be in either plaintext or ciphertext depending on the kernel version,
 # and ciphertext names are unpredictable anyway, so just use 'find' to find it.
-cat $(find $dir -type f) > /dev/null
+cat "$(find $dir -type f)" > /dev/null
 
 # Wait for readers to exit
 touch $tmp.done