paths:
- pkg/
-.apkgbuild: &apkgbuild # new jinja2 breaks docs (sphinx/breathe)
- - pip3 install -U apkg 'jinja2<3.1'
+.apkginstall: &apkginstall # new jinja2 breaks docs (sphinx/breathe)
+ - git clone https://gitlab.nic.cz/packaging/apkg.git
+ - cd apkg; git checkout test; pip3 install -U . 'jinja2<3.1'
+ # - pip3 install -U . 'jinja2<3.1'
+
+
+.apkgbuild: &apkgbuild
+ - *apkginstall
- apkg build-dep -y
- apkg build
.debpkgtest: &debpkgtest
- *pkgdebrepo
- - apt-get install -y knot-dnsutils
- apt-get install -y $(find ./pkg/pkgs -name '*.deb' | grep -v module | grep -v debug | grep -v devel)
- - systemctl start kresd@1
- - kdig @127.0.0.1 nic.cz | grep -qi NOERROR
- - systemctl stop kresd@1
- - systemctl start knot-resolver
- - kdig @127.0.0.1 nic.cz | grep -qi NOERROR
+ - *apkginstall
+ - apkg test-dep
+ - apkg test
centos-7:pkgtest:
<<: *pkgtest
--- /dev/null
+{# This adds all tests for manager's packaging #}
+{% include 'distro/tests/manager-packaging/control' %}
--- /dev/null
+{# Test that kresctl command exists and is in $PATH #}
+Test-Command: bash manager/tests/packaging/kresctl.sh
+
+
+{# Tests that manager can be started with default config and it resolves some domains #}
+Test-Command: bash manager/tests/packaging/systemd_service.sh
+{% if distro.match('fedora') -%}
+Depends: knot-utils
+{% elif distro.match('debian') -%}
+Depends: knot-dnsutils
+{% elif distro.match('arch') -%}
+Depends: knot
+{% else -%}
+error this should fail
+{%- endif %}
set -o errexit
set -o nounset
+function install_pipx {
+ python3 -m pip install --user pipx
+ python3 -m pipx ensurepath
+ export PATH="$PATH:/root/.local/bin" # hack to make binaries installed with pipx work
+}
+
+function pipx {
+ python3 -m pipx ${@}
+}
+
function init_debian {
export DEBIAN_FRONTEND=noninteractive
fi
# install apkg
-python3 -m pip install --user pipx
-python3 -m pipx ensurepath
-PATH="$PATH:/root/.local/bin" # hack to make binaries installed with pipx work
-python3 -m pipx install apkg
+install_pipx
+pipx install apkg
# prepare the repo
#git clone https://gitlab.nic.cz/knot/knot-resolver
set -e
# We expect `kresctl` command to exist in $PATH
-command -q -v kresctl
\ No newline at end of file
+command -v kresctl > /dev/null
fi
+trap "systemctl stop knot-resolver.service" EXIT
systemctl start knot-resolver.service
# check that the resolvers are actually running
-kdig @127.0.0.1 nic.cz
\ No newline at end of file
+kdig @127.0.0.1 nic.cz