]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: moved pkcs8 tests to key-tests/
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 28 Jul 2016 11:08:57 +0000 (13:08 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 28 Jul 2016 16:26:52 +0000 (18:26 +0200)
14 files changed:
tests/Makefile.am
tests/key-tests/Makefile.am
tests/key-tests/data/enc2pkcs8.pem [moved from tests/pkcs8-decode/enc2pkcs8.pem with 100% similarity]
tests/key-tests/data/encpkcs8.pem [moved from tests/pkcs8-decode/encpkcs8.pem with 100% similarity]
tests/key-tests/data/openssl-3des.p8 [moved from tests/pkcs8-decode/openssl-3des.p8 with 100% similarity]
tests/key-tests/data/openssl-3des.p8.txt [moved from tests/pkcs8-decode/openssl-3des.p8.txt with 100% similarity]
tests/key-tests/data/openssl-aes128.p8 [moved from tests/pkcs8-decode/openssl-aes128.p8 with 100% similarity]
tests/key-tests/data/openssl-aes128.p8.txt [moved from tests/pkcs8-decode/openssl-aes128.p8.txt with 100% similarity]
tests/key-tests/data/openssl-aes256.p8 [moved from tests/pkcs8-decode/openssl-aes256.p8 with 100% similarity]
tests/key-tests/data/openssl-aes256.p8.txt [moved from tests/pkcs8-decode/openssl-aes256.p8.txt with 100% similarity]
tests/key-tests/data/unencpkcs8.pem [moved from tests/pkcs8-decode/unencpkcs8.pem with 100% similarity]
tests/key-tests/pkcs8-decode [moved from tests/pkcs8-decode/pkcs8 with 78% similarity]
tests/pkcs8-decode/Makefile.am [deleted file]
tests/pkcs8-decode/suppressions.valgrind [deleted file]

index 16573989bd534d1c9dffb7208ff7ae755775dc8a..d373b083f8b06bf46f314b865a3f6c26db9d70e5 100644 (file)
@@ -19,8 +19,7 @@
 # along with this file; if not, write to the Free Software Foundation,
 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
-SUBDIRS = . pkcs8-decode \
-       cert-tests ocsp-tests key-tests sha2 safe-renegotiation dsa scripts ecdsa \
+SUBDIRS = . cert-tests ocsp-tests key-tests sha2 safe-renegotiation dsa scripts ecdsa \
        slow dtls srp windows
 
 if ENABLE_OPENPGP
index fdf3c7e16bab82fec0d7d05ee6e904dffcfcf15e..39342e6659457ab93dcdce48f1a6712baba50571 100644 (file)
@@ -23,10 +23,13 @@ EXTRA_DIST = README data/key-ca.pem data/key-user.pem \
        data/ca-gnutls-keyid.pem data/ca-no-keyid.pem data/ca-weird-keyid.pem \
        data/key-ca-1234.p8 data/key-ca-empty.p8 data/key-ca-null.p8 \
        data/openssl-key-ecc.p8 data/key-ecc.p8 data/key-ecc.pem suppressions.valgrind
+       data/encpkcs8.pem data/unencpkcs8.pem data/enc2pkcs8.pem \
+       data/openssl-3des.p8 data/openssl-3des.p8.txt data/openssl-aes128.p8 \
+       data/openssl-aes128.p8.txt data/openssl-aes256.p8 data/openssl-aes256.p8.txt
 
-dist_check_SCRIPTS = key-id pkcs8
+dist_check_SCRIPTS = key-id pkcs8 pkcs8-decode
 
-TESTS = key-id pkcs8
+TESTS = key-id pkcs8 pkcs8-decode
 
 TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT) \
        LC_ALL="C"                                              \
similarity index 78%
rename from tests/pkcs8-decode/pkcs8
rename to tests/key-tests/pkcs8-decode
index 0cbb5d837ec8b270f883a4f07a150d169f2355e9..e7df1fa6fab2897b6e8996cf1f60e607ed0ef6f4 100755 (executable)
 srcdir="${srcdir:-.}"
 CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
 DIFF="${DIFF:-diff -b -B}"
+TMPFILE=pkcs8-decode.$$.tmp
 
 if ! test -z "${VALGRIND}"; then
        VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
 fi
 
 ret=0
-for p8 in 'encpkcs8.pem foobar' unencpkcs8.pem 'enc2pkcs8.pem baz'; do
+for p8 in "encpkcs8.pem foobar" "unencpkcs8.pem" "enc2pkcs8.pem baz"; do
        set -- ${p8}
        file="$1"
        passwd="$2"
        ${VALGRIND} "${CERTTOOL}" --key-info --pkcs8 --password "${passwd}" \
-               --infile "${srcdir}/${file}" | tee out >/dev/null
+               --infile "${srcdir}/data/${file}" | tee $TMPFILE >/dev/null
        rc=$?
        if test ${rc} != 0; then
-               cat out
+               cat $TMPFILE
                echo "PKCS8 FATAL ${p8}"
                ret=1
        else
                echo "PKCS8 OK ${p8}"
        fi
 done
-rm -f out
+rm -f $TMPFILE
 
-for p8 in openssl-aes128.p8 openssl-aes256.p8 openssl-3des.p8; do
+for p8 in "openssl-aes128.p8" "openssl-aes256.p8" "openssl-3des.p8"; do
        set -- ${p8}
        file="$1"
        passwd="$2"
        ${VALGRIND} "${CERTTOOL}" --p8-info --password "1234" \
-               --infile "${srcdir}/${file}" | tee out >/dev/null
+               --infile "${srcdir}/data/${file}" | tee $TMPFILE >/dev/null
        rc=$?
        if test ${rc} != 0; then
-               cat out
+               cat $TMPFILE
                echo "PKCS8 FATAL ${p8}"
                ret=1
        fi
 
-       ${DIFF} "${srcdir}/${p8}.txt" out
+       ${DIFF} "${srcdir}/data/${p8}.txt" $TMPFILE
        rc=$?
        if test ${rc} != 0; then
-               cat out
+               cat $TMPFILE
                echo "PKCS8 FATAL TXT ${p8}"
                ret=1
        fi
 done
-rm -f out
+rm -f $TMPFILE
 
 echo "PKCS8 DONE (rc $ret)"
 exit $ret
diff --git a/tests/pkcs8-decode/Makefile.am b/tests/pkcs8-decode/Makefile.am
deleted file mode 100644 (file)
index d0e70ea..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-## Process this file with automake to produce Makefile.in
-# Copyright (C) 2006, 2010, 2012 Free Software Foundation, Inc.
-#
-# Author: Simon Josefsson
-#
-# 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.
-
-EXTRA_DIST = suppressions.valgrind encpkcs8.pem unencpkcs8.pem enc2pkcs8.pem \
-       openssl-3des.p8 openssl-3des.p8.txt \
-       openssl-aes128.p8 openssl-aes128.p8.txt \
-       openssl-aes256.p8 openssl-aes256.p8.txt
-
-dist_check_SCRIPTS = pkcs8
-
-TESTS = pkcs8
-
-TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT) \
-       LC_ALL="C"                                              \
-       VALGRIND="$(VALGRIND)"                          \
-       top_builddir="$(top_builddir)"                          \
-       srcdir="$(srcdir)"
diff --git a/tests/pkcs8-decode/suppressions.valgrind b/tests/pkcs8-decode/suppressions.valgrind
deleted file mode 100644 (file)
index e69de29..0000000