]> the.earth.li Git - onak.git/commitdiff
Add test for blacklisting functionality
authorJonathan McDowell <noodles@earth.li>
Wed, 21 Aug 2019 19:07:09 +0000 (20:07 +0100)
committerJonathan McDowell <noodles@earth.li>
Wed, 21 Aug 2019 19:07:09 +0000 (20:07 +0100)
t/all-035-blacklist-test.t [new file with mode: 0755]

diff --git a/t/all-035-blacklist-test.t b/t/all-035-blacklist-test.t
new file mode 100755 (executable)
index 0000000..8a6fb4d
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+# Check trying to submit a blacklisted key fails
+
+set -e
+
+cd ${WORKDIR}
+echo 0E3A94C3E83002DAB88CCA1694FA372B2DA8B985 > ${WORKDIR}/blacklist
+${BUILDDIR}/onak -b -c $1 add < ${TESTSDIR}/../keys/noodles.key || true
+echo '#' >  ${WORKDIR}/blacklist
+if ! ${BUILDDIR}/onak -c $1 get 0x94FA372B2DA8B985 2>&1 | \
+       grep -q 'Key not found'; then
+       echo "* Did not correctly error on non-existent key"
+       exit 1
+fi
+
+exit 0