diff --git a/Regression/bz1677440-pstops-doesn-t-clean-up-after-SIGPIPE-floods/main.fmf b/Regression/bz1677440-pstops-doesn-t-clean-up-after-SIGPIPE-floods/main.fmf new file mode 100644 index 0000000..8f796b4 --- /dev/null +++ b/Regression/bz1677440-pstops-doesn-t-clean-up-after-SIGPIPE-floods/main.fmf @@ -0,0 +1,27 @@ +summary: Test for BZ#1677440 (pstops doesn't clean up after SIGPIPE -- floods) +description: | + Bug summary: pstops doesn't clean up after SIGPIPE -- floods /var/spool/cups/tmp with files + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1677440 +contact: Petr Sklenar +component: + - cups +test: ./runtest.sh +framework: beakerlib +recommend: + - cups +duration: 5m +enabled: true +tag: + - NoRHEL4 + - NoRHEL5 + - TIPfail_infra + - TIPpass +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1677440 +adjust: + - enabled: false + when: distro == rhel-4, rhel-5 + continue: false +extra-nitrate: TC#0597637 +extra-summary: /CoreOS/cups/Regression/bz1677440-pstops-doesn-t-clean-up-after-SIGPIPE-floods +extra-task: /CoreOS/cups/Regression/bz1677440-pstops-doesn-t-clean-up-after-SIGPIPE-floods diff --git a/Regression/bz1677440-pstops-doesn-t-clean-up-after-SIGPIPE-floods/runtest.sh b/Regression/bz1677440-pstops-doesn-t-clean-up-after-SIGPIPE-floods/runtest.sh new file mode 100755 index 0000000..ec07079 --- /dev/null +++ b/Regression/bz1677440-pstops-doesn-t-clean-up-after-SIGPIPE-floods/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/Regression/bz1677440-pstops-doesn-t-clean-up-after-SIGPIPE-floods +# Description: Test for BZ#1677440 (pstops doesn't clean up after SIGPIPE -- floods) +# 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 "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlServiceStart cups + rlPhaseEnd + + rlPhaseStartTest + rlRun "lpadmin -p broken -m drv:///sample.drv/generic.ppd -v socket://broken/ -o printer-error-policy=retry-current-job -E" 0 "Create non-functional printer." + rlRun "lp -d broken -n 2 -o Collate /etc/fstab" 0 "Print /etc/fstab in two copies collated." + rlRun "sleep 10" 0 "Wait 10 seconds." + rlRun "cancel -a" 0 "Cancel all jobs." + # We have clean directory only on RHEL 6, CUPS on newer RHELs perserves + # job files for one day by default, so there will be several files + # in the directory. + rlAssertLesserOrEqual "There should be only a few files in /var/spool/cups/tmp" `ls -l /var/spool/cups/tmp | wc -l` 5 + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "rm -f /var/spool/cups/tmp/*" 0 "Clean cups tmp dir." + rlServiceStop cups + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd