test script cleanup
[oweals/openssl.git] / test / testca
index a28402f9ca79fa2187d1c19b808066637d3c7cd0..8961cf8448eba18ae6b61c938a312f49004c267a 100644 (file)
@@ -1,44 +1,43 @@
 #!/bin/sh
 
-SH="/bin/sh"
-PATH=../apps:$PATH
-export SH PATH
+PERL="$1"
+
+if test "$OSTYPE" = msdosdjgpp; then
+    PATH="../apps\;$PATH"
+else
+    PATH="../apps:$PATH"
+fi
+export PATH
 
 SSLEAY_CONFIG="-config CAss.cnf"
 export SSLEAY_CONFIG
 
+OPENSSL="`pwd`/../util/opensslwrap.sh"
+export OPENSSL
+
 /bin/rm -fr demoCA
-$SH ../apps/CA.sh -newca <<EOF
-EOF
 
-if [ $? != 0 ]; then
-       exit 1;
-fi
+# Could do '...CA.pl -newca || exot 1 << EOF
+# EOF' but that seems too obscure to me. :)
+OPENSSL_CONFIG=/dev/null $PERL ../apps/CA.pl -newca <<EOF
+EOF
+[ $? == 0 ] || exit 1
 
 SSLEAY_CONFIG="-config Uss.cnf"
 export SSLEAY_CONFIG
-$SH ../apps/CA.sh -newreq
-if [ $? != 0 ]; then
-       exit 1;
-fi
-
+$PERL ../apps/CA.pl -newreq || exit 1
 
-SSLEAY_CONFIG="-config ../apps/ssleay.cnf"
+SSLEAY_CONFIG="-config ../apps/openssl.cnf"
 export SSLEAY_CONFIG
-$SH ../apps/CA.sh -sign  <<EOF
+
+# Same comment here.
+$PERL ../apps/CA.pl -sign  <<EOF
 y
 y
 EOF
-if [ $? != 0 ]; then
-       exit 1;
-fi
+[ $? == 0 ] || exit 1
 
 
-$SH ../apps/CA.sh -verify newcert.pem
-if [ $? != 0 ]; then
-       exit 1;
-fi
+$PERL ../apps/CA.pl -verify newcert.pem || exit 1
 
 /bin/rm -fr demoCA newcert.pem newreq.pem
-#usage: CA -newcert|-newreq|-newca|-sign|-verify
-