test_require_bin knotd
-# We need at least Knot 3.0 which support (among others) the ds-push directive
-if ! knotc -c "${TEST_BASE_DIR:?}/knot-data/knot.conf" conf-check; then
- echo "This test requires at least Knot 3.0. skipping..."
- exit 0
-fi
-
test_append_files() {
- local workspace="${1:?}"
# Install knot
image_install kzonecheck keymgr kjournalprint knotc knotd
image_install "${ROOTLIBDIR:?}/system/knot.service"
image_install -o /etc/dbus-1/system.d/cz.nic.knotd.conf
image_install -o /etc/default/knot
- # Copy over our configuration
- mkdir -p "${workspace:?}/var/lib/knot/zones/" "${workspace:?}/etc/knot/"
- cp -rfv "${TEST_BASE_DIR:?}"/knot-data/zones/* "$workspace/var/lib/knot/zones/"
- cp -fv "${TEST_BASE_DIR:?}/knot-data/knot.conf" "$workspace/etc/knot/knot.conf"
- chgrp -R knot "$workspace/etc/knot/" "$workspace/var/lib/knot/"
- chmod -R ug+rwX "$workspace/var/lib/knot/"
- chmod -R g+r "$workspace/etc/knot/"
-
# Install DNS-related utilities (usually found in the bind-utils package)
image_install delv dig host nslookup
# shellcheck source=test/units/util.sh
. "$(dirname "$0")"/util.sh
+# We need at least Knot 3.0 which support (among others) the ds-push directive
+if ! knotc -c /usr/lib/systemd/tests/testdata/knot-data/knot.conf conf-check; then
+ echo "This test requires at least Knot 3.0. skipping..." | tee --append /skipped
+ exit 77
+fi
+
RUN_OUT="$(mktemp)"
run() {
mkdir -p "/etc/dnssec-trust-anchors.d/"
echo local >/etc/dnssec-trust-anchors.d/local.negative
+# Copy over our knot configuration
+mkdir -p /var/lib/knot/zones/ /etc/knot/
+cp -rfv /usr/lib/systemd/tests/testdata/knot-data/zones/* /var/lib/knot/zones/
+cp -fv /usr/lib/systemd/tests/testdata/knot-data/knot.conf /etc/knot/knot.conf
+chgrp -R knot /etc/knot/ /var/lib/knot/
+chmod -R ug+rwX /var/lib/knot/
+chmod -R g+r /etc/knot/
+
# Sign the root zone
keymgr . generate algorithm=ECDSAP256SHA256 ksk=yes zsk=yes
# Create a trust anchor for resolved with our root zone
/usr/lib/systemd/systemd-networkd-wait-online --interface=dns1:routable --timeout=60
systemctl reload systemd-resolved
systemctl start resolved-dummy-server
+
# Create knot's runtime dir, since from certain version it's provided only by
# the package and not created by tmpfiles/systemd
if [[ ! -d /run/knot ]]; then