diff --git a/Sanity/basic-upstream-test-suite/main.fmf b/Sanity/basic-upstream-test-suite/main.fmf new file mode 100644 index 0000000..825fea9 --- /dev/null +++ b/Sanity/basic-upstream-test-suite/main.fmf @@ -0,0 +1,32 @@ +summary: Runs basic upstream tests +description: '' +contact: + - Zdenek Dohnal + - Petr Dancak +component: + - cups +test: ./runtest.sh +framework: beakerlib +recommend: + - cups + - rpm-build + - pam-devel + - pkgconf-pkg-config + - pkgconfig(gnutls) + - libacl-devel + - openldap-devel + - pkgconfig(libusb-1.0) + - krb5-devel + - pkgconfig(avahi-client) + - systemd + - pkgconfig(libsystemd) + - pkgconfig(dbus-1) + - zlib-devel + - automake + - gcc + - gcc-c++ + - libselinux-devel + - audit-libs-devel +duration: 5m +extra-summary: /CoreOS/cups/Sanity/basic-upstream-test-suite +extra-task: /CoreOS/cups/Sanity/basic-upstream-test-suite diff --git a/Sanity/basic-upstream-test-suite/runtest.sh b/Sanity/basic-upstream-test-suite/runtest.sh new file mode 100755 index 0000000..8a51329 --- /dev/null +++ b/Sanity/basic-upstream-test-suite/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/cups/Sanity/basic-upstream-test-suite +# Description: Runs basic upstream tests +# Author: Zdenek Dohnal +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +PACKAGE="cups" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "useradd cupstester" 0 "Create cups user" + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "chown -R cupstester.cupstester $TmpDir" + rlRun "pushd $TmpDir" + + # extract rpm + rlRun "rlFetchSrcForInstalled $PACKAGE" 0 "Fetching the source rpm" + rlRun "rpm --define '_topdir $TmpDir' -i *src.rpm" 0 "Installing the source rpm" + rlRun "su cupstester -c 'mkdir BUILD'" 0 "Create BUILD directory" + rlRun "su cupstester -c $'rpmbuild --nodeps --define \'_topdir $TmpDir\' -bp $TmpDir/SPECS/*spec'" 0 "Preparing sources" + rlPhaseEnd + + rlPhaseStartTest + rlRun "su cupstester -c $'rpmbuild --nodeps --define \'_topdir $TmpDir\' -bc $TmpDir/SPECS/*spec'" 0 "Build the package" + rlRun "pushd BUILD/cups*" + rlRun "su cupstester -c 'make check'" 0 "Run basic tests" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "userdel -r cupstester" 0 "Remove cupstester" + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Sanity/bz1257751-Email-notifications-lp-m-for-printer-classes/main.fmf b/Sanity/bz1257751-Email-notifications-lp-m-for-printer-classes/main.fmf new file mode 100644 index 0000000..dc83504 --- /dev/null +++ b/Sanity/bz1257751-Email-notifications-lp-m-for-printer-classes/main.fmf @@ -0,0 +1,33 @@ +summary: Test for BZ#1257751 (Email notifications ("lp -m") for printer classes) +description: | + Bug summary: Email notifications ("lp -m") for printer classes don't work + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1257751 +contact: Petr Sklenar +component: + - cups + - sendmail +test: ./runtest.sh +framework: beakerlib +recommend: + - cups + - sendmail +duration: 20m +enabled: true +tag: + - NoRHEL4 + - NoRHEL5 + - TIP_fedora_fail + - TIPfail_infra + - TIPpass + - TIPpass_fedora + - TipFedora +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1257751 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1386689 +adjust: + - enabled: false + when: distro < rhel-6 + continue: false +extra-nitrate: TC#0532204 +extra-summary: /CoreOS/cups/Sanity/bz1257751-Email-notifications-lp-m-for-printer-classes +extra-task: /CoreOS/cups/Sanity/bz1257751-Email-notifications-lp-m-for-printer-classes diff --git a/Sanity/bz1257751-Email-notifications-lp-m-for-printer-classes/runtest.sh b/Sanity/bz1257751-Email-notifications-lp-m-for-printer-classes/runtest.sh new file mode 100755 index 0000000..f964755 --- /dev/null +++ b/Sanity/bz1257751-Email-notifications-lp-m-for-printer-classes/runtest.sh @@ -0,0 +1,76 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cups/Sanity/bz1257751-Email-notifications-lp-m-for-printer-classes +# Description: Test for BZ#1257751 (Email notifications ("lp -m") for printer classes) +# Author: Petr Sklenar +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="cups" +MYHASH=petr$RANDOM +rlJournalStart + rlPhaseStartSetup "setup cups" + rlRun "rpm -q $PACKAGE" + rlFileBackup /etc/cups/cupsd.conf + echo "FileDevice Yes" >> /etc/cups/cupsd.conf + rlServiceStart cups + lpadmin -p testb$MYHASH -v file:///dev/null -E + lpadmin -p testa$MYHASH -v file:///dev/null -E + lpadmin -p testa$MYHASH -c testclass$MYHASH + lpadmin -p testb$MYHASH -c testclass$MYHASH + cupsenable testclass$MYHASH + rlRun "cupsaccept testclass$MYHASH" + rlPhaseEnd + + rlPhaseStartSetup "set up mail" + rlFileBackup --clean /etc/cups/mailto.conf + rlRun "rpm -q sendmail" + echo "Subject $MYHASH" > /etc/cups/mailto.conf + rlServiceStart sendmail + rlPhaseEnd + + rlPhaseStartTest + rlRun "useradd $MYHASH" + rlRun "grep $MYHASH /var/spool/mail/$MYHASH|grep fstab" 1 "no mail should be there" + su $MYHASH -c "lp -d testclass$MYHASH -m /etc/fstab" + rlAssert0 "send a mail as $MYHASH" $? +# rlRun "grep $MYHASH /var/spool/mail/$MYHASH|grep fstab" 1 "no mail as its too quick" +#I thing it shouldn't send mail so quickly ^ + sleep 10 + rlRun "grep $MYHASH /var/spool/mail/$MYHASH|grep fstab" 0 "NOW it should be with MAIL" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "cancel -a" 0 "Cancel job if needed" + rlFileSubmit /var/log/cups/error_log + userdel -r $MYHASH + lpadmin -x testa$MYHASH + lpadmin -x testb$MYHASH + lpadmin -x testclass$MYHASH + rlFileRestore + rlServiceRestore cups + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Sanity/bz2015182-RFE-Implement-IdleExitTimeout-configuration/main.fmf b/Sanity/bz2015182-RFE-Implement-IdleExitTimeout-configuration/main.fmf new file mode 100644 index 0000000..11d1312 --- /dev/null +++ b/Sanity/bz2015182-RFE-Implement-IdleExitTimeout-configuration/main.fmf @@ -0,0 +1,31 @@ +summary: Test for BZ#2015182 (RFE Implement IdleExitTimeout configuration during) +description: | + Bug summary: RFE: Implement IdleExitTimeout configuration during build + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2015182 +contact: + - Petr Sklenar + - Petr Dancak +component: + - cups +test: ./runtest.sh +framework: beakerlib +recommend: + - cups +duration: 5m +enabled: true +tag: + - NoRHEL4 + - NoRHEL5 + - NoRHEL6 + - NoRHEL7 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2015182 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2018955 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2018957 +adjust: + - enabled: false + when: distro == rhel-4, rhel-5, rhel-6, rhel-7 + continue: false +extra-nitrate: TC#0612649 +extra-summary: /CoreOS/cups/Sanity/bz2015182-RFE-Implement-IdleExitTimeout-configuration +extra-task: /CoreOS/cups/Sanity/bz2015182-RFE-Implement-IdleExitTimeout-configuration diff --git a/Sanity/bz2015182-RFE-Implement-IdleExitTimeout-configuration/runtest.sh b/Sanity/bz2015182-RFE-Implement-IdleExitTimeout-configuration/runtest.sh new file mode 100755 index 0000000..55a5b4a --- /dev/null +++ b/Sanity/bz2015182-RFE-Implement-IdleExitTimeout-configuration/runtest.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cups/Sanity/bz2015182-RFE-Implement-IdleExitTimeout-configuration +# Description: Test for BZ#2015182 (RFE Implement IdleExitTimeout configuration during) +# Author: Zdenek Dohnal +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2021 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="cups" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlFileBackup /etc/cups/cupsd.conf + rlRun "sed -i 's,Browsing On,Browsing Off,' /etc/cups/cupsd.conf" 0 "Turn off sharing of queues" + rlRun "sed -i 's,WebInterface Yes,WebInterface No,' /etc/cups/cupsd.conf" 0 "Turn off web interface" + rlPhaseEnd + + rlPhaseStartTest + rlServiceStart cups + rlRun "sleep 65" 0 "Wait till we are sure the default IdleExitTimeout would kick in if set" + if rlIsRHEL ">7" + then + rlRun "systemctl status cups" 0 "If cups was compiled to use unlimited IdleExitTimeout, cupsd should be running" + else + rlLog "The OS is RHEL < 8 or Fedora - the feature is not implemented for RHEL < 7, CUPS in Fedora \ + is not compiled with the option, because its default use is a desktop." + rlRun "systemctl status cups" 3 "CUPS is inactive after IdleExitTimeout on older RHELs and Fedora" + fi + rlPhaseEnd + + rlPhaseStartCleanup + rlServiceRestore + rlFileRestore + rlPhaseEnd +rlJournalPrintText +rlJournalEnd