]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: template-test: added a baseline check to detect slow systems
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 5 Mar 2015 08:25:58 +0000 (09:25 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 5 Mar 2015 08:32:36 +0000 (09:32 +0100)
tests/cert-tests/Makefile.am
tests/cert-tests/template-basic.pem [new file with mode: 0644]
tests/cert-tests/template-basic.tmpl [new file with mode: 0644]
tests/cert-tests/template-test

index c4fe11039ec465be735f8f52df19489b24a779b4..95312d54a5aed312c3c27f11cee1a69cb114da74 100644 (file)
@@ -27,7 +27,8 @@ EXTRA_DIST = ca-no-pathlen.pem no-ca-or-pathlen.pem aki-cert.pem \
        template-overflow.tmpl template-overflow2.pem template-overflow2.tmpl \
        template-date.tmpl template-date.pem template-dn-err.tmpl \
        template-nc.tmpl template-nc.pem xmpp-othername.pem \
-       suppressions.valgrind csr-invalid.der invalid-sig2.pem invalid-sig3.pem
+       suppressions.valgrind csr-invalid.der invalid-sig2.pem invalid-sig3.pem \
+       template-basic.tmpl template-basic.pem
 
 dist_check_SCRIPTS = pathlen aki template-test pem-decoding dane crq certtool invalid-sig
 
diff --git a/tests/cert-tests/template-basic.pem b/tests/cert-tests/template-basic.pem
new file mode 100644 (file)
index 0000000..6c87bff
--- /dev/null
@@ -0,0 +1,14 @@
+-----BEGIN CERTIFICATE-----
+MIICETCCAXqgAwIBAgIBCTANBgkqhkiG9w0BAQsFADA0MRIwEAYDVQQDEwlhbm9u
+eW1vdXMxETAPBgNVBAoTCEJpZyBjb3JwMQswCQYDVQQGEwJHUjAiGA8yMDA3MDQy
+MTIyMDAwMFoYDzIwMDgwNDIwMjIwMDAwWjA0MRIwEAYDVQQDEwlhbm9ueW1vdXMx
+ETAPBgNVBAoTCEJpZyBjb3JwMQswCQYDVQQGEwJHUjCBnzANBgkqhkiG9w0BAQEF
+AAOBjQAwgYkCgYEApcbOdUOEv2SeAicT8QNZ93ktku18L1CkA/EtebmGiwV+OrtE
+qq+EzxOYHhxKOPczLXqfctRrbSawMTdwEPtC6didGGV+GUn8BZYEaIMed4a/7fXl
+EjsT/jMYnBp6HWmvRwJgeh+56M/byDQwUZY9jJZcALxh3ggPsTYhf6kA4wUCAwEA
+AaMvMC0wDAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQUXUCt8M6UQJWLfpmUHZJUIspy
+Nl8wDQYJKoZIhvcNAQELBQADgYEAmm9vjb5Np4B6dKkNsnxau2VNY8jMeXjan/qp
+nxTYf3yQCJIMTKxPLkKbzc8mtrnbs80h86ery6Ea2El0Tan4TEFKJOnRzqXkwj9k
+1cghM4VJKl8qxqnkbWO+CbXstla139UnGjODT9xPNRfLPkn/2I59BKdopm9uREA4
+Z6Vka0A=
+-----END CERTIFICATE-----
diff --git a/tests/cert-tests/template-basic.tmpl b/tests/cert-tests/template-basic.tmpl
new file mode 100644 (file)
index 0000000..0ab29f1
--- /dev/null
@@ -0,0 +1,19 @@
+# X.509 Certificate options
+#
+# DN options
+
+# The organization of the subject.
+organization = "Big corp"
+
+# The name (Koala)
+cn = "anonymous"
+
+# The locality of the subject.
+# locality =
+
+# The country of the subject. Two letter code.
+country = GR
+
+# The serial number of the certificate
+serial = 009
+
index 2d3d8309d76f457c2f70b3e0ba917dead884f3c6..ae251d45fc7c6858c9ee9833cda3d0fcf7516585 100755 (executable)
@@ -39,7 +39,33 @@ counter=1
 
 while [ "$rc" != "0" -a $counter -le 10 ]
 do
-      
+
+datefudge "2007-04-22" \
+    $CERTTOOL --generate-self-signed \
+    --load-privkey $srcdir/template-test.key \
+    --template $srcdir/template-basic.tmpl \
+    --outfile tmp-tt.pem 2>/dev/null
+
+diff $srcdir/template-basic.pem tmp-tt.pem >/dev/null 2>&1
+rc=$?
+counter=`expr $counter + 1` 
+test "$rc" != 0 && sleep 1
+done
+
+# We're done.
+if test "$rc" != "0"; then
+  echo "Baseline test failed, is system slow?"
+  exit 77
+fi
+
+rm -f tmp-tt.pem
+
+rc=1
+counter=1
+
+while [ "$rc" != "0" -a $counter -le 10 ]
+do
+
 datefudge "2007-04-22" \
     $CERTTOOL --generate-self-signed \
     --load-privkey $srcdir/template-test.key \