diff --git a/tests/Master-server-chrooted/Makefile b/tests/Master-server-chrooted/Makefile new file mode 100644 index 0000000..257c238 --- /dev/null +++ b/tests/Master-server-chrooted/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/tests/Sanity/Master-server-chrooted +# Description: Run basic empty named service and try to resolve localhost on it +# Author: Petr Mensik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/tests/Sanity/Master-server-chrooted +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Petr Mensik " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Run basic empty named-chroot service and try to resolve localhost on it" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: bind" >> $(METADATA) + @echo "Requires: bind bind-utils bind-chroot bind-sdb-chroot" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5 -RHEL6" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Master-server-chrooted/PURPOSE b/tests/Master-server-chrooted/PURPOSE new file mode 100644 index 0000000..1d01992 --- /dev/null +++ b/tests/Master-server-chrooted/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/tests/Sanity/Master-server-chrooted +Description: Run basic empty named-chroot service and try to resolve localhost on it +Author: Petr Mensik diff --git a/tests/Master-server-chrooted/runtest.sh b/tests/Master-server-chrooted/runtest.sh new file mode 100755 index 0000000..9ab80d2 --- /dev/null +++ b/tests/Master-server-chrooted/runtest.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/tests/Sanity/Master-server-chrooted +# Description: Run basic empty named-chroot service and try to resolve localhost on it +# Author: Petr Mensik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="bind" + +test_service() +{ + local SERVICE="$1" + rlRun "rlServiceStart $SERVICE" + rlRun "dig @localhost localhost | grep '^localhost'" + rlRun "dig @localhost -x 127.0.0.1 | grep 'PTR[[:space:]]\+localhost.$'" 0 "Reverse address works" + rlRun "rlServiceRestore $SERVICE" +} + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm bind + rlAssertRpm bind-utils + rlAssertRpm bind-chroot + rlPhaseEnd + + rlPhaseStartTest "Testing named" + test_service named + rlPhaseEnd + + rlPhaseStartTest "Testing named-chroot" + test_service named-chroot + rlPhaseEnd + + rlPhaseStartTest "Testing named-sdb-chroot" + if rpm -q bind-sdb-chroot; then + test_service named-sdb-chroot + else + rlLog "bind-sdb-chroot not installed, skipping it" + fi + rlPhaseEnd + + rlPhaseStartCleanup + # noop + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/tests.yml b/tests/tests.yml index b88b336..cc363a0 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -6,9 +6,11 @@ tags: - classic tests: + - Master-server-chrooted - Master-server-not-chrooted required_packages: - bind - bind-chroot + - bind-sdb-chroot - redhat-lsb - bind-utils