diff options
Diffstat (limited to 'tests/cert-tests/template-test')
-rwxr-xr-x | tests/cert-tests/template-test | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/cert-tests/template-test b/tests/cert-tests/template-test index 8bbc9115a0..873f7d0c98 100755 --- a/tests/cert-tests/template-test +++ b/tests/cert-tests/template-test @@ -22,6 +22,7 @@ srcdir=${srcdir:-.} CERTTOOL=${CERTTOOL:-../../src/certtool$EXEEXT} +DIFF="${DIFF:-diff}" export TZ="UTC" @@ -226,6 +227,7 @@ fi rm -f tmp-tt.pem + # Test the GeneralizedTime support if test "$(getconf LONG_BIT)" = "64"; then @@ -257,4 +259,30 @@ rm -f tmp-tt.pem fi +# Test unique ID field generation + +rc=1 +counter=1 + +while [ "${rc}" != "0" -a $counter -le 3 ]; do + datefudge "2007-04-22" \ + "${CERTTOOL}" --generate-self-signed \ + --load-privkey "${srcdir}/template-test.key" \ + --template "${srcdir}/template-unique.tmpl" \ + --outfile tmp-tt.pem 2>/dev/null + + ${DIFF} "${srcdir}/template-unique.pem" tmp-tt.pem >/dev/null 2>&1 + rc=$? + test ${rc} != 0 && sleep 3 + counter=`expr $counter + 1` +done + +# We're done. +if test "${rc}" != "0"; then + echo "Test 9 (unique ID) failed" + exit ${rc} +fi + +rm -f tmp-tt.pem + exit 0 |