summaryrefslogtreecommitdiff
path: root/test/randomtest.sh
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2021-02-25 21:51:46 -0500
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2021-02-25 23:17:25 -0500
commita5885f1479d482d201f5d2a400073d177eb8687d (patch)
treef298a50f5fdc2b3a3939a10fa0ebe76027a32593 /test/randomtest.sh
parent0872c6c0c08c2483cf2c06e3ce2400ea3fe17144 (diff)
downloadlibfaketime-a5885f1479d482d201f5d2a400073d177eb8687d.tar.gz
Drop more duplicative tests
Now that we have the snippet-driven test_variable_data suite, most of the other longer hand-written tests are duplicative.
Diffstat (limited to 'test/randomtest.sh')
-rwxr-xr-xtest/randomtest.sh28
1 files changed, 0 insertions, 28 deletions
diff --git a/test/randomtest.sh b/test/randomtest.sh
index 052510b..6509c79 100755
--- a/test/randomtest.sh
+++ b/test/randomtest.sh
@@ -6,34 +6,6 @@ set -e
error=0
-for iface in getrandom getentropy; do
- printf "Testing %s() interception...\n" "$iface"
-
- "./${iface}_test" > "${iface}.alone"
- LD_PRELOAD="$FTPL" "./${iface}_test" > "${iface}.preload"
- FAKERANDOM_SEED=0x12345678DEADBEEF LD_PRELOAD="$FTPL" "./${iface}_test" > "${iface}.preload.seed0"
- FAKERANDOM_SEED=0x12345678DEADBEEF LD_PRELOAD="$FTPL" "./${iface}_test" > "${iface}.preload.seed1"
- FAKERANDOM_SEED=0x0000000000000000 LD_PRELOAD="$FTPL" "./${iface}_test" > "${iface}.preload.seed2"
-
- if diff -u "${iface}.alone" "${iface}.preload" > /dev/null; then
- error=1
- printf >&2 '%s() without the LD_PRELOAD matches a run without LD_PRELOAD\n' "$iface"
- fi
- if diff -u "${iface}.preload" "${iface}.preload.seed0" > /dev/null; then
- error=2
- printf >&2 '%s() without a seed produced the same data as a run with a seed!\n' "$iface"
- fi
- if ! diff -u "${iface}.preload.seed0" "${iface}.preload.seed1"; then
- error=3
- printf >&2 '%s() with identical seeds differed!\n' "$iface"
- fi
- if diff -u "${iface}.preload.seed1" "${iface}.preload.seed2" >/dev/null; then
- error=4
- printf >&2 '%s() with different seeds produced the same data!\n' "$iface"
- fi
- rm -f "${iface}.alone" "${iface}.preload" "${iface}.preload.seed0" "${iface}.preload.seed1" "${iface}.preload.seed2"
-done
-
FAKERANDOM_SEED=0xDEADBEEFDEADBEEF LD_PRELOAD="$FTPL" ./repeat_random 3 5 > repeat3x5
FAKERANDOM_SEED=0xDEADBEEFDEADBEEF LD_PRELOAD="$FTPL" ./repeat_random 5 3 > repeat5x3