From 609e63fec65126b39ce9ec88bd9f43003b37dadf Mon Sep 17 00:00:00 2001 From: Petr Sklenar Date: Tue, 4 Jan 2022 20:01:12 +0100 Subject: [PATCH] Adding test --- .../Makefile | 64 +++++++++++++++++++ .../PURPOSE | 3 + .../bad.conf | 3 + .../main.fmf | 24 +++++++ .../runtest.sh | 45 +++++++++++++ 5 files changed, 139 insertions(+) create mode 100644 Regression/bz1848169-named-checkconf-cidr-host-bits/Makefile create mode 100644 Regression/bz1848169-named-checkconf-cidr-host-bits/PURPOSE create mode 100644 Regression/bz1848169-named-checkconf-cidr-host-bits/bad.conf create mode 100644 Regression/bz1848169-named-checkconf-cidr-host-bits/main.fmf create mode 100755 Regression/bz1848169-named-checkconf-cidr-host-bits/runtest.sh diff --git a/Regression/bz1848169-named-checkconf-cidr-host-bits/Makefile b/Regression/bz1848169-named-checkconf-cidr-host-bits/Makefile new file mode 100644 index 0000000..419210d --- /dev/null +++ b/Regression/bz1848169-named-checkconf-cidr-host-bits/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/bind/Regression/bz1848169-named-checkconf-cidr-host-bits +# Description: What the test does +# Author: Tomas Korbar +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2020 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/bind/Regression/bz1848169-named-checkconf-cidr-host-bits +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE bad.conf + +.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: Tomas Korbar " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: What the test does" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: bind" >> $(METADATA) + @echo "Requires: bind" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1848169 1865785" >> $(METADATA) + @echo "Releases: RHEL8" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/Regression/bz1848169-named-checkconf-cidr-host-bits/PURPOSE b/Regression/bz1848169-named-checkconf-cidr-host-bits/PURPOSE new file mode 100644 index 0000000..985e289 --- /dev/null +++ b/Regression/bz1848169-named-checkconf-cidr-host-bits/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/bind/Regression/bz1848169-named-checkconf-cidr-host-bits +Description: What the test does +Author: Tomas Korbar diff --git a/Regression/bz1848169-named-checkconf-cidr-host-bits/bad.conf b/Regression/bz1848169-named-checkconf-cidr-host-bits/bad.conf new file mode 100644 index 0000000..c794774 --- /dev/null +++ b/Regression/bz1848169-named-checkconf-cidr-host-bits/bad.conf @@ -0,0 +1,3 @@ +controls { + inet 172.17.1.98 port 953 allow { 172.17.1.1/24; }; +}; diff --git a/Regression/bz1848169-named-checkconf-cidr-host-bits/main.fmf b/Regression/bz1848169-named-checkconf-cidr-host-bits/main.fmf new file mode 100644 index 0000000..ea78e6d --- /dev/null +++ b/Regression/bz1848169-named-checkconf-cidr-host-bits/main.fmf @@ -0,0 +1,24 @@ +summary: What the test does +description: '' +contact: Petr Sklenar +component: + - bind +test: ./runtest.sh +framework: beakerlib +recommend: + - bind +duration: 5m +enabled: true +tag: + - TIPpass + - TIPpass_infra +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1848169 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1865785 +adjust: + - enabled: false + when: distro != rhel-8 + continue: false +extra-nitrate: TC#0608023 +extra-summary: /CoreOS/bind/Regression/bz1848169-named-checkconf-cidr-host-bits +extra-task: /CoreOS/bind/Regression/bz1848169-named-checkconf-cidr-host-bits diff --git a/Regression/bz1848169-named-checkconf-cidr-host-bits/runtest.sh b/Regression/bz1848169-named-checkconf-cidr-host-bits/runtest.sh new file mode 100755 index 0000000..6f37f77 --- /dev/null +++ b/Regression/bz1848169-named-checkconf-cidr-host-bits/runtest.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/bind/Regression/bz1848169-named-checkconf-cidr-host-bits +# Description: What the test does +# Author: Tomas Korbar +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2020 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/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="bind" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlPhaseEnd + + rlPhaseStartTest + rlRun "named-checkconf ./bad.conf" 0 "Check configuration file" + rlPhaseEnd + + rlPhaseStartCleanup + rlPhaseEnd +rlJournalPrintText +rlJournalEnd