From: Vasek Sraier Date: Tue, 17 May 2022 10:19:36 +0000 (+0200) Subject: fixup! fixup! fixup! WIP: packaing tests using apkg's new test feature X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=420bca98d7cf47a2050119a0d5bd5b6b9d6bc39c;p=thirdparty%2Fknot-resolver.git fixup! fixup! fixup! WIP: packaing tests using apkg's new test feature --- diff --git a/ci/pkgtest.yaml b/ci/pkgtest.yaml index f78fe89d4..a20c4f811 100644 --- a/ci/pkgtest.yaml +++ b/ci/pkgtest.yaml @@ -21,7 +21,6 @@ stages: - pkg/ .apkginstall: &apkginstall # new jinja2 breaks docs (sphinx/breathe) - - apt-get install -y python3-pip # I have no idea why this is needed as it was not needed previously - git clone https://gitlab.nic.cz/packaging/apkg.git - cd apkg; git checkout test; pip3 install -U . 'jinja2<3.1'; cd .. # - pip3 install -U . 'jinja2<3.1' @@ -178,6 +177,7 @@ nixos-unstable:pkgbuild: .debpkgtest: &debpkgtest - *pkgdebrepo - apt-get install -y $(find ./pkg/pkgs -name '*.deb' | grep -v module | grep -v debug | grep -v devel) + - apt-get install python3-pip - *apkginstall - apkg test-dep - apkg test @@ -235,13 +235,11 @@ fedora-34:pkgtest: - fedora-34:pkgbuild image: $CI_REGISTRY/labs/lxc-gitlab-runner/fedora-34 script: - - dnf install -y knot-utils findutils + - dnf install -y findutils python3-pip - dnf install -y $(find ./pkg/pkgs -name '*.rpm' | 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 fedora-35:pkgtest: <<: *pkgtest @@ -249,13 +247,12 @@ fedora-35:pkgtest: - fedora-35:pkgbuild image: $CI_REGISTRY/labs/lxc-gitlab-runner/fedora-35 script: - - dnf install -y knot-utils findutils + - dnf install -y findutils python3-pip - dnf install -y $(find ./pkg/pkgs -name '*.rpm' | 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 + opensuse-15.2:pkgtest: <<: *pkgtest diff --git a/manager/tests/packaging/systemd_service.sh b/manager/tests/packaging/systemd_service.sh index 3719ff1fe..e942b7075 100755 --- a/manager/tests/packaging/systemd_service.sh +++ b/manager/tests/packaging/systemd_service.sh @@ -9,9 +9,18 @@ if test "$(id -u)" -ne 0; then exit 1 fi - +# We will be starting a systemd service, but another tests might do the same +# so this makes sure there is nothing left after we exit 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 + +if ! systemctl start knot-resolver.service; then + echo + echo "Failed to start service, here is its status:" + systemctl status knot-resolver.service + +else + # check that the resolvers are actually running + kdig @127.0.0.1 nic.cz +fi +