diff --git a/ci.fmf b/ci.fmf deleted file mode 100644 index dbef5f1..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/squid.git" - execute: - how: beakerlib diff --git a/core/daemon-selinux-context/TC#0334116.fmf b/core/daemon-selinux-context/TC#0334116.fmf new file mode 100644 index 0000000..4218903 --- /dev/null +++ b/core/daemon-selinux-context/TC#0334116.fmf @@ -0,0 +1,7 @@ +component: +- squid +tag: +- TIPpass_Apps +- Tier1 +extra-nitrate: TC#0334116 +extra-summary: /CoreOS/squid/Sanity/daemon-selinux-context diff --git a/core/daemon-selinux-context/main.fmf b/core/daemon-selinux-context/main.fmf new file mode 100644 index 0000000..c42771b --- /dev/null +++ b/core/daemon-selinux-context/main.fmf @@ -0,0 +1,20 @@ +summary: test selinux context of all squid's processes +description: | + There is different context on RHEL5 and RHEL{6,7} expected. + Every process with name "squid" is checked. + + Author: Ondrej Ptak +contact: Iveta Cesalova +component: +- squid +test: ./runtest.sh +framework: beakerlib +require: +- library(squid/squid) +recommend: +- squid +duration: 5m +enabled: true +tier: '1' +extra-summary: /CoreOS/squid/Sanity/daemon-selinux-context +extra-task: /CoreOS/squid/Sanity/daemon-selinux-context diff --git a/core/daemon-selinux-context/runtest.sh b/core/daemon-selinux-context/runtest.sh new file mode 100755 index 0000000..60e415a --- /dev/null +++ b/core/daemon-selinux-context/runtest.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/squid/Sanity/daemon-selinux-context +# Description: test selinux context of all squid's processes +# Author: Ondrej Ptak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2014 Red Hat, Inc. +# +# 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 Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGES=${PACKAGES:-"squid"} + +rlJournalStart + rlPhaseStartSetup + rlImport --all + rlAssertRpm --all + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlRun "squidStart" + rlPhaseEnd + + rlPhaseStartTest + rlRun "squid_pids=\$(ps axo pid,comm|grep '\bsquid\b'|awk '{print \$1}')"\ + 0 "detecting squid's processes" + rlRun " [ -n \"$squid_pids\" ] " 0 "squid has at least one running process" + + if rlIsRHEL 5 ; then + grep_pattern="(user_u|root):system_r:squid_t" + else + grep_pattern="(system_u|unconfined_u):system_r:squid_t:s0" + fi + + for p in $squid_pids; + do + rlRun "ps -Z $p > ps_log" 0 "getting selinux context of process $p" + rlAssertGrep "$grep_pattern" ps_log -E || \ + rlLogInfo "$p's context is: \"$(cat ps_log|grep squid|awk '{print $1}')\"" + done + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "squidStop" + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/core/smoke/TC#0577328.fmf b/core/smoke/TC#0577328.fmf deleted file mode 100644 index a95b2c9..0000000 --- a/core/smoke/TC#0577328.fmf +++ /dev/null @@ -1,13 +0,0 @@ -component: [] -environment: - MODSTREAMS: squid:4 -tag: -- TIPpass_Apps -- TIPpass_FIPS -- TestCaseCopy -- Tier1 -tier: '1' -relevancy: | - distro < rhel-8: False -extra-nitrate: TC#0577328 -extra-summary: /CoreOS/squid/Sanity/smoke [squid:4] diff --git a/core/smoke/TC#0607255.fmf b/core/smoke/TC#0607255.fmf deleted file mode 100644 index 2c6d5e0..0000000 --- a/core/smoke/TC#0607255.fmf +++ /dev/null @@ -1,14 +0,0 @@ -component: -- squid -environment: - FIPS: 'true' -tag: -- FIPS -- TIPfail -- TIPfail_Apps -- TIPpass_FIPS -relevancy: | - # https://wiki.test.redhat.com/BaseOs/Security/FIPS/#SupportedPlatforms - distro = rhel-alt-7: False -extra-nitrate: TC#0607255 -extra-summary: /CoreOS/squid/Sanity/smoke (FIPS) diff --git a/core/smoke/TC#0607257.fmf b/core/smoke/TC#0607257.fmf deleted file mode 100644 index e17aa8a..0000000 --- a/core/smoke/TC#0607257.fmf +++ /dev/null @@ -1,14 +0,0 @@ -component: [] -environment: - MODSTREAMS: squid:4 - FIPS: 'true' -tag: -- FIPS -- TIPpass_Apps -- TIPpass_FIPS -- TestCaseCopy -- squid:4 -relevancy: | - distro < rhel-8: False -extra-nitrate: TC#0607257 -extra-summary: /CoreOS/squid/Sanity/smoke (FIPS) [squid:4] diff --git a/core/smoke/main.fmf b/core/smoke/main.fmf index 7623219..70c3f8f 100644 --- a/core/smoke/main.fmf +++ b/core/smoke/main.fmf @@ -1,10 +1,8 @@ summary: simple and fast smoke test description: '' -contact: Branislav Náter component: - squid test: ./runtest.sh -path: /Sanity/smoke framework: beakerlib require: - library(httpd/http) diff --git a/integration/cache-peer-DNS-lookup-failed/TC#0602107.fmf b/integration/cache-peer-DNS-lookup-failed/TC#0602107.fmf new file mode 100644 index 0000000..d734fa6 --- /dev/null +++ b/integration/cache-peer-DNS-lookup-failed/TC#0602107.fmf @@ -0,0 +1,8 @@ +tag: +- NoRHEL4 +- NoRHEL5 +- Tier2 +relevancy: | + distro < rhel-7: False +extra-nitrate: TC#0602107 +extra-summary: /CoreOS/squid/Regression/bz1691741-cache-peer-DNS-lookup-failed-with-lower-case diff --git a/integration/cache-peer-DNS-lookup-failed/main.fmf b/integration/cache-peer-DNS-lookup-failed/main.fmf new file mode 100644 index 0000000..540071d --- /dev/null +++ b/integration/cache-peer-DNS-lookup-failed/main.fmf @@ -0,0 +1,18 @@ +summary: Test for BZ#1691741 (Squid cache_peer DNS lookup failed when not all) +description: | + Bug summary: Squid cache_peer DNS lookup failed when not all lower case + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1691741 +contact: Iveta Cesalova +component: +- squid +test: ./runtest.sh +framework: beakerlib +require: +- library(squid/squid) +recommend: +- squid +duration: 10m +enabled: true +tier: '2' +extra-summary: /CoreOS/squid/Regression/bz1691741-cache-peer-DNS-lookup-failed-with-lower-case +extra-task: /CoreOS/squid/Regression/bz1691741-cache-peer-DNS-lookup-failed-with-lower-case diff --git a/integration/cache-peer-DNS-lookup-failed/runtest.sh b/integration/cache-peer-DNS-lookup-failed/runtest.sh new file mode 100755 index 0000000..24311ee --- /dev/null +++ b/integration/cache-peer-DNS-lookup-failed/runtest.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/squid/Regression/bz1691741-cache-peer-DNS-lookup-failed-with-lower-case +# Description: Test for BZ#1691741 (Squid cache_peer DNS lookup failed when not all) +# Author: Maryna Nalbandian +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 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 + +PACKAGES=${PACKAGES:-"squid"} +HOST=R610 + +rlJournalStart + rlPhaseStartSetup + rlRun "rlImport --all" || rlDie + rlAssertRpm --all + rlRun "rlFileBackup /etc/hosts $squidCONF" + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "echo '127.0.0.2 $HOST' >> /etc/hosts" + rlRun "echo 'cache_peer $HOST parent 3128 3130 default' >> $squidCONF" + rlRun "squidRestart" + rlAssertNotGrep "WARNING: DNS lookup for '$HOST' failed!" /var/log/squid/cache.log + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "squidStop" + rlRun "rlFileRestore" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/main.fmf b/main.fmf new file mode 100644 index 0000000..8df2dbd --- /dev/null +++ b/main.fmf @@ -0,0 +1,2 @@ +# QE owner +contact: Branislav Náter diff --git a/plans/all.fmf b/plans/all.fmf new file mode 100644 index 0000000..e1a0780 --- /dev/null +++ b/plans/all.fmf @@ -0,0 +1,5 @@ +summary: Run all tests +discover: + how: fmf +execute: + how: tmt