chiark / gitweb /
gnupg2 (2.1.17-3) unstable; urgency=medium
[gnupg2.git] / tests / pkits / import-all-certs
1 #!/bin/sh
2 # import-all-certs - GnuPG import test                     -*- 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"
24 info "Running $description tests"
25
26 while read flag dummy section name; do 
27     case $flag in \#*) continue ;; esac
28     [ -z "$(echo $flag)" ] && continue;
29
30     description="import $name"
31     if ${GPGSM} -q --import certs/$name ; then
32         if [ "$flag" = 'p' ]; then
33             pass "importing certificate \`$name' succeeded"
34         elif [ "$flag" = 'f' ]; then
35             fail "importing certificate \`$name' succeeded"
36         elif [ "$flag" = '?' ]; then
37             unresolved "importing certificate \`$name' succeeded"
38         elif [ "$flag" = 'u' ]; then
39             skip "importing certificate \`$name' succeeded"
40         else
41             info "importing certificate \`$name' succeeded - (flag=$flag)"
42         fi
43     else
44         if [ "$flag" = 'p' ]; then
45             fail "importing certificate \`$name' failed"
46         elif [ "$flag" = 'f' ]; then
47             pass "importing certificate \`$name' failed"
48         elif [ "$flag" = '?' ]; then
49             unresolved "importing certificate \`$name' failed"
50         elif [ "$flag" = 'u' ]; then
51             skip "importing certificate \`$name' failed"
52         else
53             info "importing certificate \`$name' failed - (flag=$flag)"
54         fi
55     fi
56 done < $srcdir/import-all-certs.data
57
58 final_result