[pkg-opensc-commit] [engine-pkcs11] 16/43: Testing infrastructure updated

Eric Dorland eric at moszumanska.debian.org
Sun Jan 31 06:38:47 UTC 2016


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository engine-pkcs11.

commit e357e53d93df49a144d5ac7b4bfe1a0c3992a9e5
Author: Michał Trojnara <Michal.Trojnara at stunnel.org>
Date:   Wed Jan 6 12:56:07 2016 +0100

    Testing infrastructure updated
---
 tests/common.sh  |  19 +++++++++++++++++--
 tests/pubkey.der | Bin 0 -> 294 bytes
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/tests/common.sh b/tests/common.sh
index 9996f4f..7f70e63 100644
--- a/tests/common.sh
+++ b/tests/common.sh
@@ -19,7 +19,7 @@
 
 mkdir -p $outdir
 
-for i in /usr/lib64/pkcs11 /usr/lib/softhsm /usr/lib/x86_64-linux-gnu/softhsm /usr/lib /usr/lib64/softhsm;do
+for i in /usr/lib64/pkcs11 /usr/lib/softhsm /usr/local/lib/softhsm /opt/local/lib/softhsm /usr/lib/x86_64-linux-gnu/softhsm /usr/lib /usr/lib64/softhsm;do
 	if test -f "$i/libsofthsm2.so"; then
 		ADDITIONAL_PARAM="$i/libsofthsm2.so"
 		break
@@ -31,7 +31,7 @@ for i in /usr/lib64/pkcs11 /usr/lib/softhsm /usr/lib/x86_64-linux-gnu/softhsm /u
 	fi
 done
 
-if ! test -x /usr/bin/pkcs11-tool;then
+if (! test -x /usr/bin/pkcs11-tool && ! test -x /usr/local/bin/pkcs11-tool);then
 	exit 77
 fi
 
@@ -39,6 +39,16 @@ init_card () {
 	PIN="$1"
 	PUK="$2"
 
+	if test -x "/usr/local/bin/softhsm2-util"; then
+		export SOFTHSM2_CONF="$outdir/softhsm-testpkcs11.config"
+		SOFTHSM_TOOL="/usr/local/bin/softhsm2-util"
+	fi
+
+	if test -x "/opt/local/bin/softhsm2-util"; then
+		export SOFTHSM2_CONF="$outdir/softhsm-testpkcs11.config"
+		SOFTHSM_TOOL="/opt/local/bin/softhsm2-util"
+	fi
+
 	if test -x "/usr/bin/softhsm2-util"; then
 		export SOFTHSM2_CONF="$outdir/softhsm-testpkcs11.config"
 		SOFTHSM_TOOL="/usr/bin/softhsm2-util"
@@ -85,6 +95,11 @@ if test $? != 0;then
 	exit 1;
 fi
 
+pkcs11-tool -p $PIN --module $ADDITIONAL_PARAM -d 00010203 -a server-key -l -w ${file_dir}/pubkey.der -y pubkey >/dev/null
+if test $? != 0;then
+	exit 1;
+fi
+
 pkcs11-tool -p $PIN --module $ADDITIONAL_PARAM -d 00010203 -a server-key -l -w ${file_dir}/cert.der -y cert >/dev/null
 if test $? != 0;then
 	exit 1;
diff --git a/tests/pubkey.der b/tests/pubkey.der
new file mode 100644
index 0000000..0b9a0d4
Binary files /dev/null and b/tests/pubkey.der differ

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/engine-pkcs11.git



More information about the pkg-opensc-commit mailing list