Polish shell script to avoid needless complexity.
[openssl.git] / test / tx509
index f8d1f82cdd229e97ce06b7f9aa74065cc54cb25f..f4774c0c994063fb241e8bcd8bbc49c7cacc7ab8 100644 (file)
@@ -1,9 +1,7 @@
 #!/bin/sh
 
-PATH=../apps:$PATH
-export PATH
-
-cmd='../apps/ssleay x509'
+OPENSSL_CONF=/dev/null ; export OPENSSL_CONF
+cmd='../util/shlib_wrap.sh ../apps/openssl x509'
 
 if [ "$1"x != "x" ]; then
        t=$1
@@ -12,70 +10,47 @@ else
 fi
 
 echo testing X509 conversions
-cp $t fff.p
+cp $t x509-fff.p
 
 echo "p -> d"
-$cmd -in fff.p -inform p -outform d >f.d
-if [ $? != 0 ]; then exit 1; fi
+$cmd -in x509-fff.p -inform p -outform d >x509-f.d || exit 1
 echo "p -> n"
-$cmd -in fff.p -inform p -outform n >f.n
-if [ $? != 0 ]; then exit 1; fi
+$cmd -in x509-fff.p -inform p -outform n >x509-f.n || exit 1
 echo "p -> p"
-$cmd -in fff.p -inform p -outform p >f.p
-if [ $? != 0 ]; then exit 1; fi
+$cmd -in x509-fff.p -inform p -outform p >x509-f.p || exit 1
 
 echo "d -> d"
-$cmd -in f.d -inform d -outform d >ff.d1
-if [ $? != 0 ]; then exit 1; fi
+$cmd -in x509-f.d -inform d -outform d >x509-ff.d1 || exit 1
 echo "n -> d"
-$cmd -in f.n -inform n -outform d >ff.d2
-if [ $? != 0 ]; then exit 1; fi
+$cmd -in x509-f.n -inform n -outform d >x509-ff.d2 || exit 1
 echo "p -> d"
-$cmd -in f.p -inform p -outform d >ff.d3
-if [ $? != 0 ]; then exit 1; fi
+$cmd -in x509-f.p -inform p -outform d >x509-ff.d3 || exit 1
 
 echo "d -> n"
-$cmd -in f.d -inform d -outform n >ff.n1
-if [ $? != 0 ]; then exit 1; fi
+$cmd -in x509-f.d -inform d -outform n >x509-ff.n1 || exit 1
 echo "n -> n"
-$cmd -in f.n -inform n -outform n >ff.n2
-if [ $? != 0 ]; then exit 1; fi
+$cmd -in x509-f.n -inform n -outform n >x509-ff.n2 || exit 1
 echo "p -> n"
-$cmd -in f.p -inform p -outform n >ff.n3
-if [ $? != 0 ]; then exit 1; fi
+$cmd -in x509-f.p -inform p -outform n >x509-ff.n3 || exit 1
 
 echo "d -> p"
-$cmd -in f.d -inform d -outform p >ff.p1
-if [ $? != 0 ]; then exit 1; fi
+$cmd -in x509-f.d -inform d -outform p >x509-ff.p1 || exit 1
 echo "n -> p"
-$cmd -in f.n -inform n -outform p >ff.p2
-if [ $? != 0 ]; then exit 1; fi
+$cmd -in x509-f.n -inform n -outform p >x509-ff.p2 || exit 1
 echo "p -> p"
-$cmd -in f.p -inform p -outform p >ff.p3
-if [ $? != 0 ]; then exit 1; fi
-
-cmp fff.p f.p
-if [ $? != 0 ]; then exit 1; fi
-cmp fff.p ff.p1
-if [ $? != 0 ]; then exit 1; fi
-cmp fff.p ff.p2
-if [ $? != 0 ]; then exit 1; fi
-cmp fff.p ff.p3
-if [ $? != 0 ]; then exit 1; fi
+$cmd -in x509-f.p -inform p -outform p >x509-ff.p3 || exit 1
 
-cmp f.n ff.n1
-if [ $? != 0 ]; then exit 1; fi
-cmp f.n ff.n2
-if [ $? != 0 ]; then exit 1; fi
-cmp f.n ff.n3
-if [ $? != 0 ]; then exit 1; fi
+cmp x509-fff.p x509-f.p || exit 1
+cmp x509-fff.p x509-ff.p1 || exit 1
+cmp x509-fff.p x509-ff.p2 || exit 1
+cmp x509-fff.p x509-ff.p3 || exit 1
 
-cmp f.p ff.p1
-if [ $? != 0 ]; then exit 1; fi
-cmp f.p ff.p2
-if [ $? != 0 ]; then exit 1; fi
-cmp f.p ff.p3
-if [ $? != 0 ]; then exit 1; fi
+cmp x509-f.n x509-ff.n1 || exit 1
+cmp x509-f.n x509-ff.n2 || exit 1
+cmp x509-f.n x509-ff.n3 || exit 1
+cmp x509-f.p x509-ff.p1 || exit 1
+cmp x509-f.p x509-ff.p2 || exit 1
+cmp x509-f.p x509-ff.p3 || exit 1
 
-/bin/rm -f f.* ff.* fff.*
+/bin/rm -f x509-f.* x509-ff.* x509-fff.*
 exit 0