[xml/sgml-commit] [xmlsec1] 32/32: Enable test suite execution during package build (closes: #774631)

Rene Engelhard rene at moszumanska.debian.org
Sun Jun 25 17:46:37 UTC 2017


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

rene pushed a commit to branch experimental
in repository xmlsec1.

commit e354fff1cd0a120b077527ca0522b574accbfbaf
Author: Rene Engelhard <rene at rene-engelhard.de>
Date:   Fri Jun 23 12:38:09 2017 +0000

    Enable test suite execution during package build (closes: #774631)
---
 debian/changelog                        |   3 +
 debian/patches/series                   |   2 +
 debian/patches/skip-failing-tests.patch |  45 +++++++
 debian/patches/skip-online-tests.patch  | 209 ++++++++++++++++++++++++++++++++
 debian/rules                            |   8 ++
 5 files changed, 267 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 4d74f97..e94ed75 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,9 @@ xmlsec1 (1.2.24-1) unstable; urgency=medium
   * move Maintainer: to Debian XML/SGML Group <debian-xml-sgml-pkgs at lists.alioth.debian.org>;
     keep John in Uploaders: and add me
 
+  * merge from Ubuntu:
+    - Enable test suite execution during package build (closes: #774631)
+
  -- Rene Engelhard <rene at debian.org>  Thu, 22 Jun 2017 18:54:56 +0200
 
 xmlsec1 (1.2.23-0.1) unstable; urgency=medium
diff --git a/debian/patches/series b/debian/patches/series
index e69de29..c05b2b4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+skip-failing-tests.patch
+skip-online-tests.patch
diff --git a/debian/patches/skip-failing-tests.patch b/debian/patches/skip-failing-tests.patch
new file mode 100644
index 0000000..d99d2a2
--- /dev/null
+++ b/debian/patches/skip-failing-tests.patch
@@ -0,0 +1,45 @@
+Description: Skip failing tests due to disabled lib plugins
+ Some tests require of dynamic loading of crypto libraries
+ in xmlsec1 apps - we disable this in the build, so only test
+ with the default openssl lib.
+Author: James Page <james.page at ubuntu.com>
+Forwarded: not-needed
+
+--- a/tests/testDSig.sh
++++ b/tests/testDSig.sh
+@@ -788,6 +788,8 @@ execDSigTest $res_success \
+ # test dynamic signature
+ #
+ ##########################################################################
++
++if [ $crypto = 'openssl' ]; then
+ echo "Dynamic signature template"
+ printf "    Create new signature                                 "
+ echo "$xmlsec_app sign-tmpl $xmlsec_params --keys-file $keysfile --output $tmpfile" >> $logfile
+@@ -797,6 +799,7 @@ printf "    Verify new signature
+ echo "$xmlsec_app verify --keys-file $keysfile $tmpfile" >> $logfile
+ $VALGRIND $xmlsec_app verify $xmlsec_params --keys-file $keysfile $tmpfile >> $logfile 2>> $logfile
+ printRes $res_success $?
++fi
+ 
+ 
+ ##########################################################################
+--- a/tests/testEnc.sh
++++ b/tests/testEnc.sh
+@@ -366,6 +366,8 @@ execEncTest $res_success \
+ # test dynamicencryption
+ #
+ ##########################################################################
++
++if [ $crypto = 'openssl' ]; then
+ echo "Dynamic encryption template"
+ printf "    Encrypt template                                     "
+ echo "$xmlsec_app encrypt-tmpl $xmlsec_params --keys-file $keysfile --output $tmpfile" >> $logfile
+@@ -375,6 +377,7 @@ printf "    Decrypt document
+ echo "$xmlsec_app decrypt $xmlsec_params $keysfile $tmpfile" >> $logfile
+ $VALGRIND $xmlsec_app decrypt $xmlsec_params --keys-file $keysfile $tmpfile >> $logfile 2>> $logfile
+ printRes $res_success $?
++fi
+ 
+ 
+ ##########################################################################
diff --git a/debian/patches/skip-online-tests.patch b/debian/patches/skip-online-tests.patch
new file mode 100644
index 0000000..3e09e18
--- /dev/null
+++ b/debian/patches/skip-online-tests.patch
@@ -0,0 +1,209 @@
+Description: Skip any online tests
+ Some tests require access to online services.
+ .
+ Use an environment variable to conditionally skip these
+ tests to support execution in offline build environments.
+Author: James Page <james.page at ubuntu.com>
+Forwarded: no
+
+--- a/tests/testDSig.sh
++++ b/tests/testDSig.sh
+@@ -418,7 +418,7 @@ execDSigTest $res_success \
+     "$priv_key_option $topfolder/keys/rsakey.$priv_key_format --pwd secret123" \
+     " "
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "" \
+     "merlin-xmldsig-twenty-three/signature-external-b64-dsa" \
+     "base64 sha1 dsa-sha1" \
+@@ -427,7 +427,7 @@ execDSigTest $res_success \
+     "$priv_key_option $topfolder/keys/dsakey.$priv_key_format --pwd secret123" \
+     " "
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "" \
+     "merlin-xmldsig-twenty-three/signature-external-dsa" \
+     "sha1 dsa-sha1" \
+@@ -436,7 +436,7 @@ execDSigTest $res_success \
+     "$priv_key_option $topfolder/keys/dsakey.$priv_key_format --pwd secret123" \
+     " "
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "" \
+     "merlin-xmldsig-twenty-three/signature-keyname" \
+     "sha1 dsa-sha1" \
+@@ -445,7 +445,7 @@ execDSigTest $res_success \
+     "$priv_key_option:test-dsa $topfolder/keys/dsakey.$priv_key_format --pwd secret123" \
+     "$priv_key_option:test-dsa $topfolder/keys/dsakey.$priv_key_format --pwd secret123"
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "" \
+     "merlin-xmldsig-twenty-three/signature-x509-crt" \
+     "sha1 dsa-sha1" \
+@@ -454,7 +454,7 @@ execDSigTest $res_success \
+     "$priv_key_option $topfolder/keys/dsakey.$priv_key_format --pwd secret123"\
+     "--trusted-$cert_format $topfolder/keys/cacert.$cert_format"
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "" \
+     "merlin-xmldsig-twenty-three/signature-x509-sn" \
+     "sha1 dsa-sha1" \
+@@ -463,7 +463,7 @@ execDSigTest $res_success \
+     "$priv_key_option $topfolder/keys/dsakey.$priv_key_format --pwd secret123"\
+     "--trusted-$cert_format $topfolder/keys/cacert.$cert_format"
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "" \
+     "merlin-xmldsig-twenty-three/signature-x509-is" \
+     "sha1 dsa-sha1" \
+@@ -472,7 +472,7 @@ execDSigTest $res_success \
+     "$priv_key_option $topfolder/keys/dsakey.$priv_key_format --pwd secret123"\
+     "--trusted-$cert_format $topfolder/keys/cacert.$cert_format"
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "" \
+     "merlin-xmldsig-twenty-three/signature-x509-ski" \
+     "sha1 dsa-sha1" \
+@@ -481,7 +481,7 @@ execDSigTest $res_success \
+     "$priv_key_option $topfolder/keys/dsakey.$priv_key_format --pwd secret123"\
+     "--trusted-$cert_format $topfolder/keys/cacert.$cert_format"
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "" \
+     "merlin-xmldsig-twenty-three/signature-retrievalmethod-rawx509crt" \
+     "sha1 dsa-sha1" \
+@@ -490,7 +490,7 @@ execDSigTest $res_success \
+     "$priv_key_option $topfolder/keys/dsakey.$priv_key_format --pwd secret123"\
+     "--trusted-$cert_format $topfolder/keys/cacert.$cert_format --trusted-$cert_format $topfolder/keys/ca2cert.$cert_format"
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "" \
+     "merlin-xmldsig-twenty-three/signature" \
+     "base64 xpath enveloped-signature c14n-with-comments sha1 dsa-sha1" \
+@@ -509,7 +509,7 @@ execDSigTest $res_success \
+ # key transport/wrapper algorightms
+ #
+ ##########################################################################
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "" \
+     "merlin-xmlenc-five/encsig-ripemd160-hmac-ripemd160-kw-tripledes" \
+     "ripemd160 hmac-ripemd160 kw-tripledes" \
+@@ -614,14 +614,14 @@ execDSigTest $res_success \
+ #
+ ##########################################################################
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "phaos-xmldsig-three" \
+     "signature-big" \
+     "base64 xslt xpath sha1 rsa-sha1" \
+     "rsa x509" \
+     "--pubkey-cert-$cert_format certs/rsa-cert.$cert_format" 
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "phaos-xmldsig-three" \
+     "signature-dsa-detached" \
+     "sha1 dsa-sha1" \
+@@ -642,7 +642,7 @@ execDSigTest $res_success \
+     "dsa x509" \
+     "--trusted-$cert_format certs/dsa-ca-cert.$cert_format --verification-time 2009-01-01+10:00:00"
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "phaos-xmldsig-three" \
+     "signature-dsa-manifest" \
+     "sha1 dsa-sha1" \
+@@ -656,21 +656,21 @@ execDSigTest $res_success \
+     "hmac" \
+     "--hmackey certs/hmackey.bin"
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "phaos-xmldsig-three" \
+     "signature-hmac-sha1-40-c14n-comments-detached" \
+     "c14n-with-comments sha1 hmac-sha1" \
+     "hmac" \
+     "--hmackey certs/hmackey.bin"
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "phaos-xmldsig-three" \
+     "signature-hmac-sha1-40-exclusive-c14n-comments-detached" \
+     "exc-c14n-with-comments sha1 hmac-sha1" \
+     "hmac" \
+     "--hmackey certs/hmackey.bin"
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "phaos-xmldsig-three" \
+     "signature-hmac-sha1-exclusive-c14n-comments-detached" \
+     "exc-c14n-with-comments sha1 hmac-sha1" \
+@@ -691,7 +691,7 @@ execDSigTest $res_success \
+     "rsa x509" \
+     "--trusted-$cert_format certs/rsa-ca-cert.$cert_format --X509-skip-strict-checks --verification-time 2009-01-01+10:00:00"
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "phaos-xmldsig-three" \
+     "signature-rsa-detached" \
+     "sha1 rsa-sha1" \
+@@ -733,42 +733,42 @@ execDSigTest $res_success \
+     "rsa x509" \
+     "--trusted-$cert_format certs/rsa-ca-cert.$cert_format --X509-skip-strict-checks --verification-time 2009-01-01+10:00:00"
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "phaos-xmldsig-three" \
+     "signature-rsa-manifest-x509-data-cert-chain" \
+     "sha1 rsa-sha1" \
+     "rsa x509" \
+     "--trusted-$cert_format certs/rsa-ca-cert.$cert_format --X509-skip-strict-checks --verification-time 2009-01-01+10:00:00"
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "phaos-xmldsig-three" \
+     "signature-rsa-manifest-x509-data-cert" \
+     "sha1 rsa-sha1" \
+     "rsa x509" \
+     "--trusted-$cert_format certs/rsa-ca-cert.$cert_format --X509-skip-strict-checks --verification-time 2009-01-01+10:00:00"
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "phaos-xmldsig-three" \
+     "signature-rsa-manifest-x509-data-issuer-serial" \
+     "sha1 rsa-sha1" \
+     "rsa x509" \
+     "--trusted-$cert_format certs/rsa-ca-cert.$cert_format --untrusted-$cert_format certs/rsa-cert.$cert_format --X509-skip-strict-checks --verification-time 2009-01-01+10:00:00"
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "phaos-xmldsig-three" \
+     "signature-rsa-manifest-x509-data-ski" \
+     "sha1 rsa-sha1" \
+     "rsa x509" \
+     "--trusted-$cert_format certs/rsa-ca-cert.$cert_format --untrusted-$cert_format certs/rsa-cert.$cert_format --X509-skip-strict-checks --verification-time 2009-01-01+10:00:00"
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "phaos-xmldsig-three" \
+     "signature-rsa-manifest-x509-data-subject-name" \
+     "sha1 rsa-sha1" \
+     "rsa x509" \
+     "--trusted-$cert_format certs/rsa-ca-cert.$cert_format --untrusted-$cert_format certs/rsa-cert.$cert_format --X509-skip-strict-checks --verification-time 2009-01-01+10:00:00"
+ 
+-execDSigTest $res_success \
++[ -z "$OFFLINE" ] && execDSigTest $res_success \
+     "phaos-xmldsig-three" \
+     "signature-rsa-manifest" \
+     "sha1 rsa-sha1" \
diff --git a/debian/rules b/debian/rules
index f7105aa..8e9e0d6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,6 +5,8 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+export OFFLINE=1
+
 # These are used for cross-compiling and for saving the configure script
 # from having to guess our platform (since we know it already)
 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
@@ -44,6 +46,12 @@ build-stamp: config.status
 	# Add here commands to compile the package.
 	$(MAKE)
 
+ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
+	$(MAKE) check | tee /tmp/tests.log
+	grep -q Fail /tmp/tests.log && (echo "Failures executing unit tests, exiting build"; exit 1) \
+		|| echo "Unit tests completed successfully"
+endif
+
 	touch build-stamp
 
 clean:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-xml-sgml/xmlsec1.git



More information about the debian-xml-sgml-commit mailing list