| 1 |
#!/bin/sh |
| 2 |
# validate-all-certs - GnuPG import and validate tests -*- sh -*- |
| 3 |
# Copyright (C) 2004, 2008 Free Software Foundation, Inc. |
| 4 |
# |
| 5 |
# This file is part of GnuPG. |
| 6 |
# |
| 7 |
# GnuPG is free software; you can redistribute it and/or modify |
| 8 |
# it under the terms of the GNU General Public License as published by |
| 9 |
# the Free Software Foundation; either version 3 of the License, or |
| 10 |
# (at your option) any later version. |
| 11 |
# |
| 12 |
# GnuPG is distributed in the hope that it will be useful, |
| 13 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
# GNU General Public License for more details. |
| 16 |
# |
| 17 |
# You should have received a copy of the GNU General Public License |
| 18 |
# along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 19 |
|
| 20 |
. ${srcdir:-.}/common.sh || exit 2 |
| 21 |
|
| 22 |
section=6 |
| 23 |
description="GnuPG Import with Validation" |
| 24 |
info "Running $description tests" |
| 25 |
|
| 26 |
while read dummy flag section name; do |
| 27 |
case $dummy in \#*) continue;; esac |
| 28 |
[ -z "$(echo $dummy)" ] && continue; |
| 29 |
|
| 30 |
description="import and validate $name" |
| 31 |
if ${GPGSM} -q --import --with-validation --disable-crl-checks \ |
| 32 |
certs/$name ; then |
| 33 |
if [ "$flag" = 'p' ]; then |
| 34 |
pass "validating certificate \`$name' succeeded" |
| 35 |
elif [ "$flag" = 'f' ]; then |
| 36 |
fail "validating certificate \`$name' succeeded" |
| 37 |
elif [ "$flag" = '?' ]; then |
| 38 |
unresolved "validating certificate \`$name' succeeded" |
| 39 |
elif [ "$flag" = 'u' ]; then |
| 40 |
skip "validating certificate \`$name' succeeded" |
| 41 |
else |
| 42 |
info "validating certificate \`$name' succeeded - (flag=$flag)" |
| 43 |
fi |
| 44 |
else |
| 45 |
if [ "$flag" = 'p' ]; then |
| 46 |
fail "validating certificate \`$name' failed" |
| 47 |
elif [ "$flag" = 'f' ]; then |
| 48 |
pass "validating certificate \`$name' failed" |
| 49 |
elif [ "$flag" = '?' ]; then |
| 50 |
unresolved "validating certificate \`$name' failed" |
| 51 |
elif [ "$flag" = 'u' ]; then |
| 52 |
skip "validating certificate \`$name' failed" |
| 53 |
else |
| 54 |
info "validating certificate \`$name' failed - (flag=$flag)" |
| 55 |
fi |
| 56 |
fi |
| 57 |
done < $srcdir/import-all-certs.data |
| 58 |
|
| 59 |
final_result |