diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/ci.fmf b/ci.fmf deleted file mode 100644 index 9a9fbea..0000000 --- a/ci.fmf +++ /dev/null @@ -1,13 +0,0 @@ -/test: - summary: - CI plan, picks Tier1 tests, runs in beakerlib. - description: - This special plan has to be named ci.fmf to run in CI. - It selects test which have 'tier 1' in their main.fmf file - discover: - - name: tier1 - how: fmf - filter: 'tier: 1' - repository: "https://src.fedoraproject.org/tests/bind.git" - execute: - how: tmt diff --git a/gating.yaml b/gating.yaml index ecab956..e4c04e7 100644 --- a/gating.yaml +++ b/gating.yaml @@ -1,6 +1,16 @@ --- !Policy product_versions: - fedora-* -decision_context: bodhi_update_push_stable -rules: [] -# fedora-ci.koji-build.tier0.functional is not yet stable, cannot enable it +decision_contexts: [bodhi_update_push_testing] +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/tier1-public.functional} + +#gating rawhide +--- !Policy +product_versions: + - fedora-* +decision_contexts: [bodhi_update_push_stable] +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/tier1-public.functional} diff --git a/plans/all.fmf b/plans/all.fmf new file mode 100644 index 0000000..1afeb5d --- /dev/null +++ b/plans/all.fmf @@ -0,0 +1,6 @@ +summary: Test plan with all beakerlib tests +discover: + how: fmf + url: https://src.fedoraproject.org/tests/bind.git +execute: + how: tmt diff --git a/plans/tier1-public.fmf b/plans/tier1-public.fmf new file mode 100644 index 0000000..35808fd --- /dev/null +++ b/plans/tier1-public.fmf @@ -0,0 +1,7 @@ +summary: Public (Fedora) Tier1 beakerlib tests +discover: + how: fmf + url: https://src.fedoraproject.org/tests/bind.git + filter: 'tier: 1' +execute: + how: tmt diff --git a/tests/Master-server-chrooted/Makefile b/tests/Master-server-chrooted/Makefile deleted file mode 100644 index 257c238..0000000 --- a/tests/Master-server-chrooted/Makefile +++ /dev/null @@ -1,63 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# 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 deleted file mode 100644 index c5468a4..0000000 --- a/tests/Master-server-chrooted/PURPOSE +++ /dev/null @@ -1,6 +0,0 @@ -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 - -Check also clean package both when running and finished. -https://bugzilla.redhat.com/show_bug.cgi?id=1592873 diff --git a/tests/Master-server-chrooted/runtest.sh b/tests/Master-server-chrooted/runtest.sh deleted file mode 100755 index 15ebc12..0000000 --- a/tests/Master-server-chrooted/runtest.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/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" - local PACKAGE="$2" - 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 "rpm -V $PACKAGE" 0 "Checking $SERVICE package when running" - rlRun "rlServiceRestore $SERVICE" - rlRun "rpm -V $PACKAGE" 0 "Checking $SERVICE package when stopped" -} - -rlJournalStart - rlPhaseStartSetup - rlAssertRpm bind - rlAssertRpm bind-utils - rlAssertRpm bind-chroot - rlPhaseEnd - - rlPhaseStartTest "Testing named" - test_service named bind - rlPhaseEnd - - rlPhaseStartTest "Testing named-chroot" - test_service named-chroot bind-chroot - rlPhaseEnd - - rlPhaseStartTest "Testing named-sdb-chroot" - if rpm -q bind-sdb-chroot; then - test_service named-sdb-chroot bind-sdb-chroot - else - rlLog "bind-sdb-chroot not installed, skipping it" - fi - rlPhaseEnd - - rlPhaseStartCleanup - # noop - rlPhaseEnd -rlJournalPrintText -rlJournalEnd diff --git a/tests/Master-server-not-chrooted/Makefile b/tests/Master-server-not-chrooted/Makefile deleted file mode 100644 index 891a9a3..0000000 --- a/tests/Master-server-not-chrooted/Makefile +++ /dev/null @@ -1,65 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Makefile of /CoreOS/bind/Sanity/Master-server-not-chrooted -# Description: Set up master nameserver, test it. -# Author: Martin Cermak -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2009 Red Hat, Inc. All rights reserved. -# -# This copyrighted material is made available to anyone wishing -# to use, modify, copy, or redistribute it subject to the terms -# and conditions of the GNU General Public License version 2. -# -# 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, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -export TEST=/CoreOS/bind/Sanity/Master-server-not-chrooted -export TESTVERSION=1.0 - -BUILT_FILES= - -FILES=$(METADATA) runtest.sh Makefile PURPOSE named.conf zonefile - -.PHONY: all install download clean - -run: $(FILES) build - ./runtest.sh - -build: $(BUILT_FILES) - chmod a+x runtest.sh - -clean: - rm -f *~ $(BUILT_FILES) - - -include /usr/share/rhts/lib/rhts-make.include - -$(METADATA): Makefile - @echo "Owner: Martin Cermak " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: Set up master nameserver in chrooted env, test it." >> $(METADATA) - @echo "Type: Sanity" >> $(METADATA) - @echo "TestTime: 5m" >> $(METADATA) - @echo "RunFor: bind" >> $(METADATA) - @echo "Requires: bind bind-chroot redhat-lsb" >> $(METADATA) - @echo "Requires: bind-utils" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: GPLv2" >> $(METADATA) - @echo "Confidential: no" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - @echo "RhtsRequires: library(bind/bind-setup)" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/tests/Master-server-not-chrooted/PURPOSE b/tests/Master-server-not-chrooted/PURPOSE deleted file mode 100644 index 92cb7bd..0000000 --- a/tests/Master-server-not-chrooted/PURPOSE +++ /dev/null @@ -1,6 +0,0 @@ -PURPOSE of /CoreOS/bind/Sanity/Master-server-not-chrooted -Description: Set up master nameserver in chrooted env, test it. - This is a very basic sanity test for bind9. - The main purpose for me was to learn how - bind works :-) -Author: Martin Cermak diff --git a/tests/Master-server-not-chrooted/named.conf b/tests/Master-server-not-chrooted/named.conf deleted file mode 100644 index e477af9..0000000 --- a/tests/Master-server-not-chrooted/named.conf +++ /dev/null @@ -1,11 +0,0 @@ -options { - directory "/var/named"; - allow-query { any; }; -}; - -zone "" IN { - type master; - file ".zone"; - allow-update { none; }; -}; - diff --git a/tests/Master-server-not-chrooted/runtest.sh b/tests/Master-server-not-chrooted/runtest.sh deleted file mode 100644 index ec62a04..0000000 --- a/tests/Master-server-not-chrooted/runtest.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/bash -# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# runtest.sh of /CoreOS/bind/Sanity/Master-server-not-chrooted -# Description: Set up master nameserver, test it. -# Author: Martin Cermak -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2009 Red Hat, Inc. All rights reserved. -# -# This copyrighted material is made available to anyone wishing -# to use, modify, copy, or redistribute it subject to the terms -# and conditions of the GNU General Public License version 2. -# -# 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, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -# Include rhts environment -#set -x -. /usr/bin/rhts-environment.sh -. /usr/lib/beakerlib/beakerlib.sh - -# Some heplful functions -randomString () { - TEMPSTR=`date +%c%N | md5sum | awk '{print $1}'` - echo ${TEMPSTR:0:8} - unset TEMPSTR -} - -randomIp () { - echo "192.168.1.`echo $[ $RANDOM / 256 + 1 ]`" -} - -randomSerial () { - date +%N -} - -# Variable declarations -CONF="/etc/named.conf" -IP1=`randomIp` -IP2=`randomIp` -IP3=`randomIp` -IP4=`randomIp` -IP5=`randomIp` -SERIAL=`randomSerial` -ORIGPWD=`pwd` - -# The test -rlJournalStart - rlPhaseStartSetup - rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory" - rlRun "pushd $TmpDir" - - rlRun "rlImport bind/bind-setup" - - bsBindSetupStart "$ORIGPWD/named.conf" "off" - - rlRun "TDOMAIN=`randomString`.cz" - rlRun "TZONEFILE=$ROOTDIR/var/named/$TDOMAIN.zone" - - # set up /etc/named.conf - rlRun "sed -i \"s//$TDOMAIN/g\" $CONF" - - # set up zonefile - rlRun "cp $ORIGPWD/zonefile $TZONEFILE" - rlRun "chmod a+r $TZONEFILE" - rlRun "sed -i \"s//$TDOMAIN/g\" $TZONEFILE" - rlRun "sed -i \"s//$IP1/g\" $TZONEFILE" - rlRun "sed -i \"s//$IP2/g\" $TZONEFILE" - rlRun "sed -i \"s//$IP3/g\" $TZONEFILE" - rlRun "sed -i \"s//$IP4/g\" $TZONEFILE" - rlRun "sed -i \"s//$IP5/g\" $TZONEFILE" - rlRun "sed -i \"s//$SERIAL/g\" $TZONEFILE" - - bsBindSetupDone - rlPhaseEnd - - rlPhaseStartTest - # perform tests - rlRun "dig @localhost $TDOMAIN | grep \"^$TDOMAIN\" | head -n 1 | grep \"$IP1\"" - rlRun "dig @localhost server1.$TDOMAIN | grep \"^server1.$TDOMAIN\" | grep \"$IP2\"" - rlRun "dig @localhost server2.$TDOMAIN | grep \"^server2.$TDOMAIN\" | grep \"$IP3\"" - rlRun "dig @localhost dns1.$TDOMAIN | grep \"^dns1.$TDOMAIN\" | grep \"$IP4\"" - rlRun "dig @localhost dns2.$TDOMAIN | grep \"^dns2.$TDOMAIN\" | grep \"$IP5\"" - rlRun "dig @localhost ftp.$TDOMAIN | grep \"^ftp.$TDOMAIN\" | grep \"server1.$TDOMAIN\"" - rlRun "dig @localhost mail.$TDOMAIN | grep \"^mail.$TDOMAIN\" | grep \"server1.$TDOMAIN\"" - rlRun "dig @localhost mail2.$TDOMAIN | grep \"^mail2.$TDOMAIN\" | grep \"server2.$TDOMAIN\"" - rlRun "dig @localhost www.$TDOMAIN | grep \"^www.$TDOMAIN\" | grep \"server2.$TDOMAIN\"" - - rlPhaseEnd - - rlPhaseStartCleanup - bsBindSetupCleanup - rlRun "popd" - rlRun "rm -r $TmpDir" 0 "Removing tmp directory" - rlRun "rm -rf $TZONEFILE" - rlPhaseEnd -rlJournalEnd diff --git a/tests/Master-server-not-chrooted/zonefile b/tests/Master-server-not-chrooted/zonefile deleted file mode 100644 index 198991e..0000000 --- a/tests/Master-server-not-chrooted/zonefile +++ /dev/null @@ -1,27 +0,0 @@ -$ORIGIN . -$TTL 86400 -@ IN SOA dns1.. hostmaster.. ( - ; serial - 21600 ; refresh after 6 hours - 3600 ; retry after 1 hour - 604800 ; expire after 1 week - 86400 ) ; minimum TTL of 1 day - - IN NS dns1.. - IN NS dns2.. - - IN MX 10 mail.. - IN MX 20 mail2.. - - IN A - -server1 IN A -server2 IN A -dns1 IN A -dns2 IN A - -ftp IN CNAME server1 -mail IN CNAME server1 -mail2 IN CNAME server2 -www IN CNAME server2 - diff --git a/tests/Run-internal-BIND-test-suite/Makefile b/tests/Run-internal-BIND-test-suite/Makefile deleted file mode 100644 index 0b90930..0000000 --- a/tests/Run-internal-BIND-test-suite/Makefile +++ /dev/null @@ -1,77 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Makefile of tests/Run-internal-BIND-test-suite -# Description: Run internal BIND test suite -# Author: Martin Cermak -# Author: Petr Mensik -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2010 Red Hat, Inc. All rights reserved. -# -# This copyrighted material is made available to anyone wishing -# to use, modify, copy, or redistribute it subject to the terms -# and conditions of the GNU General Public License version 2. -# -# 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, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -export TEST=tests/Run-internal-BIND-test-suite -export TESTVERSION=1.3 - -BUILT_FILES= - -FILES=$(METADATA) runtest.sh Makefile PURPOSE knownerror* setup-named-softhsm.sh bind-systest-filter.sh - -.PHONY: all install download clean - -run: $(FILES) build - ./runtest.sh - -build: $(BUILT_FILES) - chmod a+x runtest.sh - -clean: - rm -f *~ $(BUILT_FILES) - - -include /usr/share/rhts/lib/rhts-make.include - -$(METADATA): Makefile - @echo "Owner: Martin Cermak " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: Run internal BIND test suite" >> $(METADATA) - @echo "Type: Sanity" >> $(METADATA) - @echo "TestTime: 8h" >> $(METADATA) - @echo "RunFor: bind" >> $(METADATA) - @echo "Requires: bind rpm-build bind-utils" >> $(METADATA) - @echo "Requires: perl-Net-DNS perl-Net-DNS-Nameserver" >> $(METADATA) - @echo "Requires: perl-Time-HiRes" >> $(METADATA) - @echo "Requires: bind-pkcs11 bind-pkcs11-utils softhsm" >> $(METADATA) - @echo "Requires: openssl-devel libtool autoconf" >> $(METADATA) -# Try to satisfy all build dependencies from here - @echo "Requires: bind-devel" >> $(METADATA) - @echo "Requires: net-tools" >> $(METADATA) - @echo "Requires: dnf-utils" >> $(METADATA) - @echo "Requires: kyua" >> $(METADATA) - @echo "Requires: libcmocka-devel" >> $(METADATA) -# Obsolete, uses cmocka -# @echo "Requires: libatf-c gcc-c++" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: GPLv2" >> $(METADATA) - @echo "Confidential: no" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - @echo "Bug: 642970" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/tests/Run-internal-BIND-test-suite/PURPOSE b/tests/Run-internal-BIND-test-suite/PURPOSE deleted file mode 100644 index 754ba2a..0000000 --- a/tests/Run-internal-BIND-test-suite/PURPOSE +++ /dev/null @@ -1,6 +0,0 @@ -PURPOSE of tests/Run-internal-BIND-test-suite -Description: Run internal BIND test suite -Author: Martin Cermak -Bug summary: Run internal BIND test suite -Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=642970 - diff --git a/tests/Run-internal-BIND-test-suite/bind-systest-filter.sh b/tests/Run-internal-BIND-test-suite/bind-systest-filter.sh deleted file mode 100755 index 8a153a1..0000000 --- a/tests/Run-internal-BIND-test-suite/bind-systest-filter.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# -# This script will filter out output from BINDs tests -# It supports form from BIND 9.9 and BIND 9.11 -# Its purpose is to display only failed tests from list of all tests - -CURRENT_TEST= -CURRENT_OUTPUT= -STATUS_ONLY= - -for P; do - case "$P" in - -s|--status) STATUS_ONLY=yes; shift ;; - esac -done - -cat $@ | while read LINE; do - if [ "${LINE#S:}" != "$LINE" ]; then - CURRENT_TEST=`echo $LINE | cut -d: -f2` - CURRENT_OUTPUT="$LINE"$'\n' - elif [ "${LINE#R:}" != "$LINE" ]; then - # echo "$CURRENT_TEST $LINE" - if [ "${LINE/#R:*:*}" != "$LINE" ]; then - # more recent results contain test name - # R:dlz:FAIL - CURRENT_TEST="${LINE#R:}" - CURRENT_TEST="${CURRENT_TEST/%:*}" - RESULT="${LINE/#*:}" - else - # S:dlz:time - # R:FAIL - RESULT="${LINE/#R*:/}" - fi - if [ "$RESULT" != "PASS" ]; then - if [ -n "$STATUS_ONLY" ]; then - echo "$RESULT $CURRENT_TEST" - else - CURRENT_OUTPUT+="$LINE" - echo "$CURRENT_OUTPUT" - echo - fi - fi - CURRENT_OUTPUT= - else - CURRENT_OUTPUT+="$LINE"$'\n' - fi -done diff --git a/tests/Run-internal-BIND-test-suite/knownerror b/tests/Run-internal-BIND-test-suite/knownerror deleted file mode 100644 index 2d0c8e9..0000000 --- a/tests/Run-internal-BIND-test-suite/knownerror +++ /dev/null @@ -1,2 +0,0 @@ -A:System test dlz -A:System test idna diff --git a/tests/Run-internal-BIND-test-suite/runtest.sh b/tests/Run-internal-BIND-test-suite/runtest.sh deleted file mode 100755 index 7066344..0000000 --- a/tests/Run-internal-BIND-test-suite/runtest.sh +++ /dev/null @@ -1,185 +0,0 @@ -#!/bin/bash -# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# runtest.sh of tests/Run-internal-BIND-test-suite -# Description: Run internal BIND test suite -# Author: Martin Cermak -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2010 Red Hat, Inc. All rights reserved. -# -# This copyrighted material is made available to anyone wishing -# to use, modify, copy, or redistribute it subject to the terms -# and conditions of the GNU General Public License version 2. -# -# 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, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -# Include rhts environment -. /usr/bin/rhts-environment.sh -. /usr/lib/beakerlib/beakerlib.sh - -PACKAGE="bind" - -# Set those variables to n to skip tests on variants -#DEFAULT_VARIANTS="normal pkcs11 sdb" -DEFAULT_VARIANTS="normal" -#TEST_VARIANTS="normal" - -# -# Runs test suite and checks known errors -# Prepared to be repeated with another variants -run_testsuite() -{ - local RESULT_TEXT="$TMPDIR/test${NAMED_VARIANT}.txt" - local FOUNDERROR=`mktemp found-XXXXXXXX.err` - local KNOWNERROR=/dev/null - - if [ -f "$ORIG/knownerror${NAMED_VARIANT}.$TAG" ]; then - KNOWNERROR=`readlink -f $ORIG/knownerror.$TAG` - elif [ -f "$ORIG/knownerror${NAMED_VARIANT}" ]; then - KNOWNERROR=`readlink -f $ORIG/knownerror` - fi - - # Sometime it can fail. Report just failures that are not known - rlRun "make test -j${CORES:-1} &> $RESULT_TEXT" 0-255 "Perform the test." - rlRun "grep -C 10 FAIL $RESULT_TEXT" 0-255 "Quickly show the test error (if any)." - - rlRun "$FILTER $RESULT_TEXT" 0 "Showing unsuccessful tests" - rlRun "$FILTER -s $RESULT_TEXT > $FOUNDERROR" 0 - rlRun "ls $KNOWNERROR $FOUNDERROR $RESULT_TEXT" 0 'check if there is needed files' - rlLog "`cat $FOUNDERROR`" - - rlAssertLesserOrEqual "Checking number of found errors is in limits" "$(grep '^FAIL' $FOUNDERROR | wc -l)" "$(wc -l <$KNOWNERROR)" - cat $FOUNDERROR | while read STATUS TEST ; do - if [ "$STATUS" = FAIL ]; then - rlRun "grep '$TEST' $KNOWNERROR" 0 "Check $TEST failure is expected" - else - rlLog "$STATUS $TEST" - fi - done -} - -rlJournalStart - rlPhaseStartSetup - # package assertions - rlAssertRpm $PACKAGE - rlAssertRpm rpm-build - rlAssertRpm perl-Net-DNS-Nameserver - - #pwd - ORIG=`pwd` - SETUP_SOFTHSM=`readlink -f setup-named-softhsm.sh` - FILTER=`readlink -f bind-systest-filter.sh` - CORES=`grep 'processor\s*:' /proc/cpuinfo | wc -l` - - TAG=generic - if [ -f /etc/os-release ]; then - # extract platform tag - TAG=`(source /etc/os-release && echo ${PLATFORM_ID#platform:})` - fi - - #tempdir - rlRun "TMPDIR=\`mktemp -d\`" 0 "Creating tmp directory" - rlRun "pushd $TMPDIR" - - # topdir - TOPDIR=`rpm -E '%{_topdir}'` - - # cleanup in topdir - mkdir -p $TOPDIR/{BUILD,SOURCES,SPECS} - rm -rf $TOPDIR/{BUILD,SOURCES,SPECS}/* - - # download src rpm - if ! ls bind*.src.rpm; then - rlRun "dnf --enablerepo='*-source' download --source bind" 0 "Fetch source from repository" - rlRun "rpm -i bind*.src.rpm" - fi - - rlRun "rpm --define '_topdir $TOPDIR' -Uvh *rpm &> $TMPDIR/install.txt" - rlRun "cd $TOPDIR/SPECS" - - rlRun "dnf -y builddep *.spec" - - # stop bind if it is running - rlServiceStop named - rlPhaseEnd - - rlPhaseStartTest - # rebuild from source - rlRun "rpmbuild -ba *.spec &> $TMPDIR/build.txt" - - # the test - rlRun "cd $TOPDIR/BUILD/bind*" - - rlLogInfo "Test takes place in `pwd`" - - rlRun "chown -R root ." - - if [ -x "$SETUP_SOFTHSM" ]; then - rlRun "eval \"$(bash $SETUP_SOFTHSM -A)\"" 0 "Preparing PKCS#11 token slot" - rlRun "pkcs11-tokens" 0 "Testing token slot availability" - else - rlLog "PKCS#11 not initialized" - fi - - if [ -d build ]; then - BUILD=build - else - BUILD=. - fi - - rlRun "./bin/tests/system/ifconfig.sh up" 0 "Setup fake network interfaces." - - # required by idna test - export LC_ALL=en_US.UTF-8 - - rlRun "pushd $BUILD" - - if echo "${TEST_VARIANTS:-$DEFAULT_VARIANTS}" | grep -q normal; then - rlLog "Running normal variant" - export NAMED_VARIANT= DNSSEC_VARIANT= - run_testsuite - rlLog "Finished normal variant" - fi - - if echo "${TEST_VARIANTS:-$DEFAULT_VARIANTS}" | grep -q sdb; then - rlLog "Running sdb variant" - export NAMED_VARIANT=-sdb DNSSEC_VARIANT= - run_testsuite - rlLog "Finished sdb variant" - fi - - if echo "${TEST_VARIANTS:-$DEFAULT_VARIANTS}" | grep -q pkcs11; then - rlLog "Running pkcs11 variant" - # Unfortunately, PKCS11 variant uses shared key storage - # It cannot use more threads for that reason - export NAMED_VARIANT=-pkcs11 DNSSEC_VARIANT=-pkcs11 - CORES=1 run_testsuite - rlLog "Finished pkcs11 variant" - fi - - rlRun "popd" - - rlRun "./bin/tests/system/ifconfig.sh down" 0 "Remove fake network interfaces." - - rlPhaseEnd - - rlPhaseStartCleanup - rlBundleLogs "BUILD_LOGS" "$TMPDIR/install.txt" "$TMPDIR/builddeps.txt" "$TMPDIR/build.txt" - rlBundleLogs "TEST_LOGS" "$TMPDIR"/test*.txt - rlRun "popd" - rlRun "rm -r $TMPDIR" 0 "Removing tmp directory" - rlPhaseEnd -rlJournalEnd diff --git a/tests/Run-internal-BIND-test-suite/setup-named-softhsm.sh b/tests/Run-internal-BIND-test-suite/setup-named-softhsm.sh deleted file mode 100755 index a13c91e..0000000 --- a/tests/Run-internal-BIND-test-suite/setup-named-softhsm.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/sh -# -# This script will initialise token storage of softhsm PKCS11 provider -# in custom location. Is useful to store tokens in non-standard location. -# -# Output can be evaluated from bash, it will prepare it for usage of temporary tokens. -# Recommended use: -# eval $(bash setup-named-softhsm.sh -A) -# - -SOFTHSM2_CONF="$1" -TOKENPATH="$2" -GROUPNAME="$3" -# Do not use this script for real keys worth protection -# This is intended for crypto accelerators using PKCS11 interface. -# Uninitialized token would fail any crypto operation. -PIN=1234 -SO_PIN=1234 -LABEL=rpm - -set -e - -echo_i() -{ - echo "#" $@ -} - -random() -{ - if [ -x "$(which openssl 2>/dev/null)" ]; then - openssl rand -base64 $1 - else - dd if=/dev/urandom bs=1c count=$1 | base64 - fi -} - -usage() -{ - echo "Usage: $0 -A [token directory] [group]" - echo " or: $0 [group]" -} - -if [ "$SOFTHSM2_CONF" = "-A" -a -z "$TOKENPATH" ]; then - TOKENPATH=$(mktemp -d /var/tmp/softhsm-XXXXXX) -fi - -if [ -z "$SOFTHSM2_CONF" -o -z "$TOKENPATH" ]; then - usage >&2 - exit 1 -fi - -if [ "$SOFTHSM2_CONF" = "-A" ]; then - # Automagic mode instead - MODE=secure - SOFTHSM2_CONF="$TOKENPATH/softhsm2.conf" - PIN_SOURCE="$TOKENPATH/pin" - SOPIN_SOURCE="$TOKENPATH/so-pin" - TOKENPATH="$TOKENPATH/tokens" -else - MODE=legacy -fi - -[ -d "$TOKENPATH" ] || mkdir -p "$TOKENPATH" - -umask 0022 - -if ! [ -f "$SOFTHSM2_CONF" ]; then -cat << SED > "$SOFTHSM2_CONF" -# SoftHSM v2 configuration file - -directories.tokendir = ${TOKENPATH} -objectstore.backend = file - -# ERROR, WARNING, INFO, DEBUG -log.level = ERROR - -# If CKF_REMOVABLE_DEVICE flag should be set -slots.removable = false -SED -else - echo_i "Config file $SOFTHSM2_CONF already exists" >&2 -fi - -if [ -n "$PIN_SOURCE" ]; then - touch "$PIN_SOURCE" "$SOPIN_SOURCE" - chmod 0600 "$PIN_SOURCE" "$SOPIN_SOURCE" - if [ -n "$GROUPNAME" ]; then - chgrp "$GROUPNAME" "$PIN_SOURCE" "$SOPIN_SOURCE" - chmod g+r "$PIN_SOURCE" "$SOPIN_SOURCE" - fi -fi - -export SOFTHSM2_CONF - -if softhsm2-util --show-slots | grep 'Initialized:[[:space:]]*yes' > /dev/null -then - echo_i "Token in ${TOKENPATH} is already initialized" >&2 - - [ -f "$PIN_SOURCE" ] && PIN=$(cat "$PIN_SOURCE") - [ -f "$SOPIN_SOURCE" ] && SO_PIN=$(cat "$SOPIN_SOURCE") -else - PIN=$(random 6) - SO_PIN=$(random 18) - if [ -n "$PIN_SOURCE" ]; then - echo -n "$PIN" > "$PIN_SOURCE" - echo -n "$SO_PIN" > "$SOPIN_SOURCE" - fi - - echo_i "Initializing tokens to ${TOKENPATH}..." - softhsm2-util --init-token --free --label "$LABEL" --pin "$PIN" --so-pin "$SO_PIN" | sed -e 's/^/# /' - - if [ -n "$GROUPNAME" ]; then - chgrp -R -- "$GROUPNAME" "$TOKENPATH" - chmod -R -- g=rX,o= "$TOKENPATH" - fi -fi - -echo "export SOFTHSM2_CONF=\"$SOFTHSM2_CONF\"" -echo "export PIN_SOURCE=\"$PIN_SOURCE\"" -echo "export SOPIN_SOURCE=\"$SOPIN_SOURCE\"" -# These are intentionaly not exported -echo "PIN=\"$PIN\"" -echo "SO_PIN=\"$SO_PIN\"" diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index d2fb221..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -# This first play always runs on the local staging system -- hosts: localhost - roles: - - role: standard-test-beakerlib - tags: - - classic - repositories: - - repo: "https://src.fedoraproject.org/tests/bind.git" - dest: "bind-tests" - fmf_filter: "tier: 1"