portability update for linux /bin/sh script

pull/32/head
kaleb-himes 2016-11-27 17:24:26 -07:00
parent 3cc67a4716
commit dfb12cac88
2 changed files with 8 additions and 8 deletions

2
wolfCLU/.gitignore vendored
View File

@ -30,4 +30,4 @@ m4/libtool.m4
wolfssl wolfssl
test-suite.log test-suite.log
tests/x509/x509-process-test.sh.log tests/x509/x509-process-test.sh.log
tests/x509/x509-process-test.sh.trs

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
function test() { test_return() {
CHECK=$1 CHECK=$1
#UNCOMMENT FOR VERBOSE OUTPUT #UNCOMMENT FOR VERBOSE OUTPUT
echo "${2}" echo "${2}"
@ -12,14 +12,14 @@ function test() {
echo "" echo ""
} }
function test_case() { test_case() {
echo "testing: ./wolfssl -x509 $1" echo "testing: ./wolfssl -x509 $1"
OUTPUT=$(./wolfssl -x509 $1) OUTPUT=$(./wolfssl -x509 $1)
RESULT=$? RESULT=$?
test $RESULT "$OUTPUT" test_return $RESULT "$OUTPUT"
} }
function cert_test_case() { cert_test_case() {
echo "testing: ./wolfssl -x509 $1" echo "testing: ./wolfssl -x509 $1"
OUTPUT=$(./wolfssl -x509 $1) OUTPUT=$(./wolfssl -x509 $1)
RESULT=$? RESULT=$?
@ -31,7 +31,7 @@ function cert_test_case() {
echo "" echo ""
} }
function run1() { run1() {
echo "TEST 1: VALID" echo "TEST 1: VALID"
echo "TEST 1.a" echo "TEST 1.a"
test_case "-inform pem -outform pem" test_case "-inform pem -outform pem"
@ -47,7 +47,7 @@ function run1() {
echo "" echo ""
} }
function run2() { run2() {
echo "TEST 2: INVALID INPUT" echo "TEST 2: INVALID INPUT"
echo "TEST 2.a" echo "TEST 2.a"
test_case "-inform pem -inform der" test_case "-inform pem -inform der"
@ -85,7 +85,7 @@ function run2() {
test_case "-inform pem -outform pem -noout" test_case "-inform pem -outform pem -noout"
} }
function run3() { run3() {
echo "TEST3: VALID INPUT FILES" echo "TEST3: VALID INPUT FILES"
echo "TEST 3.a" echo "TEST 3.a"
#convert ca-cert.der to tmp.pem and compare to ca-cert.pem for valid transform #convert ca-cert.der to tmp.pem and compare to ca-cert.pem for valid transform