Stop CUPS service and backup /etc/cups every time
This commit is contained in:
parent
fb27c0fce5
commit
f370b68732
7 changed files with 21 additions and 8 deletions
|
|
@ -33,7 +33,8 @@ PACKAGE="cups"
|
|||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlServiceStart cups
|
||||
rlFileBackup --clean /etc/cups
|
||||
rlServiceStart cups
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
|
|
@ -43,6 +44,7 @@ rlJournalStart
|
|||
|
||||
rlPhaseStartCleanup
|
||||
rlServiceRestore cups
|
||||
rlFileRestore
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ rlJournalStart
|
|||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlFileBackup --clean /etc/cups
|
||||
rlRun "cp gstoraster.ras $TmpDir"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlServiceStart cups
|
||||
|
|
@ -47,6 +48,7 @@ rlJournalStart
|
|||
rlPhaseStartCleanup
|
||||
rlRun "lpadmin -x test"
|
||||
rlServiceRestore cups
|
||||
rlFileRestore
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
|
|
|
|||
|
|
@ -34,18 +34,20 @@ LOG_DIRECTORY="/var/log/cups"
|
|||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlServiceStart cups
|
||||
rlFileBackup --clean /etc/cups
|
||||
rlServiceStart cups
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "cd $LOG_DIRECTORY"
|
||||
for log_file in `find -iname "*log"`; do
|
||||
rlAssertEquals "Checking permissions for $log_file" `stat -c "%a" $log_file` 600
|
||||
done
|
||||
rlRun "cd $LOG_DIRECTORY"
|
||||
for log_file in `find -iname "*log"`; do
|
||||
rlAssertEquals "Checking permissions for $log_file" `stat -c "%a" $log_file` 600
|
||||
done
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlServiceRestore cups
|
||||
rlServiceRestore cups
|
||||
rlFileRestore
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ rlJournalStart
|
|||
rlAssertRpm $PACKAGE
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlFileBackup --clean /etc/cups
|
||||
rlServiceStart cups
|
||||
rlPhaseEnd
|
||||
|
||||
|
|
@ -52,6 +53,7 @@ rlJournalStart
|
|||
rlPhaseStartCleanup
|
||||
rlRun "lpadmin -x broken"
|
||||
rlServiceRestore cups
|
||||
rlFileRestore
|
||||
rlRun "rm -f /var/spool/cups/tmp/*" 0 "Clean cups tmp dir."
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ rlJournalStart
|
|||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "cp test.ppd $TmpDir" 0 "Copy the ppd"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlFileBackup --clean /etc/cups
|
||||
rlServiceStart cups
|
||||
rlPhaseEnd
|
||||
|
||||
|
|
@ -46,6 +47,7 @@ rlJournalStart
|
|||
rlPhaseStartCleanup
|
||||
rlRun "lpadmin -x test" 0 "Remove the print queue"
|
||||
rlServiceRestore cups
|
||||
rlFileRestore
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ rlJournalStart
|
|||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
cp lpdittome $TmpDir/.
|
||||
rlRun "pushd $TmpDir"
|
||||
rlFileBackup --clean /etc/cups
|
||||
rlServiceStart $PACKAGE
|
||||
sleep 3
|
||||
rlRun "cupsctl LogLevel=debug2"
|
||||
|
|
@ -80,6 +81,8 @@ rlJournalStart
|
|||
lpdittomePID=$(ps | grep lpdittome | awk '{print $1}')
|
||||
rlRun "kill $lpdittomePID"
|
||||
rlRun "lpadmin -x test"
|
||||
rlServiceRestore cups
|
||||
rlFileRestore
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ rlJournalStart
|
|||
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."
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue