- echo 'Verify me. This is my signature.' > signature
- testsuccess --nomsg aptkey --quiet --keyring keys/marvinparanoid.pub --secret-keyring keys/marvinparanoid.sec --readonly \
- adv --batch --yes --default-key 'Marvin' --armor --detach-sign --sign --output signature.gpg signature
+ echo 'Verify me. This is my signature.' > "$SIGNATURE"
+ echo 'lalalalala' > "${SIGNATURE}2"
+ testsuccess --nomsg aptkey --quiet --keyring "${KEYDIR}/marvinparanoid.pub" --secret-keyring "${KEYDIR}/marvinparanoid.sec" --readonly \
+ adv --batch --yes --default-key 'Marvin' --armor --detach-sign --sign --output "${SIGNATURE}.gpg" "${SIGNATURE}"
+ testsuccess test -s "${SIGNATURE}.gpg" -a -s "${SIGNATURE}"
+
+ msgtest 'Test verify a file' 'with no sig'
+ testfailure --nomsg aptkey --quiet --readonly --keyring "${KEYDIR}/testcase-multikey.pub" verify "${SIGNATURE}" "${SIGNATURE}2"
+
+ for GPGV in '' 'gpgv' 'gpgv2'; do
+ echo "APT::Key::GPGVCommand \"$GPGV\";" > "${ROOTDIR}/etc/apt/apt.conf.d/00gpgvcmd"
+
+ msgtest 'Test verify a file' 'with all keys'
+ testsuccess --nomsg aptkey --quiet --readonly verify "${SIGNATURE}.gpg" "${SIGNATURE}"
+
+ msgtest 'Test verify a file' 'with good keyring'
+ testsuccess --nomsg aptkey --quiet --readonly --keyring "${KEYDIR}/testcase-multikey.pub" verify "${SIGNATURE}.gpg" "${SIGNATURE}"
+
+ msgtest 'Test fail verify a file' 'with bad keyring'
+ testfailure --nomsg aptkey --quiet --readonly --keyring "${KEYDIR}/joesixpack.pub" verify "${SIGNATURE}.gpg" "${SIGNATURE}"