aboutsummaryrefslogtreecommitdiff
path: root/test.sh
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-07-27 14:16:17 +1200
committerDavid Phillips <david@sighup.nz>2017-07-27 14:16:17 +1200
commit8df5d237856d365a7a49835274e58e8c8bb281b1 (patch)
tree2973898cdff4fd9d4e4e5acf69b97221c879bfb9 /test.sh
parent92d9e59d6b3dc5375c100c72ba8907502aea8331 (diff)
downloadsand-leek-8df5d237856d365a7a49835274e58e8c8bb281b1.tar.xz
Add more tests, pull simple test runner from other project
Diffstat (limited to 'test.sh')
-rwxr-xr-xtest.sh34
1 files changed, 0 insertions, 34 deletions
diff --git a/test.sh b/test.sh
deleted file mode 100755
index 2b24176..0000000
--- a/test.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-
-set -e
-
-key="$(mktemp)"
-stderr="$(mktemp)"
-
-# Four character search should be a < 1 second CPU burst for CI runner
-./sand-leek -s site > $key 2>$stderr
-
-found="$(tr '\r' '\n' < $stderr | grep Found | cut -d ' ' -f 2)"
-
-echo "sand-leek says it found $found..."
-
-# Trick adapted to py3 from https://swehack.org/viewtopic.php?f=37&p=6978
-real="$( \
- openssl rsa -in $key -pubout -outform DER \
- | tail -c +23 \
- | shasum \
- | head -c 20 \
- | python -c "import base64,sys,codecs; print(base64.b32encode(codecs.decode(sys.stdin.readline().strip('\n'), 'hex')).decode().lower())").onion"
-
-
-echo "Key analysis shows it's for ${real}"
-
-if [ "$found" = "$real" ] ; then
- echo "It's a match, I'm happy"
- rm $key
- rm $stderr
- exit 0
-else
- echo "Error: No match"
- exit 1
-fi