CAA test import

This commit is contained in:
Petr Menšík 2019-10-09 16:50:00 +02:00
commit ebe213eedd
5 changed files with 189 additions and 0 deletions

View file

@ -0,0 +1,63 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/bind/Sanity/CAA-support
# Description: sanity testing of CAA support
# Author: Petr Sklenar <psklenar@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2016 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/Sanity/CAA-support
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE zone.petr.god zone.hi.ho
.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 Sklenar <psklenar@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: sanity testing of CAA support" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 10m" >> $(METADATA)
@echo "RunFor: bind" >> $(METADATA)
@echo "Requires: bind bind-utils" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

View file

@ -0,0 +1,3 @@
PURPOSE of /CoreOS/bind/Sanity/CAA-support
Description: sanity testing of CAA support
Author: Petr Sklenar <psklenar@redhat.com>

76
Sanity/CAA-support/runtest.sh Executable file
View file

@ -0,0 +1,76 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/bind/Sanity/CAA-support
# Description: sanity testing of CAA support
# Author: Petr Sklenar <psklenar@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2016 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"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlFileBackup --clean /var/named/zone.petr.god
rlFileBackup --clean /var/named/zone.hi.ho
rlFileBackup /etc/named.conf
cp zone.petr.god /var/named/zone.petr.god
cp zone.hi.ho /var/named/zone.hi.ho
cat <<EOT >> /etc/named.conf
zone "petr.god." IN {
type master;
file "/var/named/zone.petr.god";
};
zone "hi.ho." IN {
type master;
file "/var/named/zone.hi.ho";
};
EOT
rlRun "rlServiceStart named"
rlPhaseEnd
rlPhaseStartTest 'petr.god'
rlRun "dig +short @127.0.0.1 caa01.petr.god CAA|grep 'policy'"
rlRun "dig +short @127.0.0.1 caa02.petr.god CAA|grep 'Unknown'"
rlRun "dig +short @127.0.0.1 caa03.petr.god CAA|grep 'tbs'"
rlRun "dig +short @127.0.0.1 caa6.petr.god CAA | wc -l | grep 6"
rlPhaseEnd
rlPhaseStartTest 'hi.ho'
rlRun "dig +short @127.0.0.1 caa.hi.ho CAA | grep issue"
rlRun "dig +short @127.0.0.1 caa1.hi.ho CAA | grep 'mailto:security at example.com'"
rlRun "dig +short @127.0.0.1 caa2.hi.ho CAA| grep 'http://iodef.example.com/'"
rlPhaseEnd
rlPhaseStartCleanup
rlFileRestore
rlServiceRestore named
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,24 @@
$ORIGIN hi.ho.
@ 1D IN SOA ns1.hi.ho. hostmaster.hi.ho. (
2009040114 ; serial
3H ; refresh
15 ; retry
1w ; expire
3h ; minimum
)
IN NS ns1.hi.ho.
IN A 1.1.1.1
ns1 IN A 1.2.3.4
a IN A 2.2.2.2
aaaa IN AAAA 3FFE:0B80:0444:0004:0000:0000:0000:0004
caa IN CAA 0 issue "ca.example.net"
caa1 IN CAA 0 iodef "mailto:security at example.com"
caa2 IN CAA 0 iodef "http://iodef.example.com/"
caa6 CAA 0 policy "policy"
caa6 CAA 128 path "path"
caa6 CAA 128 issuewild "issuewild"
caa6 CAA 128 iodef "iodef"
caa6 CAA 128 tbs "tbs"
caa6 CAA 128 auth "auth"
caa6 CAA 128 aut "auth"

View file

@ -0,0 +1,23 @@
$ORIGIN petr.god.
@ 1D IN SOA ns1.petr.god. hostmaster.petr.god. (
2002022401 ; serial
3H ; refresh
15 ; retry
1w ; expire
3h ; minimum
)
IN NS ns1.petr.god. ; in the domain
ns1 IN A 192.168.122.178
www IN A 192.168.122.123
ftp IN CNAME www.petr.god.
caa01 3600 IN CAA 0 issue "ca.petr.god\; policy=ev"
caa02 3600 IN CAA 128 tbs "Unknown"
caa03 3600 IN CAA 128 tbs ""
caa6 CAA 0 policy "policy"
caa6 CAA 128 path "path"
caa6 CAA 128 issuewild "issuewild"
caa6 CAA 128 iodef "iodef"
caa6 CAA 128 tbs "tbs"
caa6 CAA 128 auth "auth"