]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: attempt to fix test errors on Mac OS X
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Thu, 29 Nov 2018 03:05:22 +0000 (06:05 +0300)
committerDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Thu, 29 Nov 2018 03:16:25 +0000 (06:16 +0300)
It looks like Mac OS X's grep has issues with applying basic regexps
with alternation operator inside. Use several grep calls in pipeline to
achieve the same result.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
tests/cert-tests/crl
tests/cert-tests/crq
tests/cert-tests/pem-decoding
tests/cert-tests/pkcs12
tests/cert-tests/pkcs7
tests/cert-tests/privkey-import

index bea0c5237e86283fe44bbda6abffbb8e1fe03bb3..9ca61d7700c8f1a869f445d539f787aaee500281 100755 (executable)
@@ -63,7 +63,7 @@ if test "${rc}" != "0"; then
        exit ${rc}
 fi
 
-if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$\|^[A-Za-z0-9/+=]\+$\|^-----END [A-Z0-9 ]\+-----$' ${TMP2FILE} ; then
+if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$' ${TMP2FILE} | grep -v '^[A-Za-z0-9/+=]\+$' | grep -v '^-----END [A-Z0-9 ]\+-----$' ; then
        echo "--no-text crl info failed 2"
        exit 1
 fi
index 58581e4148c2ee0703887f7eb5c1ee73984beb6e..e29f17a17f48471d77dd747569b1dd43c5667bf7 100755 (executable)
@@ -74,7 +74,7 @@ if test "${rc}" != "0"; then
        exit ${rc}
 fi
 
-if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$\|^[A-Za-z0-9/+=]\+$\|^-----END [A-Z0-9 ]\+-----$' ${TMPFILE} ; then
+if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$' ${TMPFILE} | grep -v '^[A-Za-z0-9/+=]\+$' | grep -v '^-----END [A-Z0-9 ]\+-----$' ; then
        echo "--no-text crq info failed 2"
        exit 1
 fi
index c5ba22e26da01b4e5807eed75c5f7da27c3c1edb..1daf926317af9f3f6257a3ceea88aed7a58b7ccb 100755 (executable)
@@ -188,7 +188,7 @@ if test "${rc}" != "0"; then
        exit ${rc}
 fi
 
-if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$\|^[A-Za-z0-9/+=]\+$\|^-----END [A-Z0-9 ]\+-----$' ${TMPFILE} ; then
+if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$' ${TMPFILE} | grep -v '^[A-Za-z0-9/+=]\+$' | grep -v '^-----END [A-Z0-9 ]\+-----$' ; then
        echo "--no-text -k --certificate-info failed 2"
        exit 1
 fi
@@ -202,7 +202,7 @@ if test "${rc}" != "0"; then
        exit ${rc}
 fi
 
-if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$\|^[A-Za-z0-9/+=]\+$\|^-----END [A-Z0-9 ]\+-----$' ${TMPFILE} ; then
+if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$' ${TMPFILE} | grep -v '^[A-Za-z0-9/+=]\+$' | grep -v '^-----END [A-Z0-9 ]\+-----$' ; then
        echo "--no-text cert pubkey failed 2"
        exit 1
 fi
@@ -216,7 +216,7 @@ if test "${rc}" != "0"; then
        exit ${rc}
 fi
 
-if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$\|^[A-Za-z0-9/+=]\+$\|^-----END [A-Z0-9 ]\+-----$' ${TMPFILE} ; then
+if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$' ${TMPFILE} | grep -v '^[A-Za-z0-9/+=]\+$' | grep -v '^-----END [A-Z0-9 ]\+-----$' ; then
        echo "--no-text pubkey info failed 2"
        exit 1
 fi
index d05389d10f33206d55ca004b05a0d65be8da9214..f28230a7b2df8e249bfc8a97f1579e47d7c1e894 100755 (executable)
@@ -88,7 +88,7 @@ if test "${rc}" != "0"; then
        exit ${rc}
 fi
 
-if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$\|^[A-Za-z0-9/+=]\+$\|^-----END [A-Z0-9 ]\+-----$' ${TMPFILE} ; then
+if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$' ${TMPFILE} | grep -v '^[A-Za-z0-9/+=]\+$' | grep -v '^-----END [A-Z0-9 ]\+-----$' ; then
        echo "--no-text pkcs12 info failed 2"
        exit 1
 fi
index bfe11290fc0f7e2b95d4219bb5881202624c9b6a..eed9f068a281cf09cc254e6a65627dbd09ecd5b9 100755 (executable)
@@ -72,7 +72,7 @@ if test "${rc}" != "0"; then
        exit ${rc}
 fi
 
-if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$\|^[A-Za-z0-9/+=]\+$\|^-----END [A-Z0-9 ]\+-----$' ${TMPFILE} ; then
+if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$' ${TMPFILE} | grep -v '^[A-Za-z0-9/+=]\+$' | grep -v '^-----END [A-Z0-9 ]\+-----$' ; then
        echo "--no-text pkcs7 info failed 2"
        exit 1
 fi
index f3f94806fa0ae7f0760a5e0e9df970c13b34c7f1..73bacae253a0250864189ad2b30a4f9eca838baa 100755 (executable)
@@ -52,7 +52,7 @@ if test "${rc}" != "0"; then
        exit ${rc}
 fi
 
-if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$\|^[A-Za-z0-9/+=]\+$\|^-----END [A-Z0-9 ]\+-----$' ${TMPFILE} ; then
+if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$' ${TMPFILE} | grep -v '^[A-Za-z0-9/+=]\+$' | grep -v '^-----END [A-Z0-9 ]\+-----$' ; then
        echo "--no-text privkey info failed 2"
        exit 1
 fi