The cron tests check for Red Hat to decide whether to use /etc/init.d/crond or /etc/init.d/cron. This fails on other distros that use crond, e.g. on Yellow Dog Linux.
Replace the distro test by an actual file existence test, as is done in testcases/kdump/runkdump.sh. Signed-off-by: Geert Uytterhoeven <[email protected]> --- testcases/commands/cron/cron02 | 17 ++++++----------- testcases/commands/cron/cron03 | 17 ++++++----------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/testcases/commands/cron/cron02 b/testcases/commands/cron/cron02 index 6e4d8fe..b2656e3 100755 --- a/testcases/commands/cron/cron02 +++ b/testcases/commands/cron/cron02 @@ -53,17 +53,12 @@ do_setup(){ fi # restart cron daemon -# Red Hat uses crond, SuSE/Other uses cron. Check if this is Red Hat/SuSE/Other -tvar=${MACHTYPE%-*} -tvar=${tvar#*-} -printf "Distro type is: $tvar\n\n" - -if [ $tvar != "redhat" -a $tvar != "redhat-linux" ]; then - - /etc/init.d/cron restart -else - /etc/init.d/crond restart -fi + # Red Hat uses crond, SuSE/Other uses cron. + if [ -f /etc/init.d/crond ]; then + /etc/init.d/crond restart + else + /etc/init.d/cron restart + fi } #----------------------------------------------------------------------- diff --git a/testcases/commands/cron/cron03 b/testcases/commands/cron/cron03 index 9448cc4..2cb157a 100755 --- a/testcases/commands/cron/cron03 +++ b/testcases/commands/cron/cron03 @@ -56,17 +56,12 @@ do_setup(){ } fi # restart cron daemon -# Red Hat uses crond, SuSE/Other uses cron. Check if this is Red Hat/SuSE/Other -tvar=${MACHTYPE%-*} -tvar=${tvar#*-} -printf "Distro type is: $tvar\n\n" - -if [ $tvar != "redhat" -a $tvar != "redhat-linux" ]; then - - /etc/init.d/cron restart -else - /etc/init.d/crond restart -fi + # Red Hat uses crond, SuSE/Other uses cron. + if [ -f /etc/init.d/crond ]; then + /etc/init.d/crond restart + else + /etc/init.d/cron restart + fi } #----------------------------------------------------------------------- -- 1.6.2.4 ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
