2 # Copyright (C) 2002 Free Software Foundation, Inc.
4 # This file is free software; as a special exception the author gives
5 # unlimited permission to copy and/or distribute it, with or without
6 # modifications, as long as this notice is preserved.
8 # This file is distributed in the hope that it will be useful, but
9 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
10 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 cert_g10code_test1.pem
16 cert_g10code_pete1.pem
17 cert_g10code_theo1.pem
21 32100C27173EF6E9C4E9A25D3D69F86D37A4F939
25 gpgsm.conf gpg-agent.conf trustlist.txt pubring.kbx
30 [ -z "$srcdir" ] && srcdir
=.
31 [ -z "$GPGSM" ] && GPGSM
=..
/sm
/gpgsm
33 if [ -d $srcdir/samplekeys
] \
34 && grep TESTS_ENVIRONMENT Makefile
>/dev
/null
2>&1; then
37 # During make distclean the Makefile has already been removed,
38 # so we need this extra test.
39 if ! grep gnupg-test-directory testdir.stamp
>/dev
/null
2>&1; then
40 echo "inittests: please cd to the tests directory first" >&2
45 if [ "$1" = "--clean" ]; then
46 if [ -d private-keys-v1.d
]; then
47 rm private-keys-v1.d
/* 2>/dev
/null || true
48 rmdir private-keys-v1.d
50 rm ${clean_files} testdir.stamp
2>/dev
/null || true
54 if [ "$GNUPGHOME" != "`/bin/pwd`" ]; then
55 echo "inittests: please set GNUPGHOME to the test directory" >&2
59 if [ -n "$GPG_AGENT_INFO" ]; then
60 echo "inittests: please unset GPG_AGENT_INFO" >&2
64 # A stamp file used with --clean
65 echo gnupg-test-directory
> testdir.stamp
68 # Create the private key directy if it does not exists and copy
70 [ -d private-keys-v1.d
] || mkdir private-keys-v1.d
71 for i
in ${private_keys}; do
72 cat ${srcdir}/samplekeys
/$i.key
>private-keys-v1.d
/$i.key
75 # Create the configuration scripts
76 # Note, die to an expired test certificate, we need to use
77 # the faked system time option.
78 cat > gpgsm.conf
<<EOF
81 agent-program ../agent/gpg-agent
82 faked-system-time 1038835799
85 cat > gpg-agent.conf
<<EOF
87 pinentry-program /home/wk/work/pinentry/gtk/pinentry-gtk
90 cat > trustlist.txt
<<EOF
91 # CN=test cert 1,OU=Aegypten Project,O=g10 Code GmbH,L=Düsseldorf,C=DE
92 3CF405464F66ED4A7DF45BBDD1E4282E33BDB76E S
95 # Make sure that the sample certs are available but ignore errors here
96 # because we are not a test script.
97 for i
in ${sample_certs}; do
98 $GPGSM --import ${srcdir}/samplekeys
/$i || true