# along with this file; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-if ENABLE_OPENPGP
-
EXTRA_DIST = ca-public.gpg srv-public-all-signed.gpg srv-secret.gpg \
ca-secret.gpg srv-public.gpg srv-public-127.0.0.1-signed.gpg \
- srv-public-localhost-signed.gpg selfsigs/alice-mallory-badsig18.pub \
- selfsigs/alice-mallory-irrelevantsig.pub selfsigs/alice-mallory-nosig18.pub \
- selfsigs/alice.pub
+ srv-public-localhost-signed.gpg \
+ selfsigs/alice-mallory-badsig18.pub \
+ selfsigs/alice-mallory-irrelevantsig.pub \
+ selfsigs/alice-mallory-nosig18.pub selfsigs/alice.pub
+
+dist_check_SCRIPTS = testselfsigs testcerts
+if ENABLE_OPENPGP
# The selftest is disabled until we can make it work under Wine and
-# under Debian buildds (problem with 127.0.0.2?). Just extra-dist it
-# for now.
-EXTRA_DIST += testcerts testselfsigs
-dist_check_SCRIPTS = testselfsigs #testcerts
+# under Debian buildds (problem with 127.0.0.2?).
TESTS = testselfsigs #testcerts
-
endif
+
+TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT)
-#!/bin/bash
+#!/bin/sh
# Copyright (C) 2010 Free Software Foundation, Inc.
#
# along with GNUTLS; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+set -e
+
srcdir="${srcdir:-.}"
-CERTTOOL="${certtool:-../../src/certtool} -q"
+CERTTOOL="${CERTTOOL:-../../src/certtool$EXEEXT}"
+
unset RETCODE
fail() {
echo "Checking OpenPGP certificate self verification"
-( $CERTTOOL --pgp-certificate-info <$srcdir/selfsigs/alice.pub | grep -e "^Self Signature verification: ok" ) >/dev/null ||
- fail "Self sig Verification should have succeeded!"
+($CERTTOOL --pgp-certificate-info < $srcdir/selfsigs/alice.pub \
+ | grep "^Self Signature verification: ok" > /dev/null) || \
+ fail "Self sig Verification should have succeeded!"
+
+($CERTTOOL --pgp-certificate-info < $srcdir/selfsigs/alice-mallory-badsig18.pub \
+ | grep "^Self Signature verification: failed" > /dev/null) || \
+ fail "Self sig Verification should have failed!"
+
+($CERTTOOL --pgp-certificate-info < $srcdir/selfsigs/alice-mallory-irrelevantsig.pub \
+ | grep "^Self Signature verification: failed" >/dev/null) || \
+ fail "Self sig Verification should have failed!"
-( $CERTTOOL --pgp-certificate-info <$srcdir/selfsigs/alice-mallory-badsig18.pub | grep -e "^Self Signature verification: failed" ) >/dev/null ||
- fail "Self sig Verification should have failed!"
-( $CERTTOOL --pgp-certificate-info <$srcdir/selfsigs/alice-mallory-irrelevantsig.pub | grep -e "^Self Signature verification: failed" ) >/dev/null ||
- fail "Self sig Verification should have failed!"
-( $CERTTOOL --pgp-certificate-info <$srcdir/selfsigs/alice-mallory-nosig18.pub | grep -e "^Self Signature verification: failed" ) >/dev/null ||
- fail "Self sig Verification should have failed!"
+($CERTTOOL --pgp-certificate-info < $srcdir/selfsigs/alice-mallory-nosig18.pub \
+ | grep "^Self Signature verification: failed" >/dev/null) || \
+ fail "Self sig Verification should have failed!"
exit ${RETCODE:-0}