]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/TEST-75-RESOLVED/test.sh
Merge pull request #24412 from keszybz/man-similarly
[thirdparty/systemd.git] / test / TEST-75-RESOLVED / test.sh
CommitLineData
fb6f25d7
FS
1#!/usr/bin/env bash
2# SPDX-License-Identifier: LGPL-2.1-or-later
3set -e
4
5TEST_DESCRIPTION="Tests for systemd-resolved"
6TEST_NO_QEMU=1
7NSPAWN_ARGUMENTS="--private-network"
8
9# shellcheck source=test/test-functions
10. "${TEST_BASE_DIR:?}/test-functions"
11
12if ! command -v knotd >/dev/null; then
13 echo "This test requires Knot DNS server, skipping..."
14 exit 0
15fi
16
17# We need at least Knot 3.0 which support (among others) the ds-push directive
18if ! knotc -c "${TEST_BASE_DIR:?}/knot-data/knot.conf" conf-check; then
19 echo "This test requires at least Knot 3.0. skipping..."
20 exit 0
21fi
22
23test_append_files() {
24 local workspace="${1:?}"
25 # Install knot
26 image_install kzonecheck keymgr kjournalprint knotc knotd
27 image_install /lib/tmpfiles.d/knot.conf
28 image_install "${ROOTLIBDIR:?}/system/knot.service"
29 image_install -o /etc/dbus-1/system.d/cz.nic.knotd.conf
3398a732 30 image_install -o /etc/default/knot
fb6f25d7
FS
31
32 # Copy over our configuration
33 mkdir -p "${workspace:?}/var/lib/knot/zones/" "${workspace:?}/etc/knot/"
34 cp -rfv "${TEST_BASE_DIR:?}"/knot-data/zones/* "$workspace/var/lib/knot/zones/"
35 cp -fv "${TEST_BASE_DIR:?}/knot-data/knot.conf" "$workspace/etc/knot/knot.conf"
36 chgrp -R knot "$workspace/etc/knot/" "$workspace/var/lib/knot/"
37 chmod -R ug+rwX "$workspace/var/lib/knot/"
38 chmod -R g+r "$workspace/etc/knot/"
39
40 # Install DNS-related utilities (usually found in the bind-utils package)
41 image_install delv dig host nslookup
42}
43
44do_test "$@"