diff options
author | Viktor Dukhovni <openssl-users@dukhovni.org> | 2015-04-10 12:25:30 -0400 |
---|---|---|
committer | Viktor Dukhovni <openssl-users@dukhovni.org> | 2015-04-10 12:28:07 -0400 |
commit | 34b0a927ab5c9232bcf864d524a9bf2558411700 (patch) | |
tree | ab26e47b9c715b7ef7106bbad96da7e8c9acf4af /test | |
parent | e71cecd551f1d8beca20681184d94f7000a5e333 (diff) | |
download | openssl-new-34b0a927ab5c9232bcf864d524a9bf2558411700.tar.gz |
Polish shell script to avoid needless complexity.
No need for here documents, just use "yes" or </dev/null.
No need for "|| exit 1" clauses, just use "set -e".
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/testca | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/test/testca b/test/testca index d4d0159726..4bcb1fd576 100644 --- a/test/testca +++ b/test/testca @@ -1,5 +1,7 @@ #!/bin/sh +set -e + PERL="$1" if test "$OSTYPE" = msdosdjgpp; then @@ -9,35 +11,19 @@ else fi export PATH -SSLEAY_CONFIG="-config CAss.cnf" -export SSLEAY_CONFIG - -OPENSSL="`pwd`/../util/opensslwrap.sh" -export OPENSSL +export SSLEAY_CONFIG="-config CAss.cnf" +export OPENSSL="`pwd`/../util/opensslwrap.sh" /bin/rm -fr demoCA -# Could do '...CA.pl -newca <<EOF || exit 1 -# EOF' but that seems too obscure to me. :) -OPENSSL_CONFIG=/dev/null $PERL ../apps/CA.pl -newca <<EOF -EOF -[ $? -eq 0 ] || exit 1 +OPENSSL_CONFIG=/dev/null $PERL ../apps/CA.pl -newca </dev/null -SSLEAY_CONFIG="-config Uss.cnf" -export SSLEAY_CONFIG -$PERL ../apps/CA.pl -newreq || exit 1 +export SSLEAY_CONFIG="-config Uss.cnf" +$PERL ../apps/CA.pl -newreq SSLEAY_CONFIG="-config ../apps/openssl.cnf" -export SSLEAY_CONFIG - -# Same comment here. -$PERL ../apps/CA.pl -sign <<EOF -y -y -EOF -[ $? -eq 0 ] || exit 1 - +yes | $PERL ../apps/CA.pl -sign -$PERL ../apps/CA.pl -verify newcert.pem || exit 1 +$PERL ../apps/CA.pl -verify newcert.pem /bin/rm -fr demoCA newcert.pem newreq.pem |