This patch fixes what I believe is a wrong logic in test 3 of this
script right after the last "crontab -l ..." command. In my system the cron table is empty; this command will return false and the else clause will never be executed. If the command returns true (0) then the cron table is not empty as it was supposed to be and the script must indicate an error.

Signed-Off-By: Elder Costa <[EMAIL PROTECTED]>


Bellow the output before and after applying the patch.

Regards.

Elder.


------------------------------

cron01 0 INFO : Test #1: crontab <filename> installs the crontab file cron01 0 INFO : Test #1: cron schedules the job listed in crontab file.
cron01      0  INFO  :  Test #1: Installing cron job ...
cron01      0  INFO  :  Test #1: Cronjob installed successfully
cron01      0  INFO  :  Test #1: /var/log/cron: Trying altenate log...
cron01      0  INFO  :  Test #1: cron activity logged in /var/log/messages
cron01      0  INFO  :  Test #1: Values are good:
    Expected 38;     Received 38
cron01      0  INFO  :  Test #1: Values are good:
    Expected 39;     Received 39
cron01      0  INFO  :  Test #1: Values are good:
    Expected 40;     Received 40
cron01      0  INFO  :  Test #1: Values are good:
    Expected 41;     Received 41
cron01      0  INFO  :  Test #1: Values are good:
    Expected 42;     Received 42
cron01      0  INFO  :  Test #1: /var/log/cron: alternate...
cron01 1 PASS : Test #1: installed cronjob, and cron executed the cronjob.
cron02      0  INFO  :  Test #2: crontab -r removes the crontab file.
cron02      0  INFO  :  Test #2: installing crontab file.
cron02      0  INFO  :  Test #1: /var/log/cron: alternate...
cron02      0  INFO  :  Test #2: uninstalling crontab file.
cron02      0  INFO  :  Test #1: /var/log/cron: alternate...
cron02      2  PASS  :  Test #2: crontab removed the cronjob
cron03      0  INFO  :  Test #3: crontab -l lists the cronjobs installed
cron03      0  INFO  :  Test #3: installing crontab file ...
cron03      0  INFO  :  Test #3: Cron job installed.
cron03      0  INFO  :  Test #3: crontab -l listed cronjob tst2_cronprg.sh
cron03      0  INFO  :  Test #3: uninstalling crontab file.


------------------------------

cron01 0 INFO : Test #1: crontab <filename> installs the crontab file cron01 0 INFO : Test #1: cron schedules the job listed in crontab file.
cron01      0  INFO  :  Test #1: Installing cron job ...
cron01      0  INFO  :  Test #1: Cronjob installed successfully
cron01      0  INFO  :  Test #1: /var/log/cron: Trying altenate log...
cron01      0  INFO  :  Test #1: cron activity logged in /var/log/messages
cron01      0  INFO  :  Test #1: Values are good:
    Expected 28;     Received 28
cron01      0  INFO  :  Test #1: Values are good:
    Expected 29;     Received 29
cron01      0  INFO  :  Test #1: Values are good:
    Expected 30;     Received 30
cron01      0  INFO  :  Test #1: Values are good:
    Expected 31;     Received 31
cron01      0  INFO  :  Test #1: Values are good:
    Expected 32;     Received 32
cron01      0  INFO  :  Test #1: /var/log/cron: alternate...
cron01 1 PASS : Test #1: installed cronjob, and cron executed the cronjob.
cron02      0  INFO  :  Test #2: crontab -r removes the crontab file.
cron02      0  INFO  :  Test #2: installing crontab file.
cron02      0  INFO  :  Test #1: /var/log/cron: alternate...
cron02      0  INFO  :  Test #2: uninstalling crontab file.
cron02      0  INFO  :  Test #1: /var/log/cron: alternate...
cron02      2  PASS  :  Test #2: crontab removed the cronjob
cron03      0  INFO  :  Test #3: crontab -l lists the cronjobs installed
cron03      0  INFO  :  Test #3: installing crontab file ...
cron03      0  INFO  :  Test #3: Cron job installed.
cron03      0  INFO  :  Test #3: crontab -l listed cronjob tst2_cronprg.sh
cron03      0  INFO  :  Test #3: uninstalling crontab file.
cron03      0  INFO  :  crontab uninstalled all jobs for user
cron03      3  PASS  :  crontab did not list any cronjobs


------------------------------
 .



--- ltp-cvs-081030a/testcases/commands/cron/cron_tests.sh.ORIG	2008-10-30 13:55:45.000000000 -0200
+++ ltp-cvs-081030a/testcases/commands/cron/cron_tests.sh	2008-10-30 13:51:51.000000000 -0200
@@ -389,11 +389,15 @@
 	then
 		$LTPBIN/tst_res TFAIL $LTPTMP/cron_tst2n1.out \
 			"Test #3: crontab failed removing cronjob. Reason:"
-		 		 TFAILCNT=$(( $TFAILCNT+1 ))
+		TFAILCNT=$(( $TFAILCNT+1 ))
+	else
+		$LTPBIN/tst_resm TINFO "crontab uninstalled all jobs for user"
+		$LTPBIN/tst_resm TPASS "crontab did not list any cronjobs"
 	fi
 else
-	$LTPBIN/tst_resm TINFO "crontab uninstalled all jobs for user"
-	$LTPBIN/tst_resm TPASS "crontab did not list any cronjobs"
+	$LTPBIN/tst_res TFAIL $LTPTMP/cron_tst2n1.out \
+		"Test #3: crontab failed removing cronjob. Reason:"
+	TFAILCNT=$(( $TFAILCNT+1 ))
 fi
 
 exit $TFAILCNT

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to