test_suite: fix check for logfiles of host beeing nor primary nor designated primary

This commit is contained in:
Frank Liepold 2014-03-14 09:02:15 +01:00 committed by Thomas Schoebel-Theuer
parent c831e34cec
commit eafdd66914
1 changed files with 10 additions and 3 deletions

View File

@ -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