From eafdd66914e9518f649903140a11df71c27f2032 Mon Sep 17 00:00:00 2001 From: Frank Liepold Date: Fri, 14 Mar 2014 09:02:15 +0100 Subject: [PATCH] test_suite: fix check for logfiles of host beeing nor primary nor designated primary --- test_suite/mars/modules/logrotate.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test_suite/mars/modules/logrotate.sh b/test_suite/mars/modules/logrotate.sh index 44b1c2b7..52252314 100644 --- a/test_suite/mars/modules/logrotate.sh +++ b/test_suite/mars/modules/logrotate.sh @@ -93,10 +93,17 @@ function logrotate_loop if [ \( $logrotate_rc_act -ne 0 -a $logrotate_rc_req -eq 0 \) \ -o \( $logrotate_rc_act -eq 0 -a $logrotate_rc_req -ne 0 \) ] then - lib_exit 1 "required rc = $logrotate_rc_req != $logrotate_rc_act = act. rc" + lib_exit 1 \ + "required rc = $logrotate_rc_req != $logrotate_rc_act = act. rc" + fi + # log-delete-all may delete *all* logfiles generated by host if the host + # is nor the primary nor the designated primary. Thus if count > 0 + # we omit the check for the last logfile in this situation. + if [ ! \( $rc_prim -eq 0 -a $rc_desig_prim -eq 0 -a count -gt 0 \) ] + then + logfile=$(marsadm_get_last_logfile $host $res $host) || lib_exit 1 + lib_vmsg " last logfile $host:$logfile" fi - logfile=$(marsadm_get_last_logfile $host $res $host) || lib_exit 1 - lib_vmsg " last logfile $host:$logfile" if [ $(($count % $logrotate_number_of_rotates_before_delete)) -eq 0 ] then marsadm_do_cmd $host "log-delete-all" $res || lib_exit 1