updated certificates to parse 2.5.29.32.
[gnutls.git] / tests / suite / testrandom
blob81ba75e8e4da52b79bc77f04ed7e0bf671a6e50f
1 #!/bin/sh
3 # Copyright (C) 2012 Free Software Foundation, Inc.
5 # Author: Nikos Mavrogiannopoulos
7 # This file is part of GnuTLS.
9 # GnuTLS is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by the
11 # Free Software Foundation; either version 3 of the License, or (at
12 # your option) any later version.
14 # GnuTLS is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with GnuTLS; if not, write to the Free Software Foundation,
21 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 srcdir=${srcdir:-.}
24 CERTTOOL=${CERTTOOL:-../../src/certtool$EXEEXT}
26 counter=0
27 file=test.out
29 echo "Testing with randomly generated certificates..."
30 while [ $counter -lt 200 ]
32 $srcdir/x509random.pl > $srcdir/$file
33 $CERTTOOL -i --inder --infile $srcdir/$file >/dev/null
34 ret=$?
35 if [ $ret != 0 -a $ret != 1 ];then
36 echo "Unknown exit code with $file"
37 exit 1
40 counter=`expr $counter + 1`
41 done
43 counter=0
45 echo "Testing with random ASN.1 data..."
46 while [ $counter -lt 200 ]
48 $srcdir/asn1random.pl > $srcdir/$file
49 $CERTTOOL -i --inder --infile $srcdir/$file >/dev/null 2>/dev/null
50 ret=$?
51 if [ $ret != 0 -a $ret != 1 ];then
52 echo "Unknown exit code with $file"
53 exit 1
56 counter=`expr $counter + 1`
57 done
59 rm -f $srcdir/$file
61 exit 0