diff --git a/core/daemon-selinux-context/TC#0334132.fmf b/core/daemon-selinux-context/TC#0334132.fmf new file mode 100644 index 0000000..cca01fd --- /dev/null +++ b/core/daemon-selinux-context/TC#0334132.fmf @@ -0,0 +1,11 @@ +component: +- nginx +tag: +- TIPfail_Apps +- Tier1 +- ci-tier-1 +relevancy: | + product = rhel && distro < rhel-8 : False + distro = rhel-alt : False +extra-nitrate: TC#0334132 +extra-summary: /CoreOS/nginx/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..f483965 --- /dev/null +++ b/core/daemon-selinux-context/main.fmf @@ -0,0 +1,22 @@ +summary: test selinux context of all squid's processes +description: | + Every process with name "nginx" is checked. + Parametrization takes nginx version from COLLECTIONS variable + and if COLLECTIONS isn't set, system nginx is expected: + (service will be for example: nginx14-nginx or just nginx) + + Author: Ondrej Ptak +contact: None +component: +- nginx +test: ./runtest.sh +framework: beakerlib +require: +- library(nginx/nginx) +recommend: +- nginx +duration: 1m +enabled: true +tier: '1' +extra-summary: /CoreOS/nginx/Sanity/daemon-selinux-context +extra-task: /CoreOS/nginx/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..f4f132f --- /dev/null +++ b/core/daemon-selinux-context/runtest.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/nginx/Sanity/daemon-selinux-context +# Description: test selinux context of all nginx'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:-nginx} +rlJournalStart + rlPhaseStartSetup + rlAssertRpm --all + rlRun "rlImport nginx/nginx" + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlRun "rlServiceStart $nginxHTTPD" + rlPhaseEnd + + rlPhaseStartTest + rlRun "nginx_pids=\$(ps axo pid,comm|grep '\bnginx\b'|awk '{print \$1}')"\ + 0 "detecting nginx's processes" + rlRun " [ -n \"$nginx_pids\" ] " 0 "nginx has at least one running process" + for p in $nginx_pids; + do + rlRun "ps -Z $p > ps_log" 0 "getting selinux context of process $p" + rlAssertGrep "(system_u|unconfined_u):system_r:httpd_t:s0" ps_log -E || \ + rlLogInfo "$p's context is: \"$(cat ps_log|grep nginx|awk '{print $1}')\"" + done + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "rlServiceStop $nginxHTTPD" + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/integration/bz1862092-update-nginx-perl-support-to-rh-perl530/main.fmf b/integration/bz1862092-update-nginx-perl-support-to-rh-perl530/main.fmf deleted file mode 100644 index 796d9c4..0000000 --- a/integration/bz1862092-update-nginx-perl-support-to-rh-perl530/main.fmf +++ /dev/null @@ -1,26 +0,0 @@ -summary: Test for BZ#1862092 (update nginx perl support to rh-perl530) -description: | - Bug summary: update nginx perl support to rh-perl530 - Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1862092 -contact: None -component: -- nginx -test: ./runtest.sh -framework: beakerlib -recommend: -- nginx -duration: 5m -enabled: true -tag: -- NoRHEL4 -- NoRHEL5 -- TIPfail -- TIPfail_Apps -- Tier3 -tier: '3' -relevancy: | - distro = rhel-4, rhel-5: False - distro = fedora: False -extra-nitrate: TC#0608235 -extra-summary: /CoreOS/nginx/Regression/bz1862092-update-nginx-perl-support-to-rh-perl530 -extra-task: /CoreOS/nginx/Regression/bz1862092-update-nginx-perl-support-to-rh-perl530 diff --git a/integration/bz1862092-update-nginx-perl-support-to-rh-perl530/runtest.sh b/integration/bz1862092-update-nginx-perl-support-to-rh-perl530/runtest.sh deleted file mode 100755 index e8a2129..0000000 --- a/integration/bz1862092-update-nginx-perl-support-to-rh-perl530/runtest.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# runtest.sh of /CoreOS/nginx/Regression/bz1862092-update-nginx-perl-support-to-rh-perl530 -# Description: Test for BZ#1862092 (update nginx perl support to rh-perl530) -# Author: Iveta Cesalova -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# 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 - -PACKAGES="${PACKAGES:-nginx}" - -rlJournalStart - rlPhaseStartSetup - rlAssertRpm --all - rlAssertBinaryOrigin nginx - rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" - rlRun "pushd $TmpDir" - rlPhaseEnd - - rlPhaseStartTest - rlRun "rpm -qR rh-nginx118-nginx-mod-http-perl | tee output.txt" - rlAssertGrep rh-perl530 output.txt - rlAssertNotGrep rh-perl526 output.txt - rlPhaseEnd - - rlPhaseStartCleanup - rlRun "popd" - rlRun "rm -r $TmpDir" 0 "Removing tmp directory" - rlPhaseEnd -rlJournalPrintText -rlJournalEnd