Blame Regression/bz530214-service-named-configtest-always-returns-0/runtest.sh

c068eec
#!/bin/bash
c068eec
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
c068eec
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c068eec
#
c068eec
#   runtest.sh of /CoreOS/bind/Regression/bz530214-service-named-configtest-always-returns-0
c068eec
#   Description: Test for bz530214 (service named configtest always returns 0)
c068eec
#   Author: Ludek Dolihal <dollson@localhost.localdomain>
c068eec
#
c068eec
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c068eec
#
c068eec
#   Copyright (c) 2009 Red Hat, Inc. All rights reserved.
c068eec
#
c068eec
#   This copyrighted material is made available to anyone wishing
c068eec
#   to use, modify, copy, or redistribute it subject to the terms
c068eec
#   and conditions of the GNU General Public License version 2.
c068eec
#
c068eec
#   This program is distributed in the hope that it will be
c068eec
#   useful, but WITHOUT ANY WARRANTY; without even the implied
c068eec
#   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
c068eec
#   PURPOSE. See the GNU General Public License for more details.
c068eec
#
c068eec
#   You should have received a copy of the GNU General Public
c068eec
#   License along with this program; if not, write to the Free
c068eec
#   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
c068eec
#   Boston, MA 02110-1301, USA.
c068eec
#
c068eec
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c068eec
c068eec
# Include rhts environment
c068eec
. /usr/bin/rhts-environment.sh
c068eec
. /usr/lib/beakerlib/beakerlib.sh
c068eec
. /usr/share/beakerlib/beakerlib.sh || exit 1
c068eec
c068eec
PACKAGE="bind"
c068eec
c068eec
rlJournalStart
c068eec
    rlPhaseStartSetup
c068eec
        rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"
c068eec
	rlFileBackup /etc/named.conf
c068eec
        rlRun "pushd $TmpDir"
c068eec
c068eec
        rlRun "rlImport bind/bind-setup"
c068eec
        #rlRun "wget --quiet http://nest.test.redhat.com/mnt/qa/scratch/mcermak/bind-setup.tar.gz && tar xvzf bind-setup.tar.gz > /dev/null && . bind-setup/bind-setup.sh" 0 "Imported bind-setup functions."
c068eec
c068eec
        bsBindSetupStart "" "chrootoff"
c068eec
        bsBindSetupDone
c068eec
c068eec
        rlRun "service named stop"
c068eec
c068eec
        bsRemoveConfOptions "allow-query"
c068eec
        bsSetUserOptions "allow-query { foo; };"
c068eec
c068eec
        rlRun "service named start" 1-255
c068eec
    rlPhaseEnd
c068eec
c068eec
    rlPhaseStartTest
c068eec
        rlRun "named-checkconf /etc/named.conf" 1
c068eec
    rlPhaseEnd
c068eec
c068eec
    rlPhaseStartCleanup
c068eec
        bsBindSetupCleanup
c068eec
	rlFileRestore
c068eec
        rlRun "popd"
c068eec
        rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
c068eec
    rlPhaseEnd
c068eec
rlJournalEnd