diff --git a/bind-9.11-kyua-pkcs11.patch b/bind-9.11-kyua-pkcs11.patch index 7567c2a..ab21828 100644 --- a/bind-9.11-kyua-pkcs11.patch +++ b/bind-9.11-kyua-pkcs11.patch @@ -1,4 +1,4 @@ -From 55f9cce403c6aa66218fe50073419f20632de0ce Mon Sep 17 00:00:00 2001 +From d0433a314534e104f52acf2a0a96a68dd84305ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 2 Jan 2018 18:13:07 +0100 Subject: [PATCH] Fix pkcs11 variants atf tests @@ -8,18 +8,19 @@ Add dns-pkcs11 tests Makefile to configure Add pkcs11 Kyuafile, fix dh_test to pass in pkcs11 mode --- configure.in | 1 + + lib/Atffile | 2 ++ lib/Kyuafile | 2 ++ lib/dns-pkcs11/tests/Makefile.in | 10 +++++----- lib/dns-pkcs11/tests/dh_test.c | 3 ++- lib/isc-pkcs11/tests/Makefile.in | 6 +++--- lib/isc-pkcs11/tests/hash_test.c | 32 +++++++++++++++++++++++++------- - 6 files changed, 38 insertions(+), 16 deletions(-) + 7 files changed, 40 insertions(+), 16 deletions(-) diff --git a/configure.in b/configure.in -index 0940743..692373e 100644 +index 67b3aab..4767eeb 100644 --- a/configure.in +++ b/configure.in -@@ -5252,6 +5252,7 @@ AC_CONFIG_FILES([ +@@ -5579,6 +5579,7 @@ AC_CONFIG_FILES([ lib/dns-pkcs11/include/Makefile lib/dns-pkcs11/include/dns/Makefile lib/dns-pkcs11/include/dst/Makefile @@ -27,6 +28,20 @@ index 0940743..692373e 100644 lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile +diff --git a/lib/Atffile b/lib/Atffile +index 93bbb01..4db3dce 100644 +--- a/lib/Atffile ++++ b/lib/Atffile +@@ -3,7 +3,9 @@ Content-Type: application/X-atf-atffile; version="1" + prop: test-suite = bind9 + + tp: dns ++tp: dns-pkcs11 + tp: irs + tp: isc ++tp: isc-pkcs11 + tp: isccfg + tp: lwres diff --git a/lib/Kyuafile b/lib/Kyuafile index ff9fc56..eaaf0dc 100644 --- a/lib/Kyuafile @@ -42,7 +57,7 @@ index ff9fc56..eaaf0dc 100644 include('isccfg/Kyuafile') include('lwres/Kyuafile') diff --git a/lib/dns-pkcs11/tests/Makefile.in b/lib/dns-pkcs11/tests/Makefile.in -index c7fd4ed..7b25d8c 100644 +index 2a6571b..f25a784 100644 --- a/lib/dns-pkcs11/tests/Makefile.in +++ b/lib/dns-pkcs11/tests/Makefile.in @@ -20,12 +20,12 @@ VERSION=@BIND9_VERSION@ @@ -78,7 +93,7 @@ index 036d27a..eb6554f 100644 dst_key_free(&key); dns_test_end(); diff --git a/lib/isc-pkcs11/tests/Makefile.in b/lib/isc-pkcs11/tests/Makefile.in -index 500e853..8b02f03 100644 +index f7fa538..818dae4 100644 --- a/lib/isc-pkcs11/tests/Makefile.in +++ b/lib/isc-pkcs11/tests/Makefile.in @@ -17,10 +17,10 @@ VERSION=@BIND9_VERSION@ @@ -96,10 +111,10 @@ index 500e853..8b02f03 100644 LIBS = @LIBS@ @ATFLIBS@ diff --git a/lib/isc-pkcs11/tests/hash_test.c b/lib/isc-pkcs11/tests/hash_test.c -index 0c287e8..bd56d4d 100644 +index 5b8a374..c1891c2 100644 --- a/lib/isc-pkcs11/tests/hash_test.c +++ b/lib/isc-pkcs11/tests/hash_test.c -@@ -78,7 +78,7 @@ typedef struct hash_testcase { +@@ -74,7 +74,7 @@ typedef struct hash_testcase { typedef struct hash_test_key { const char *key; @@ -108,7 +123,7 @@ index 0c287e8..bd56d4d 100644 } hash_test_key_t; /* non-hmac tests */ -@@ -961,8 +961,11 @@ ATF_TC_BODY(isc_hmacsha1, tc) { +@@ -957,8 +957,11 @@ ATF_TC_BODY(isc_hmacsha1, tc) { hash_test_key_t *test_key = test_keys; while (testcase->input != NULL && testcase->result != NULL) { @@ -121,7 +136,7 @@ index 0c287e8..bd56d4d 100644 isc_hmacsha1_update(&hmacsha1, (const isc_uint8_t *) testcase->input, testcase->input_len); -@@ -1124,8 +1127,11 @@ ATF_TC_BODY(isc_hmacsha224, tc) { +@@ -1120,8 +1123,11 @@ ATF_TC_BODY(isc_hmacsha224, tc) { hash_test_key_t *test_key = test_keys; while (testcase->input != NULL && testcase->result != NULL) { @@ -134,7 +149,7 @@ index 0c287e8..bd56d4d 100644 isc_hmacsha224_update(&hmacsha224, (const isc_uint8_t *) testcase->input, testcase->input_len); -@@ -1287,8 +1293,11 @@ ATF_TC_BODY(isc_hmacsha256, tc) { +@@ -1283,8 +1289,11 @@ ATF_TC_BODY(isc_hmacsha256, tc) { hash_test_key_t *test_key = test_keys; while (testcase->input != NULL && testcase->result != NULL) { @@ -147,7 +162,7 @@ index 0c287e8..bd56d4d 100644 isc_hmacsha256_update(&hmacsha256, (const isc_uint8_t *) testcase->input, testcase->input_len); -@@ -1456,8 +1465,11 @@ ATF_TC_BODY(isc_hmacsha384, tc) { +@@ -1452,8 +1461,11 @@ ATF_TC_BODY(isc_hmacsha384, tc) { hash_test_key_t *test_key = test_keys; while (testcase->input != NULL && testcase->result != NULL) { @@ -160,7 +175,7 @@ index 0c287e8..bd56d4d 100644 isc_hmacsha384_update(&hmacsha384, (const isc_uint8_t *) testcase->input, testcase->input_len); -@@ -1625,8 +1637,11 @@ ATF_TC_BODY(isc_hmacsha512, tc) { +@@ -1621,8 +1633,11 @@ ATF_TC_BODY(isc_hmacsha512, tc) { hash_test_key_t *test_key = test_keys; while (testcase->input != NULL && testcase->result != NULL) { @@ -173,7 +188,7 @@ index 0c287e8..bd56d4d 100644 isc_hmacsha512_update(&hmacsha512, (const isc_uint8_t *) testcase->input, testcase->input_len); -@@ -1769,8 +1784,11 @@ ATF_TC_BODY(isc_hmacmd5, tc) { +@@ -1765,8 +1780,11 @@ ATF_TC_BODY(isc_hmacmd5, tc) { hash_test_key_t *test_key = test_keys; while (testcase->input != NULL && testcase->result != NULL) { diff --git a/bind.spec b/bind.spec index 6ee6567..e945794 100644 --- a/bind.spec +++ b/bind.spec @@ -19,6 +19,11 @@ %bcond_with LMDB %bcond_with DLZ %bcond_without EXPORT_LIBS +%if 0%{?fedora} >= 17 +%bcond_without KYUA +%else +%bcond_with KYUA +%endif %{?!bind_uid: %global bind_uid 25} %{?!bind_gid: %global bind_gid 25} @@ -39,7 +44,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv Name: bind License: MPLv2.0 Version: 9.11.3 -Release: 6%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} +Release: 7%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: http://www.isc.org/products/BIND/ # @@ -140,7 +145,7 @@ BuildRequires: findutils sed BuildRequires: openldap-devel, postgresql-devel, sqlite-devel, mariadb-connector-c-devel BuildRequires: libdb-devel %endif -%if %{with UNITTEST} +%if %{with KYUA} # make unit dependencies BuildRequires: libatf-c-devel kyua-cli %endif @@ -494,6 +499,13 @@ done cp -Tuav bin/tests "%{1}/bin/tests/" \ cp -uv version "%{1}" \ +%if %{with KYUA} +# Use system installed libatf-c library with kyua tool +ATF_PATH=/usr +%else +# Use bundled atf library with atf-run +ATF_PATH=yes +%endif export CFLAGS="$CFLAGS $RPM_OPT_FLAGS" export CPPFLAGS="$CPPFLAGS -DDIG_SIGCHASE" @@ -545,7 +557,7 @@ export LIBDIR_SUFFIX --with-lmdb=no \ %endif %if %{with UNITTEST} - --with-atf=/usr \ + --with-atf=${ATF_PATH} \ %endif --enable-fixed-rrset \ --with-docbook-xsl=%{_datadir}/sgml/docbook/xsl-stylesheets \ @@ -568,6 +580,16 @@ pushd bin/python make man popd +%if ! %{with KYUA} +# Do not build atf again for export libs +ATF_PATH="`pwd`/unit/atf" + +# Atf libs are built. Prevent their installation +sed -i -e \ +'/^SUBDIRS =/s/atf-src//i' \ +unit/Makefile +%endif + %if %{with DLZ} pushd contrib/dlz pushd bin/dlzbdb @@ -605,7 +627,7 @@ export LIBDIR_SUFFIX --disable-isc-spnego \ %endif %if %{with UNITTEST} - --with-atf=/usr \ + --with-atf=${ATF_PATH} \ %endif --enable-fixed-rrset \ --disable-rpz-nsip \ @@ -629,6 +651,10 @@ sed -i -e \ "/^SUBDIRS =/s/.*/SUBDIRS = %{bind_export_libs}/i" \ lib/Makefile +sed -i -e \ +'/^SUBDIRS =/s/atf-src//i' \ +unit/Makefile + for lib in %{bind_export_libs} do find . -name Makefile -exec sed "s/lib${lib}\./lib${lib}-export\./g" -i {} \; @@ -642,9 +668,11 @@ popd # export library unit tests %unit_prepare_build export-libs -# Do not try pkcs11 in export libs +# Do not try pkcs11 and lwres in export libs sed -e '/^\s*include(.*-pkcs11/ d' -e '/^\s*include(.*lwres/ d' \ -i export-libs/lib/Kyuafile +sed -e '/^tp:.*-pkcs11/ d' -e '/^tp:\s*lwres/ d' \ + -i export-libs/lib/Atffile ## End of export libs %endif @@ -1364,6 +1392,9 @@ rm -rf ${RPM_BUILD_ROOT} %changelog +* Mon Apr 09 2018 Petr Menšík - 32:9.11.3-7 +- Run tests also without kyua + * Thu Apr 05 2018 Petr Menšík - 32:9.11.3-6 - Do not link libidn2 to all libraries (#1098783) - Update named.ca