]> the.earth.li Git - onak.git/blob - t/all-046-index-64bit-dupe.t
0.6.2 release
[onak.git] / t / all-046-index-64bit-dupe.t
1 #!/bin/sh
2 # Check we can index a key by some uid text
3
4 set -e
5
6 # Backends should really support storing keys with full fingerprints,
7 # but the file + fs backends only do 64 bit keys IDs for simplicity.
8 # Skip the test for them.
9 if [ "$2" = "file" -o "$2" = "fs" ]; then
10         exit 0
11 fi
12
13 cd ${WORKDIR}
14 # Import 2 keys with the same 64 bit key ID
15 ${BUILDDIR}/onak -b -c $1 add < ${TESTSDIR}/../keys/DDA252EBB8EBE1AF-1.key
16 ${BUILDDIR}/onak -b -c $1 add < ${TESTSDIR}/../keys/DDA252EBB8EBE1AF-2.key
17 # Add an extra key so we know we're not just returning all of them
18 ${BUILDDIR}/onak -b -c $1 add < ${TESTSDIR}/../keys/noodles.key
19 c=$(${BUILDDIR}/onak -c $1 index 0xDDA252EBB8EBE1AF 2> /dev/null | \
20                 grep -c -- '^pub   ')
21 if [ $c != 2 ]; then
22         echo "* Did not correctly retrieve keys with duplicate 64-bit keyids"
23         exit 1
24 fi
25
26 exit 0