Skip to content

Commit 05443ce

Browse files
oech3pixelb
authored andcommitted
tests: shuf: ensure we handle unsupported getrandom syscall gracefully
* tests/shuf/shuf.sh: Check we fail normally or succeed where the getrandom syscall is not available. #205
1 parent 46aef09 commit 05443ce

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎tests/shuf/shuf.sh‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
2020
print_ver_ shuf
2121
getlimits_
22+
uses_strace_
23+
24+
# Ensure we handle unsupported getrandom syscall gracefully
25+
strace -o /dev/null -e inject=getrandom:error=ENOSYS shuf -i 1-9
26+
ret=$?
27+
test $? = 0 || test $? = 1 || fail=1
2228

2329
# ensure randomization doesn't depend solely on ASLR
2430
# This is a probabilistic test :-)

0 commit comments

Comments
 (0)