From Fedora Project Wiki

(Created page with '== Test case for crontabs == Create directory containing executable files (755), with some file for reading (644) and some file which is filtered: *.{rpmsave,rpmorig,rpmnew,swp,c...')
 
mNo edit summary
Line 1: Line 1:
== Test case for crontabs ==
{{QA/Test_Case
Create directory containing executable files (755), with some file for reading (644) and some file which is filtered: *.{rpmsave,rpmorig,rpmnew,swp,cfsaved}
|description=run-parts is able to run scripts in a directory. The command run-parts is used for cron.daily jobs.
|setup=Run command ''tail -f /var/log/cron'' in one terminal (as root).
|actions=As root try to execute run-parts with(out) options. Pay attention to directory, which you'll run. For example prelink in /etc/cron.daily runs quite long. You might need create your own directory with test files.
# Execute: ''run-parts /etc/cron.daily''
|results=Scripts in your directory were executed.
# This can be verified by checking /var/log/cron, where are logged starting/finishing of jobs eg:


run-parts --test your_directory - will list files, which would be executed
Jan  4 08:39:47 hostname run-parts(/etc/cron.daily)[3204]: starting tmpwatch


run-parts --list your_directory - will list all files, which are not filtered
Jan  4 08:39:47 hostname run-parts(/etc/cron.daily)[6432]: finished tmpwatch
 
}}
run-parts still should work for cron.daily. It means you should check whether cron.daily runs in /var/log/cron after update. It runs only once a day, so it's possible that it run before your update.
 
(Automatic regression tests are in progress).

Revision as of 08:12, 4 January 2011

Description

run-parts is able to run scripts in a directory. The command run-parts is used for cron.daily jobs.

Setup

Run command tail -f /var/log/cron in one terminal (as root).

How to test

As root try to execute run-parts with(out) options. Pay attention to directory, which you'll run. For example prelink in /etc/cron.daily runs quite long. You might need create your own directory with test files.

  1. Execute: run-parts /etc/cron.daily

Expected Results

Scripts in your directory were executed.

  1. This can be verified by checking /var/log/cron, where are logged starting/finishing of jobs eg:

Jan 4 08:39:47 hostname run-parts(/etc/cron.daily)[3204]: starting tmpwatch

Jan 4 08:39:47 hostname run-parts(/etc/cron.daily)[6432]: finished tmpwatch