]> the.earth.li Git - onak.git/blob - t/all-050-get-hash.t
Cleanup tests to be able to run from a different directory
[onak.git] / t / all-050-get-hash.t
1 #!/bin/sh
2 # Check we can index a key by SKS hash
3
4 set -e
5
6 # Backends should really support this, but the file one is as simple as
7 # possible, so doesn't. Skip the test for it.
8 if [ "$2" = "file" ]; then
9         exit 0
10 fi
11
12 cd ${WORKDIR}
13 ${BUILDDIR}/onak -b -c $1 add < ${TESTSDIR}/../keys/noodles.key
14 if ! ${BUILDDIR}/onak -c $1 hget 81929DAE08B8F80888DA524923B93067 2> /dev/null | \
15         grep -q -- '-----BEGIN PGP PUBLIC KEY BLOCK-----'; then
16         echo "* Did not correctly retrieve key by text"
17         exit 1
18 fi
19
20 exit 0