]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
slow tests are not being run using valgrind
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 11 Nov 2011 22:08:51 +0000 (23:08 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 11 Nov 2011 22:08:51 +0000 (23:08 +0100)
tests/Makefile.am
tests/slow/Makefile.am [new file with mode: 0644]
tests/slow/README [new file with mode: 0644]
tests/slow/gendh.c [moved from tests/gendh.c with 100% similarity]
tests/slow/keygen.c [moved from tests/keygen.c with 93% similarity]

index 00d17be95dd25e1e0650f33077fc4e370e649795..2cb4fd170c01aa65768a886f622b8b5543fdf38a 100644 (file)
@@ -20,7 +20,8 @@
 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
 SUBDIRS = . rsa-md5-collision pkcs1-padding pkcs8-decode pkcs12-decode \
-       userid pathlen key-id sha2 safe-renegotiation dsa scripts ecdsa
+       userid pathlen key-id sha2 safe-renegotiation dsa scripts ecdsa \
+       slow
 
 if ENABLE_OPENPGP
 SUBDIRS += openpgp-certs
@@ -64,8 +65,7 @@ ctests = mini-deflate simple gc set_pkcs12_cred certder certuniqueid  \
         crq_apis init_roundtrip pkcs12_s2k_pem dn2 mini-eagain         \
         nul-in-x509-names x509_altname pkcs12_encode mini-x509         \
         mini-x509-rehandshake rng-fork mini-eagain-dtls cipher-test    \
-        x509cert x509cert-tl infoaccess keygen #gendh
-#gendh is out because it is too slow in valgrind
+        x509cert x509cert-tl infoaccess
 
 if ENABLE_OPENSSL
 ctests +=  openssl
diff --git a/tests/slow/Makefile.am b/tests/slow/Makefile.am
new file mode 100644 (file)
index 0000000..fda6f33
--- /dev/null
@@ -0,0 +1,35 @@
+## Process this file with automake to produce Makefile.in
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This file is part of GnuTLS.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
+AM_CPPFLAGS = \
+       -I$(top_srcdir)/lib/includes            \
+       -I$(top_builddir)/lib/includes \
+       -I$(top_srcdir)/tests/
+
+AM_LDFLAGS = -no-install
+LDADD = ../libutils.la \
+       ../../lib/libgnutls.la $(LTLIBGCRYPT) $(LIBSOCKET)
+
+ctests = gendh keygen
+
+check_PROGRAMS = $(ctests)
+TESTS = $(ctests)
+
+EXTRA_DIST = README
diff --git a/tests/slow/README b/tests/slow/README
new file mode 100644 (file)
index 0000000..0f1982c
--- /dev/null
@@ -0,0 +1 @@
+Those tests are here because they are very slow when run under valgrind.
similarity index 100%
rename from tests/gendh.c
rename to tests/slow/gendh.c
similarity index 93%
rename from tests/keygen.c
rename to tests/slow/keygen.c
index aa6365ed2f63463f7d7954d39cf178d4c8538c55..3b9547977972811f697b1950a9fda3ab9914fbce 100644 (file)
 
 #include "utils.h"
 
+#define MAX_TRIES 2
+
+static int sec_param[MAX_TRIES] = {GNUTLS_SEC_PARAM_WEAK, GNUTLS_SEC_PARAM_NORMAL};
+
 static void
 tls_log_func (int level, const char *str)
 {
@@ -53,7 +57,7 @@ doit (void)
     if (debug)
         gnutls_global_set_log_level (4711);
 
-    for (i = 0; i < 2; i++)
+    for (i = 0; i < MAX_TRIES; i++)
       {
           for (algorithm = GNUTLS_PK_RSA; algorithm <= GNUTLS_PK_ECC;
                algorithm++)
@@ -71,7 +75,7 @@ doit (void)
                     gnutls_x509_privkey_generate (pkey, algorithm,
                                                   gnutls_sec_param_to_pk_bits
                                                   (algorithm,
-                                                   GNUTLS_SEC_PARAM_NORMAL),
+                                                   sec_param[i]),
                                                   0);
                 if (ret < 0)
                   {