Skip to contentSkip to conversation

generic/421: stop test from hanging on buggy kernels

PATCH In review Eric Biggers 2 participants 2 messages Jul 19, 2017 – Jul 24, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generic/421: stop test from hanging on buggy kernels

From: Eric Biggers <[email protected]>

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.

---
 tests/generic/421 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/generic/421 +1 -1
index 1b2f66f9..9ab48d47 100755
@@ -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
Signature · 1 line
2.14.0.rc0.284.gd933b75aa4-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Eric Biggers

From: Eric Biggers <[email protected]>

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.

Look fine

Quoted 24 lines
---
 tests/generic/421 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/generic/421 +1 -1
index 1b2f66f9..9ab48d47 100755
@@ -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
Signature · 6 lines
2.14.0.rc0.284.gd933b75aa4-goog

--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Carlos