summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authortv <tv@nomic.retiolum>2013-09-02 18:08:09 +0200
committertv <tv@nomic.retiolum>2013-09-02 18:08:09 +0200
commit352a8ccb2f1a802eb9d15c9851e716bd9454c589 (patch)
tree2f42ae538b34f67be5ba267d1f063aa422f57424 /util
parenta64c7ab3ae6a105b4bcbf76299eca2270e916a0b (diff)
util t anonbox: add basic bit rot test
Diffstat (limited to 'util')
-rwxr-xr-xutil/t/anonbox.net/got-some-valid-looking-email16
1 files changed, 16 insertions, 0 deletions
diff --git a/util/t/anonbox.net/got-some-valid-looking-email b/util/t/anonbox.net/got-some-valid-looking-email
new file mode 100755
index 00000000..4c3e7a11
--- /dev/null
+++ b/util/t/anonbox.net/got-some-valid-looking-email
@@ -0,0 +1,16 @@
+#! /bin/sh
+set -euf
+
+tempfile=`mktemp /tmp/test.XXXXXXXX`
+trap "rm -f $tempfile" EXIT INT
+
+anonbox.net >$tempfile
+. $tempfile
+
+{
+ echo $email
+} | {
+ IFS=@. read _logname subdomain domain
+
+ echo "$uri" | grep -q "^https://$domain/$subdomain/[0-9a-f]*/$"
+}