X-Git-Url: http://the.earth.li/gitweb/?a=blobdiff_plain;f=t%2Fall-046-index-64bit-dupe.t;fp=t%2Fall-046-index-64bit-dupe.t;h=23b326f8ce3f1db95ac299dc78882069925f84f6;hb=fd9ca85878543771a7f09afd821a5a5511e71aea;hp=0000000000000000000000000000000000000000;hpb=d1b4ba940d6bed575b40ac1026514c0b97d5128b;p=onak.git diff --git a/t/all-046-index-64bit-dupe.t b/t/all-046-index-64bit-dupe.t new file mode 100755 index 0000000..23b326f --- /dev/null +++ b/t/all-046-index-64bit-dupe.t @@ -0,0 +1,26 @@ +#!/bin/sh +# Check we can index a key by some uid text + +set -e + +# Backends should really support storing keys with full fingerprints, +# but the file + fs backends only do 64 bit keys IDs for simplicity. +# Skip the test for them. +if [ "$2" = "file" -o "$2" = "fs" ]; then + exit 0 +fi + +cd ${WORKDIR} +# Import 2 keys with the same 64 bit key ID +${BUILDDIR}/onak -b -c $1 add < ${TESTSDIR}/../keys/DDA252EBB8EBE1AF-1.key +${BUILDDIR}/onak -b -c $1 add < ${TESTSDIR}/../keys/DDA252EBB8EBE1AF-2.key +# Add an extra key so we know we're not just returning all of them +${BUILDDIR}/onak -b -c $1 add < ${TESTSDIR}/../keys/noodles.key +c=$(${BUILDDIR}/onak -c $1 index 0xDDA252EBB8EBE1AF 2> /dev/null | \ + grep -c -- '^pub ') +if [ $c != 2 ]; then + echo "* Did not correctly retrieve keys with duplicate 64-bit keyids" + exit 1 +fi + +exit 0