diff --git a/01-test_net-disable-udp-send-on-unconnected.patch b/01-test_net-disable-udp-send-on-unconnected.patch index 07a2f3a..f2b5b11 100644 --- a/01-test_net-disable-udp-send-on-unconnected.patch +++ b/01-test_net-disable-udp-send-on-unconnected.patch @@ -1,4 +1,3 @@ -commit 44b5e271a8564370efec3b9e95365aa039e0db61 Author: Tomas Krizek Date: 2019-02-28 14:26:56 +0100 @@ -11,16 +10,16 @@ Date: 2019-02-28 14:26:56 +0100 Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1675235 diff --git a/tests/contrib/test_net.c b/tests/contrib/test_net.c -index 99a9e3ee3..c8e5e0a25 100644 +index 0a22abbbc..6ec4bda31 100644 --- a/tests/contrib/test_net.c +++ b/tests/contrib/test_net.c @@ -310,10 +310,6 @@ static void test_unconnected(void) r = net_dgram_recv(sock, buffer, buffer_len, TIMEOUT_SHORT); - ok(r == KNOT_ETIMEOUT, "UDP, receive timeout on unconnected socket"); + is_int(KNOT_ETIMEOUT, r, "UDP, receive timeout on unconnected socket"); - struct sockaddr_storage server_addr = addr_from_socket(server); - r = net_dgram_send(sock, buffer, buffer_len, &server_addr); -- ok(r == buffer_len, "UDP, send on defined address"); +- is_int(buffer_len, r, "UDP, send on defined address"); - close(sock); diff --git a/knot.spec b/knot.spec index 1339843..f381339 100644 --- a/knot.spec +++ b/knot.spec @@ -2,12 +2,12 @@ %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}} %define GPG_CHECK 1 -%define VERSION 3.0.0 +%define BASE_VERSION %(echo "%{version}" | sed 's/^\\([^.]\\+\\.[^.]\\+\\).*/\\1/') %define repodir %{_builddir}/%{name}-%{version} Summary: High-performance authoritative DNS server Name: knot -Version: %{VERSION} +Version: 3.1.4 Release: 1%{?dist} License: GPL-3.0-or-later URL: https://www.knot-dns.cz @@ -26,6 +26,10 @@ BuildRequires: gnupg2 Patch1: 01-test_net-disable-udp-send-on-unconnected.patch # Required dependencies +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool +BuildRequires: make BuildRequires: gcc BuildRequires: pkgconfig(liburcu) BuildRequires: pkgconfig(gnutls) >= 3.3 @@ -33,20 +37,23 @@ BuildRequires: pkgconfig(libedit) # Optional dependencies BuildRequires: pkgconfig(libcap-ng) -BuildRequires: pkgconfig(libfstrm) BuildRequires: pkgconfig(libidn2) -BuildRequires: pkgconfig(libmaxminddb) +BuildRequires: pkgconfig(libmnl) BuildRequires: pkgconfig(libnghttp2) -BuildRequires: pkgconfig(libprotobuf-c) BuildRequires: pkgconfig(libsystemd) BuildRequires: pkgconfig(systemd) +# dnstap dependencies +BuildRequires: pkgconfig(libfstrm) +BuildRequires: pkgconfig(libprotobuf-c) +# geoip dependencies +BuildRequires: pkgconfig(libmaxminddb) # Distro-dependent dependencies %if 0%{?suse_version} BuildRequires: python3-Sphinx BuildRequires: lmdb-devel BuildRequires: protobuf-c -Requires(pre): pwdutils +Requires(pre): pwdutils %endif %if 0%{?rhel} && 0%{?rhel} <= 7 BuildRequires: python-sphinx @@ -56,12 +63,21 @@ BuildRequires: lmdb-devel BuildRequires: python3-sphinx BuildRequires: pkgconfig(lmdb) %endif + +%if 0%{?centos} == 7 || 0%{?rhel} == 7 +# disable XDP on old EL +%define configure_xdp --enable-xdp=no +%else +%define use_xdp 1 %if 0%{?rhel} >= 8 || 0%{?suse_version} +# enable XDP on recent EL using embedded libbpf +%define use_xdp 1 %define configure_xdp --enable-xdp=yes BuildRequires: pkgconfig(libelf) +%else +# XDP is auto-enabled when libbpf is present +BuildRequires: pkgconfig(libbpf) >= 0.0.6 %endif -%if 0%{?fedora} >= 31 -BuildRequires: pkgconfig(libbpf) >= 0.0.6 %endif Requires(post): systemd %{_sbindir}/runuser @@ -98,6 +114,20 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description utils The package contains DNS client utilities shipped with the Knot DNS server. +%package module-dnstap +Summary: dnstap module for Knot DNS +Requires: %{name} = %{version}-%{release} + +%description module-dnstap +The package contains dnstap Knot DNS module for logging DNS traffic. + +%package module-geoip +Summary: geoip module for Knot DNS +Requires: %{name} = %{version}-%{release} + +%description module-geoip +The package contains geoip Knot DNS module for geography-based responses. + %package doc Summary: Documentation for the Knot DNS server BuildArch: noarch @@ -115,8 +145,7 @@ mkdir --mode=700 ${GNUPGHOME} gpg2 --import %{SOURCE100} gpg2 --verify %{SOURCE1} %{SOURCE0} %endif -%setup -q -%patch1 -p1 +%autosetup -p1 %build # disable debug code (causes unused warnings) @@ -133,12 +162,14 @@ CFLAGS="%{optflags} -DNDEBUG -Wno-unused" --localstatedir=/var/lib \ --libexecdir=/usr/lib/knot \ --with-rundir=/run/knot \ + --with-moduledir=%{_libdir}/knot/modules-%{BASE_VERSION} \ --with-storage=/var/lib/knot \ %{?configure_db_sizes} \ %{?configure_xdp} \ --disable-static \ --enable-dnstap=yes \ - --with-module-dnstap=yes + --with-module-dnstap=shared \ + --with-module-geoip=shared make %{?_smp_mflags} make html @@ -164,16 +195,15 @@ install -p -m 0644 -D %{repodir}/distro/common/%{name}.tmpfiles %{buildroot}%{_t ln -s service %{buildroot}/%{_sbindir}/rcknot %endif -# create storage dir and key dir +# create storage dir install -d %{buildroot}%{_sharedstatedir} -install -d -m 0775 -D %{buildroot}%{_sharedstatedir}/%{name} -install -d -m 0770 -D %{buildroot}%{_sharedstatedir}/%{name}/keys +install -d -m 0770 -D %{buildroot}%{_sharedstatedir}/knot # remove libarchive files find %{buildroot} -type f -name "*.la" -delete -print %check -make check +V=1 make check %pre getent group knot >/dev/null || groupadd -r knot @@ -215,15 +245,15 @@ systemd-tmpfiles --create %{_tmpfilesdir}/knot.conf &>/dev/null || : %files %license COPYING -%{_pkgdocdir}/NEWS -%{_pkgdocdir}/README.md -%{_pkgdocdir}/samples -%dir %attr(750,root,knot) %{_sysconfdir}/%{name} -%config(noreplace) %attr(640,root,knot) %{_sysconfdir}/%{name}/%{name}.conf -%dir %attr(775,root,knot) %{_sharedstatedir}/%{name} -%dir %attr(770,root,knot) %{_sharedstatedir}/%{name}/keys +%doc %{_pkgdocdir} +%exclude %{_pkgdocdir}/html +%attr(770,root,knot) %dir %{_sysconfdir}/knot +%config(noreplace) %attr(640,root,knot) %{_sysconfdir}/knot/knot.conf +%attr(770,root,knot) %dir %{_sharedstatedir}/knot +%dir %{_libdir}/knot +%dir %{_libdir}/knot/modules-* %{_unitdir}/knot.service -%{_tmpfilesdir}/%{name}.conf +%{_tmpfilesdir}/knot.conf %{_bindir}/kzonecheck %{_bindir}/kzonesign %{_sbindir}/kcatalogprint @@ -242,15 +272,14 @@ systemd-tmpfiles --create %{_tmpfilesdir}/knot.conf &>/dev/null || : %{_mandir}/man8/keymgr.* %{_mandir}/man8/knotc.* %{_mandir}/man8/knotd.* -%{_mandir}/man8/knotd.* -%ghost /run/knot +%ghost %attr(770,root,knot) %dir %{_rundir}/knot %files utils %{_bindir}/kdig %{_bindir}/khost %{_bindir}/knsec3hash %{_bindir}/knsupdate -%if 0%{?rhel} >= 8 || 0%{?suse_version} || 0%{?fedora} >= 31 +%if 0%{?use_xdp} %{_sbindir}/kxdpgun %{_mandir}/man8/kxdpgun.* %endif @@ -259,6 +288,12 @@ systemd-tmpfiles --create %{_tmpfilesdir}/knot.conf &>/dev/null || : %{_mandir}/man1/knsec3hash.* %{_mandir}/man1/knsupdate.* +%files module-dnstap +%{_libdir}/knot/modules-*/dnstap.so + +%files module-geoip +%{_libdir}/knot/modules-*/geoip.so + %files libs %license COPYING %doc NEWS @@ -282,9 +317,72 @@ systemd-tmpfiles --create %{_tmpfilesdir}/knot.conf &>/dev/null || : %files doc %dir %{_pkgdocdir} -%{_pkgdocdir}/html +%doc %{_pkgdocdir}/html %changelog +* Thu Nov 04 2021 Jakub Ružička - 3.1.4-1 +- Update to 3.1.4 + +* Tue Oct 19 2021 Jakub Ružička - 3.1.3-1 +- Update to 3.1.3 + +* Thu Sep 09 2021 Jakub Ružička - 3.1.2-1 +- Update to 3.1.2 + +* Tue Aug 10 2021 Jakub Ružička - 3.1.1-1 +- Update to 3.1.1 +- Enable XDP on ARM and improve XDP config macros +- Remove patch included upstream + +* Wed Aug 04 2021 Jakub Ružička 3.1.0-2 +- Introduce a patch to fix tests on ppc64le +- Use autosetup macro to apply patches + +* Mon Aug 02 2021 Jakub Ružička - 3.1.0-1 +- Update to 3.1.0 +- Add missing BuildRequires including new libmnl for kxdpgun +- Temporarily disable XDP on ARM until issues are resolved + +* Fri Jul 16 2021 Jakub Ružička - 3.0.8-1 +- Update to 3.0.8 +- Print failed tests during check + +* Thu Jun 17 2021 Jakub Ružička - 3.0.7-1 +- Update to 3.0.7 + +* Fri May 14 2021 Jakub Ružička - 3.0.6-1 +- Update to 3.0.6 + +* Tue Mar 30 2021 Jakub Ružička 3.0.5-1 +- Update to 3.0.5 +- Properly escape BASE_VERSION macro +- Include module dirs in main package + +* Mon Feb 01 2021 Jakub Ružička - 3.0.4-1 +- Update to 3.0.4 +- Move dnstap module to subpackage +- Move geoip module to subpackage +- Remove redundant VERSION macro + +* Thu Dec 17 2020 Jakub Ružička - 3.0.3-1 +- Update to 3.0.3 + +* Wed Nov 11 2020 Jakub Ružička - 3.0.2-2 +- Remove patch included in upstream release + +* Wed Nov 11 2020 Jakub Ružička - 3.0.2-1 +- Update to 3.0.2 + +* Thu Oct 29 2020 Jakub Ružička - 3.0.1-2 +- Respect GnuTLS insecure algorithms + +* Mon Oct 12 2020 Jakub Ružička - 3.0.1-1 +- Update to 3.0.1 +- Sync packaging from upstream + +* Tue Oct 06 2020 Jakub Ružička 3.0.0-2 +- Rebuild for new bodhi update + * Thu Sep 10 2020 Jakub Ružička 3.0.0-1 - New major upstream release 3.0.0 - Sync packaging from upstream diff --git a/sources b/sources index 46e6adf..ba003c9 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (knot-3.0.0.tar.xz) = 286861e4127f8c70eeba1e76f2de82e8f89d4c15d2dc3733902f8d19103f6a44b9da97a91bc99168fd4f6024d60b8bc53a78580ed04a6e9cbf8c6ad921780c81 -SHA512 (knot-3.0.0.tar.xz.asc) = c3320ce2daf8f84e00ea40e08d89d07ec40530bc860f30e4489d44bcfa296c2954bcb431db793121c0b1aa2ff1f71a343f58492df87893f5fcf85f2470d70d13 +SHA512 (knot-3.1.4.tar.xz) = 307667a12b989fee443832d4642fc927231f38f0331439c8c7196c489d196245eca368d96a36fe49639b773f652f7cb80bf0c16bc1ad107e11b47b70e1f04060 +SHA512 (knot-3.1.4.tar.xz.asc) = 590122df8b83ad9d3bc30b29dbf273b74cc1b3b13e1b38b14b9c567d66db7d7ab93d55ffdfd50a18f579efc66531c0ae11ff30ffc5ec989f07e31bd029d85663 diff --git a/tests/README.md b/tests/README.md index c52e8a5..e1d6352 100644 --- a/tests/README.md +++ b/tests/README.md @@ -2,7 +2,7 @@ Package tests ============= These tests implement the standard test interface in Fedora CI. -See https://fedoraproject.org/wiki/CI/Tests for details. +See https://docs.fedoraproject.org/en-US/ci/tests/ for details. Manual execution ---------------- @@ -12,11 +12,3 @@ modifications to your system. It's best to run these on a clean, throw-away testing system or a VM. ansible-playbook tests/tests.yml -e subjects=/path/to/knot.rpm,/path/to/knot-libs.rpm -e artifacts=/path/to/artifacts - -Automatic execution -------------------- - -These tests should eventually be automatically executed by the Fedora CI -pipeline. As of 2018-01-10, it is not supported for packages that aren't part -of Fedora Atomic. Once it is implemented, the results of these tests should be -visible in dist-git commits on src.fedoraproject.org diff --git a/tests/scripts/test_basic_zone.sh b/tests/scripts/test_basic_zone.sh new file mode 100755 index 0000000..9c08f0e --- /dev/null +++ b/tests/scripts/test_basic_zone.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# test basic system-wide functionality of Knot DNS +set -ex + +# create zone file from examples +cp /usr/share/doc/knot/samples/example.com.zone /var/lib/knot/example.com.zone +# configure knot to serve example.com zone using dark sed magic +sed 's/^#\?\([ \t]*-[ \t]*domain:[ \t]\+example.com\)[ \t]*$/\1/' -i /etc/knot/knot.conf + +# (re)start knotd +systemctl stop knot.service +systemctl start knot.service || systemctl status knot.service + +# check valid query is answered +dig @127.0.0.1 example.com | grep NOERROR + +# check query for non-existent zone is refused +dig @127.0.0.1 bad-example.com | grep REFUSED diff --git a/tests/test_basic_zone.yml b/tests/test_basic_zone.yml deleted file mode 100644 index 0f75c94..0000000 --- a/tests/test_basic_zone.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -- block: - - name: create zone file - shell: cp /usr/share/doc/knot/samples/example.com.zone /var/lib/knot/example.com.zone - - - name: configure knot to serve example.com zone - lineinfile: - path: /etc/knot/knot.conf - regexp: '^#? - domain: example.com$' - state: present - line: ' - domain: example.com' - - - name: start knot.service - service: - name: knot.service - state: restarted - - - name: check if query is answered - shell: dig @127.0.0.1 example.com - register: res - failed_when: "'NOERROR' not in res.stdout" - - - name: check query for non-existent zone is refused - shell: dig @127.0.0.1 example2.com - register: res - failed_when: "'REFUSED' not in res.stdout" - - rescue: - - set_fact: - test_basic_zone_failed: true - always: - - name: collect journal - shell: journalctl --since -10m > {{ artifacts }}/test_basic_zone_journal.log diff --git a/tests/tests.yml b/tests/tests.yml index b86e45f..8cf0411 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -1,25 +1,15 @@ --- - hosts: localhost remote_user: root - pre_tasks: - - package: # Install additional dependecies - name: bind-utils - state: latest roles: - - role: standard-test-rpm + - role: standard-test-basic tags: - classic - tasks: - - include_tasks: test_basic_zone.yml - - - set_fact: - tests_passed: '{{ test_basic_zone_failed is undefined }}' - - name: report results - debug: - msg: | - test_basic_zone: {{ 'FAILED' if test_basic_zone_failed is defined else 'OK'}} - - - name: fail playbook if tests failed - debug: - msg: --- {{ 'PASSED' if tests_passed else 'FAILED' }} --- - failed_when: not tests_passed + required_packages: + - bind-utils + tests: + - knotd-show-version: + run: knotd --version + - basic-zone: + dir: scripts + run: ./test_basic_zone.sh