Now that the DN encoding works more correct, we have to update the
[gnupg.git] / checks / defs.inc
1 # definitions for the check scripts
2
3 #--------------------------------
4 #------ constants ---------------
5 #--------------------------------
6
7 # Note that usrpass1 is also used in Makefile.am
8 usrname1="one"
9 usrpass1="def"
10 usrname2="two"
11 usrpass2=""
12 usrname3="three"
13 usrpass3="abc"
14
15
16 dsa_usrname1="pgp5"
17 # we use the sub key because we do not yet have the logic to
18 # to derive the first encryption key from a keyblock (I guess)
19 dsa_usrname2="0xCB879DE9"
20
21 dsa_keyrings="--keyring ./pubring.pkr --secret-keyring ./secring.skr"
22
23
24 plain_files="plain-1 plain-2 plain-3"
25 data_files="data-500 data-9000 data-32000 data-80000"
26 exp_files=""
27
28 # The testscripts expect the original language
29 LANG=
30 LANGUAGE=
31 LC_ALL=
32 LC_MESSAGES=
33
34 #--------------------------------
35 #------ utility functions -------
36 #--------------------------------
37
38 fatal () {
39     echo "$pgmname: fatal:" $* >&2
40     exit 1;
41 }
42
43 error () {
44     echo "$pgmname:" $* >&2
45     exit 1
46 }
47
48 info () {
49     echo "$pgmname:" $* >&2
50 }
51
52 chdir () {
53     cd $1 || fatal "cannot cd to $1"
54 }
55
56 echo_n_init=no
57 echo_n () {
58   if test "$echo_n_init" = "no"; then
59     if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
60       if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
61         echo_n_n=
62         echo_n_c='
63 '
64       else
65         echo_n_n='-n'
66         echo_n_c=
67       fi
68     else
69       echo_n_n=
70       echo_n_c='\c'
71     fi
72     echo_n_init=yes
73   fi
74   echo $echo_n_n "${1}$echo_n_c"
75 }
76
77
78 #cleanup () {
79 #    rm $cleanup_files 2>/dev/null || true
80 #    echo "#empty" >./options
81 #}
82
83
84 #add_cleanup () {
85 #    cleanup_files="$cleanup_files $*"
86 #}
87
88
89 have_hash_algo () {
90   if  ../g10/gpg --homedir .  --version | grep "Hash:.*$1" >/dev/null
91   then
92         true
93   else
94         false
95   fi
96 }
97
98 set -e
99 pgmname=`basename $0`
100 #trap cleanup SIGHUP SIGINT SIGQUIT
101
102 [ -z "$srcdir" ] && fatal "not called from make"
103
104 cat <<EOF  >./options
105 no-greeting
106 no-secmem-warning
107 load-extension ../cipher/tiger
108 batch
109 emulate-md-encode-bug
110 EOF
111