For the first time,case do 'logrotate -fv tst_logrotate.conf' that will
create the 'half-rotated' file(messages-20150416.gz). When run case again,
the case will fail:
'error: destination /var/log/messages-20150416.gz already exists,skipping
rotation'

'Logrotate' does't expect to find an already existing "half-rotated" file
(http://centos.1050465.n5.nabble.com/CentOS-Logrotate-errors-td5725868.html).
Clean the "half-rotated" file,and the case will pass all the time.

Signed-off-by: Cui Bixuan <cuibix...@huawei.com>
---
 testcases/commands/logrotate/logrotate_tests.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/testcases/commands/logrotate/logrotate_tests.sh 
b/testcases/commands/logrotate/logrotate_tests.sh
index 2a793cc..5b14ca0 100755
--- a/testcases/commands/logrotate/logrotate_tests.sh
+++ b/testcases/commands/logrotate/logrotate_tests.sh
@@ -191,6 +191,7 @@ test01()
        do
                rm -f $files > /dev/null 2>&1
        done
+       rm -f /var/log/*`date '+%Y%m%d'`* > /dev/null 2>&1
 
        chmod 644 $LTPTMP/tst_logrotate.conf
        logrotate -fv $LTPTMP/tst_logrotate.conf > $LTPTMP/tst_logrotate.out 
2>&1 \
-- 
1.6.0.2


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to