2021-02-03 12:57:20 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
2021-02-04 21:40:55 +01:00
|
|
|
FTPL="${FAKETIME_TESTLIB:-../src/libfaketime.so.1}"
|
|
|
|
|
|
2021-02-22 22:37:33 -05:00
|
|
|
set -e
|
|
|
|
|
|
2021-02-03 12:57:20 -05:00
|
|
|
error=0
|
|
|
|
|
|
2021-02-25 21:56:51 -05:00
|
|
|
repeat3x5="$(FAKERANDOM_SEED=0xDEADBEEFDEADBEEF LD_PRELOAD="$FTPL" ./repeat_random 3 5)"
|
|
|
|
|
repeat5x3="$(FAKERANDOM_SEED=0xDEADBEEFDEADBEEF LD_PRELOAD="$FTPL" ./repeat_random 5 3)"
|
2021-02-24 15:24:45 -05:00
|
|
|
|
2021-02-25 21:56:51 -05:00
|
|
|
if [ "$repeat3x5" != "$repeat5x3" ]; then
|
|
|
|
|
error=1
|
|
|
|
|
printf >&2 '5 calls of getrandom(3) got %s\n3 calls of getrandom(5) got %s\n' "$repeat3x5" "$repeat5x3"
|
2021-02-24 15:24:45 -05:00
|
|
|
fi
|
|
|
|
|
|
2021-02-03 12:57:20 -05:00
|
|
|
if [ 0 = $error ]; then
|
|
|
|
|
printf 'getrandom interception test successful.\n'
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
exit $error
|