From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YvMmY-0006oh-T6 for ltp-list@lists.sourceforge.net; Thu, 21 May 2015 09:28:50 +0000 Received: from szxga02-in.huawei.com ([119.145.14.65]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YvMmS-0001Mv-TC for ltp-list@lists.sourceforge.net; Thu, 21 May 2015 09:28:50 +0000 Message-ID: <555DA53C.10008@huawei.com> Date: Thu, 21 May 2015 17:28:28 +0800 From: s00318865 MIME-Version: 1.0 References: <1430827933-219682-1-git-send-email-cuibixuan@huawei.com> <555D8E94.20605@huawei.com> In-Reply-To: <555D8E94.20605@huawei.com> Subject: Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============4600030550000222402==" Errors-To: ltp-list-bounces@lists.sourceforge.net To: Cui Bixuan Cc: ltp-list@lists.sourceforge.net, peifeiyue@huawei.com --===============4600030550000222402== Content-Type: multipart/alternative; boundary="------------080209050406070206060703" --------------080209050406070206060703 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit On 2015/5/21 15:51, Cui Bixuan wrote: > > > -------- Original Message -------- > Subject: [LTP] [PATCH] commands/logrotate:run the case once again will failed > Date: Tue, 5 May 2015 12:12:13 +0000 > From: Cui Bixuan > To: > CC: , , , Cui Bixuan > > 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 > --- > 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 If the current time is 23:59:59, a problem would occur. It is good to use the following command. rm [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] Of course, it is better if you can find a way to use regular expressions to match it. > > chmod 644 $LTPTMP/tst_logrotate.conf > logrotate -fv $LTPTMP/tst_logrotate.conf > $LTPTMP/tst_logrotate.out 2>&1 \ --------------080209050406070206060703 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 8bit
On 2015/5/21 15:51, Cui Bixuan wrote:


-------- Original Message --------
Subject: [LTP] [PATCH] commands/logrotate:run the case once again will failed
Date: Tue, 5 May 2015 12:12:13 +0000
From: Cui Bixuan <cuibixuan@huawei.com>
To: <ltp-list@lists.sourceforge.net>
CC: <lijinyue@huawei.com>, <zhanyongming@huawei.com>, <zhuyanpeng@huawei.com>, Cui Bixuan <cuibixuan@huawei.com>

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

If the current time is 23:59:59, a problem would occur. It is good to use the following command.
rm [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]
Of course, it is better if you can find a way to use regular expressions to match it.

 	chmod 644 $LTPTMP/tst_logrotate.conf
 	logrotate -fv $LTPTMP/tst_logrotate.conf > $LTPTMP/tst_logrotate.out 2>&1 \

--------------080209050406070206060703-- --===============4600030550000222402== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ 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 --===============4600030550000222402== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list --===============4600030550000222402==-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Yyamh-0004JG-Bc for ltp-list@lists.sourceforge.net; Sat, 30 May 2015 07:02:19 +0000 Received: from szxga03-in.huawei.com ([119.145.14.66]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1Yyamb-0001mp-Tm for ltp-list@lists.sourceforge.net; Sat, 30 May 2015 07:02:19 +0000 Message-ID: <55696062.5010705@huawei.com> Date: Sat, 30 May 2015 15:01:54 +0800 From: Yuan Sun MIME-Version: 1.0 References: <1430827933-219682-1-git-send-email-cuibixuan@huawei.com> <555D8E94.20605@huawei.com> <555DA53C.10008@huawei.com> <5567BFF1.7000503@huawei.com> In-Reply-To: <5567BFF1.7000503@huawei.com> Subject: Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: Cui Bixuan Cc: ltp-list@lists.sourceforge.net, peifeiyue@huawei.com Hi Bixuan, If the current time is 23:59:59 May 30 23:59:59 2015, we start to run the case and /var/log/*20150530* file is created. It has a delay before the program runs the following command added by you. rm -f /var/log/*`date '+%Y%m%d'`* > /dev/null 2>&1 If it is 2 seconds delay, the command will be "rm -f /var/log/*20150531*". The issue leads to the fact the previous log file can't removed. Thanks. Yuan On 2015/5/29 9:25, Cui Bixuan wrote: > On 2015/5/21 17:28, s00318865 wrote: > >> If the current time is 23:59:59, a problem would occur. It is good to use the following command. >> rm [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] >> Of course, it is better if you can find a way to use regular expressions to match it. > "If the current time is 23:59:59, a problem would occur." why? > The error occur when there are messages-20150406 file in /var/log/ and do "logrotate" in 20150406(same day). > > Thanks, > Cui Bixuan > > > > > . > ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Yy95u-0001vC-VI for ltp-list@lists.sourceforge.net; Fri, 29 May 2015 01:28:18 +0000 Received: from szxga01-in.huawei.com ([58.251.152.64]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1Yy95r-0005Ze-Hz for ltp-list@lists.sourceforge.net; Fri, 29 May 2015 01:28:18 +0000 Message-ID: <5567BFF1.7000503@huawei.com> Date: Fri, 29 May 2015 09:25:05 +0800 From: Cui Bixuan MIME-Version: 1.0 References: <1430827933-219682-1-git-send-email-cuibixuan@huawei.com> <555D8E94.20605@huawei.com> <555DA53C.10008@huawei.com> In-Reply-To: <555DA53C.10008@huawei.com> Subject: Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: s00318865 Cc: ltp-list@lists.sourceforge.net, peifeiyue@huawei.com On 2015/5/21 17:28, s00318865 wrote: > > If the current time is 23:59:59, a problem would occur. It is good to use the following command. > rm [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] > Of course, it is better if you can find a way to use regular expressions to match it. "If the current time is 23:59:59, a problem would occur." why? The error occur when there are messages-20150406 file in /var/log/ and do "logrotate" in 20150406(same day). Thanks, Cui Bixuan ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YpbiL-0003A8-Ip for ltp-list@lists.sourceforge.net; Tue, 05 May 2015 12:12:41 +0000 Received: from szxga01-in.huawei.com ([58.251.152.64]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YpbiG-0000vA-Bx for ltp-list@lists.sourceforge.net; Tue, 05 May 2015 12:12:41 +0000 From: Cui Bixuan Date: Tue, 5 May 2015 12:12:13 +0000 Message-ID: <1430827933-219682-1-git-send-email-cuibixuan@huawei.com> MIME-Version: 1.0 Subject: [LTP] [PATCH] commands/logrotate:run the case once again will failed List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: ltp-list@lists.sourceforge.net Cc: zhuyanpeng@huawei.com, zhanyongming@huawei.com 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 --- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YzGeb-0005pZ-0z for ltp-list@lists.sourceforge.net; Mon, 01 Jun 2015 03:44:45 +0000 Received: from szxga01-in.huawei.com ([58.251.152.64]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YzGeX-0001Lv-D8 for ltp-list@lists.sourceforge.net; Mon, 01 Jun 2015 03:44:45 +0000 Message-ID: <556BD50E.9070705@huawei.com> Date: Mon, 1 Jun 2015 11:44:14 +0800 From: Yuan Sun MIME-Version: 1.0 References: <1430827933-219682-1-git-send-email-cuibixuan@huawei.com> <555D8E94.20605@huawei.com> <555DA53C.10008@huawei.com> <5567BFF1.7000503@huawei.com> <55696062.5010705@huawei.com> <912409436.7035606.1433126786886.JavaMail.zimbra@redhat.com> In-Reply-To: <912409436.7035606.1433126786886.JavaMail.zimbra@redhat.com> Subject: Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: Li Wang Cc: ltp-list@lists.sourceforge.net, peifeiyue@huawei.com On 2015/6/1 10:46, Li Wang wrote: > Hi, > > ----- Original Message ----- >> Hi Bixuan, >> If the current time is 23:59:59 May 30 23:59:59 2015, we start to run >> the case and /var/log/*20150530* file is created. >> It has a delay before the program runs the following command added by you. >> rm -f /var/log/*`date '+%Y%m%d'`* > /dev/null 2>&1 > IMO, Bixuan's solution is pretty well. Even though the situation like that: > "If the current time is 23:59:59 May 30 23:59:59 2015" and then will be > "rm -f /var/log/*20150531*". > > It's means, > > The original file is: /var/log/messages-20150530.gz > The removed file is: /var/log/messages-20150531.gz > >> If it is 2 seconds delay, the command will be "rm -f /var/log/*20150531*". >> The issue leads to the fact the previous log file can't removed. > But that's okay, the case wouldn't fail like: > 'error: destination /var/log/messages-20150531.gz already exists,skipping > rotation'. > > Because there will never be a name conflicts. Yes. I understand. It is a small probability event. Regards, Yuan > > Regards, > Li Wang > > >> Thanks. >> Yuan >> >> On 2015/5/29 9:25, Cui Bixuan wrote: >>> On 2015/5/21 17:28, s00318865 wrote: >>> >>>> If the current time is 23:59:59, a problem would occur. It is good to use >>>> the following command. >>>> rm [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] >>>> Of course, it is better if you can find a way to use regular expressions >>>> to match it. >>> "If the current time is 23:59:59, a problem would occur." why? >>> The error occur when there are messages-20150406 file in /var/log/ and do >>> "logrotate" in 20150406(same day). >>> >>> Thanks, >>> Cui Bixuan >>> >>> >>> >>> >>> . >>> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Ltp-list mailing list >> Ltp-list@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/ltp-list >> > . > ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YzFkN-00012n-BG for ltp-list@lists.sourceforge.net; Mon, 01 Jun 2015 02:46:39 +0000 Received: from mx3-phx2.redhat.com ([209.132.183.24]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1YzFkL-0007Rg-M8 for ltp-list@lists.sourceforge.net; Mon, 01 Jun 2015 02:46:39 +0000 Date: Sun, 31 May 2015 22:46:26 -0400 (EDT) From: Li Wang Message-ID: <912409436.7035606.1433126786886.JavaMail.zimbra@redhat.com> In-Reply-To: <55696062.5010705@huawei.com> References: <1430827933-219682-1-git-send-email-cuibixuan@huawei.com> <555D8E94.20605@huawei.com> <555DA53C.10008@huawei.com> <5567BFF1.7000503@huawei.com> <55696062.5010705@huawei.com> MIME-Version: 1.0 Subject: Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: Yuan Sun Cc: ltp-list@lists.sourceforge.net, peifeiyue@huawei.com Hi, ----- Original Message ----- > > Hi Bixuan, > If the current time is 23:59:59 May 30 23:59:59 2015, we start to run > the case and /var/log/*20150530* file is created. > It has a delay before the program runs the following command added by you. > rm -f /var/log/*`date '+%Y%m%d'`* > /dev/null 2>&1 IMO, Bixuan's solution is pretty well. Even though the situation like that: "If the current time is 23:59:59 May 30 23:59:59 2015" and then will be "rm -f /var/log/*20150531*". It's means, The original file is: /var/log/messages-20150530.gz The removed file is: /var/log/messages-20150531.gz > > If it is 2 seconds delay, the command will be "rm -f /var/log/*20150531*". > The issue leads to the fact the previous log file can't removed. But that's okay, the case wouldn't fail like: 'error: destination /var/log/messages-20150531.gz already exists,skipping rotation'. Because there will never be a name conflicts. Regards, Li Wang > Thanks. > Yuan > > On 2015/5/29 9:25, Cui Bixuan wrote: > > On 2015/5/21 17:28, s00318865 wrote: > > > >> If the current time is 23:59:59, a problem would occur. It is good to use > >> the following command. > >> rm [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] > >> Of course, it is better if you can find a way to use regular expressions > >> to match it. > > "If the current time is 23:59:59, a problem would occur." why? > > The error occur when there are messages-20150406 file in /var/log/ and do > > "logrotate" in 20150406(same day). > > > > Thanks, > > Cui Bixuan > > > > > > > > > > . > > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Ltp-list mailing list > Ltp-list@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/ltp-list > ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZC7Ne-0005Tp-6N for ltp-list@lists.sourceforge.net; Mon, 06 Jul 2015 14:28:22 +0000 Received: from aserp1040.oracle.com ([141.146.126.69]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1ZC7Nd-0005Kb-Bv for ltp-list@lists.sourceforge.net; Mon, 06 Jul 2015 14:28:22 +0000 Message-ID: <559A9148.8060200@oracle.com> Date: Mon, 06 Jul 2015 17:31:36 +0300 From: Alexey Kodanev MIME-Version: 1.0 References: <1430827933-219682-1-git-send-email-cuibixuan@huawei.com> <5593E172.1050800@huawei.com> <5593F4E2.1040804@oracle.com> <55952961.30906@huawei.com> <5595490E.1010509@oracle.com> <55974D10.5050808@huawei.com> In-Reply-To: <55974D10.5050808@huawei.com> Subject: Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: Cui Bixuan Cc: zhuyanpeng@huawei.com, ltp-list@lists.sourceforge.net, zhanyongming@huawei.com Hi, On 07/04/2015 06:03 AM, Cui Bixuan wrote: > Hi, > Your method is better than mine (I learned that how to use logrotate command again yesterday and > found that remove messages-* is not a good idea). > > We can remove 'include /etc/logrotate.d' and delete 'grep including /etc/logrotate.d $LTPTMP/tst_logrotate.out' > in case to fix it, what do you think? If ok, I will send a new patch. OK. > In addition, I have a question, Why including the rules in /etc/logrotate.d/ will cause the case failed > when run it at the second time? You have already written the explanation - it failed because file with the same name exists. Moreover, I can't reproduce it in my system. You should check what kind of rules do you have for "/var/log/messages" in /etc/logrotate.d/. Thanks, Alexey ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZD4oz-0001xO-TZ for ltp-list@lists.sourceforge.net; Thu, 09 Jul 2015 05:56:33 +0000 Received: from userp1040.oracle.com ([156.151.31.81]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1ZD4ox-0006i0-Na for ltp-list@lists.sourceforge.net; Thu, 09 Jul 2015 05:56:33 +0000 Message-ID: <559E0DD1.4010903@oracle.com> Date: Thu, 09 Jul 2015 08:59:45 +0300 From: Alexey Kodanev MIME-Version: 1.0 References: <1430827933-219682-1-git-send-email-cuibixuan@huawei.com> <5593E172.1050800@huawei.com> <5593F4E2.1040804@oracle.com> <55952961.30906@huawei.com> <5595490E.1010509@oracle.com> <55974D10.5050808@huawei.com> <559A9148.8060200@oracle.com> <559B983A.3090003@huawei.com> In-Reply-To: <559B983A.3090003@huawei.com> Subject: Re: [LTP] [PATCH v2] commands/logrotate:run the case once again will failed List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: Cui Bixuan Cc: zhuyanpeng@huawei.com, ltp-list@lists.sourceforge.net, zhanyongming@huawei.com Hi, Applied with changed commit message and subject, also removed the comment above 'include'. Thanks, Alexey ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZCOxX-0004d7-Ea for ltp-list@lists.sourceforge.net; Tue, 07 Jul 2015 09:14:35 +0000 Received: from szxga03-in.huawei.com ([119.145.14.66]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1ZCOxU-0003aW-DJ for ltp-list@lists.sourceforge.net; Tue, 07 Jul 2015 09:14:35 +0000 Message-ID: <559B983A.3090003@huawei.com> Date: Tue, 7 Jul 2015 17:13:30 +0800 From: Cui Bixuan MIME-Version: 1.0 References: <1430827933-219682-1-git-send-email-cuibixuan@huawei.com> <5593E172.1050800@huawei.com> <5593F4E2.1040804@oracle.com> <55952961.30906@huawei.com> <5595490E.1010509@oracle.com> <55974D10.5050808@huawei.com> <559A9148.8060200@oracle.com> In-Reply-To: <559A9148.8060200@oracle.com> Subject: [LTP] [PATCH v2] commands/logrotate:run the case once again will failed List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: Alexey Kodanev Cc: zhuyanpeng@huawei.com, ltp-list@lists.sourceforge.net, zhanyongming@huawei.com Including the rules in /etc/logrotate.d/ will cause the case failed when run it at the second time. Signed-off-by: Alexey Kodanev Signed-off-by: Cui Bixuan --- testcases/commands/logrotate/logrotate_tests.sh | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/testcases/commands/logrotate/logrotate_tests.sh b/testcases/commands/logrotate/logrotate_tests.sh index 2a793cc..e845670 100755 --- a/testcases/commands/logrotate/logrotate_tests.sh +++ b/testcases/commands/logrotate/logrotate_tests.sh @@ -163,8 +163,6 @@ test01() compress # RPM packages drop log rotation information into this directory - include /etc/logrotate.d - /var/log/tst_logfile { rotate 5 weekly @@ -201,8 +199,6 @@ test01() # check if /etc/logrotate.d is included/ # check if 5 rotations are forced. # check if compression is done. - grep "including /etc/logrotate.d" $LTPTMP/tst_logrotate.out \ - > $LTPTMP/tst_logrotate.err 2>&1 || RC=$? grep "reading config file $LTPTMP/tst_logrotate.conf" \ $LTPTMP/tst_logrotate.out > $LTPTMP/tst_logrotate.err 2>&1 || RC=$? grep "forced from command line (5 rotations)" \ -- 1.6.0.2 ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZAfKK-0004QW-HG for ltp-list@lists.sourceforge.net; Thu, 02 Jul 2015 14:18:56 +0000 Received: from aserp1040.oracle.com ([141.146.126.69]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1ZAfKF-00083K-3B for ltp-list@lists.sourceforge.net; Thu, 02 Jul 2015 14:18:56 +0000 Message-ID: <5595490E.1010509@oracle.com> Date: Thu, 02 Jul 2015 17:22:06 +0300 From: Alexey Kodanev MIME-Version: 1.0 References: <1430827933-219682-1-git-send-email-cuibixuan@huawei.com> <5593E172.1050800@huawei.com> <5593F4E2.1040804@oracle.com> <55952961.30906@huawei.com> In-Reply-To: <55952961.30906@huawei.com> Subject: Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: Cui Bixuan Cc: zhuyanpeng@huawei.com, ltp-list@lists.sourceforge.net, zhanyongming@huawei.com Hi, On 07/02/2015 03:06 PM, Cui Bixuan wrote: > On 2015/7/1 22:10, Alexey Kodanev wrote: >> The test creates only tst_logfile, why it should remove 'messages-*' and other system logs? >> >> I see that its configuration file includes logrotate.d/, is it really needed by the test? >> > The tst_logfile of test created is 'messages-*' and the 'messages-*' will cause the case failed, > so we should delete it if we want to the case run succeed at the second time. OK, the test does the following basic steps: a. create tst_logfile, fill it with messages; b. ./logrotate c. if [ -f tst_logfile.1.gz ] then test passed. Therefore, why bother about 'messages-*' and other logs, the test doesn't check if they were rotated/compressed... so, may be, we should remove "include /etc/logrotate.d/" from the test configuration file so that logrotate rotated only "tst_logfile" and nothing else, what do you think? Thanks, Alexey > And the test creates tst_logfile base on day time. For example, the system time is '2015 Jul 3', > then the case will create 'messages-20150703.gz'. So 'rm -r /var/log/*`date '+%Y%m%d'`*' in patch > only delete the message file of case created (after running it) and not other system logs. > > I think, if the logrotate testcase fail when run it the second time,it's a problem of > testcase and we should fix it. ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZAIfo-0000mM-EZ for ltp-list@lists.sourceforge.net; Wed, 01 Jul 2015 14:07:36 +0000 Received: from aserp1040.oracle.com ([141.146.126.69]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1ZAIfn-0002DN-37 for ltp-list@lists.sourceforge.net; Wed, 01 Jul 2015 14:07:36 +0000 Message-ID: <5593F4E2.1040804@oracle.com> Date: Wed, 01 Jul 2015 17:10:42 +0300 From: Alexey Kodanev MIME-Version: 1.0 References: <1430827933-219682-1-git-send-email-cuibixuan@huawei.com> <5593E172.1050800@huawei.com> In-Reply-To: <5593E172.1050800@huawei.com> Subject: Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: Cui Bixuan Cc: zhuyanpeng@huawei.com, ltp-list@lists.sourceforge.net, zhanyongming@huawei.com Hi, On 07/01/2015 03:47 PM, Cui Bixuan wrote: > ping ~~ :-) > > On 2015/5/5 20:12, Cui Bixuan wrote: >> 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 >> --- >> 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 >> The test creates only tst_logfile, why it should remove 'messages-*' and other system logs? I see that its configuration file includes logrotate.d/, is it really needed by the test? Thanks, Alexey ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZAdHG-0001zu-OA for ltp-list@lists.sourceforge.net; Thu, 02 Jul 2015 12:07:38 +0000 Received: from szxga02-in.huawei.com ([119.145.14.65]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1ZAdHB-00035X-TH for ltp-list@lists.sourceforge.net; Thu, 02 Jul 2015 12:07:38 +0000 Message-ID: <55952961.30906@huawei.com> Date: Thu, 2 Jul 2015 20:06:57 +0800 From: Cui Bixuan MIME-Version: 1.0 References: <1430827933-219682-1-git-send-email-cuibixuan@huawei.com> <5593E172.1050800@huawei.com> <5593F4E2.1040804@oracle.com> In-Reply-To: <5593F4E2.1040804@oracle.com> Subject: Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: Alexey Kodanev Cc: zhuyanpeng@huawei.com, ltp-list@lists.sourceforge.net, zhanyongming@huawei.com On 2015/7/1 22:10, Alexey Kodanev wrote: > Hi, > On 07/01/2015 03:47 PM, Cui Bixuan wrote: >> ping ~~ :-) >> >> On 2015/5/5 20:12, Cui Bixuan wrote: >>> 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 >>> --- >>> 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 >>> > > The test creates only tst_logfile, why it should remove 'messages-*' and other system logs? > > I see that its configuration file includes logrotate.d/, is it really needed by the test? > The tst_logfile of test created is 'messages-*' and the 'messages-*' will cause the case failed, so we should delete it if we want to the case run succeed at the second time. And the test creates tst_logfile base on day time. For example, the system time is '2015 Jul 3', then the case will create 'messages-20150703.gz'. So 'rm -r /var/log/*`date '+%Y%m%d'`*' in patch only delete the message file of case created (after running it) and not other system logs. I think, if the logrotate testcase fail when run it the second time,it's a problem of testcase and we should fix it. Thanks, Cui Bixuan > Thanks, > Alexey > > > ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZBDkd-0007mW-TM for ltp-list@lists.sourceforge.net; Sat, 04 Jul 2015 03:04:23 +0000 Received: from szxga02-in.huawei.com ([119.145.14.65]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1ZBDkb-0004Cz-3Z for ltp-list@lists.sourceforge.net; Sat, 04 Jul 2015 03:04:23 +0000 Message-ID: <55974D10.5050808@huawei.com> Date: Sat, 4 Jul 2015 11:03:44 +0800 From: Cui Bixuan MIME-Version: 1.0 References: <1430827933-219682-1-git-send-email-cuibixuan@huawei.com> <5593E172.1050800@huawei.com> <5593F4E2.1040804@oracle.com> <55952961.30906@huawei.com> <5595490E.1010509@oracle.com> In-Reply-To: <5595490E.1010509@oracle.com> Subject: Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: Alexey Kodanev Cc: zhuyanpeng@huawei.com, ltp-list@lists.sourceforge.net, zhanyongming@huawei.com On 2015/7/2 22:22, Alexey Kodanev wrote: > Hi, > On 07/02/2015 03:06 PM, Cui Bixuan wrote: >> On 2015/7/1 22:10, Alexey Kodanev wrote: >>> The test creates only tst_logfile, why it should remove 'messages-*' and other system logs? >>> >>> I see that its configuration file includes logrotate.d/, is it really needed by the test? >>> >> The tst_logfile of test created is 'messages-*' and the 'messages-*' will cause the case failed, >> so we should delete it if we want to the case run succeed at the second time. > > OK, the test does the following basic steps: > > a. create tst_logfile, fill it with messages; > b. ./logrotate > c. if [ -f tst_logfile.1.gz ] then test passed. > > Therefore, why bother about 'messages-*' and other logs, the test doesn't check if they were rotated/compressed... so, may be, we should remove "include /etc/logrotate.d/" from the test configuration file so that logrotate rotated only "tst_logfile" and nothing else, what do you think? > Hi, Your method is better than mine (I learned that how to use logrotate command again yesterday and found that remove messages-* is not a good idea). We can remove 'include /etc/logrotate.d' and delete 'grep including /etc/logrotate.d $LTPTMP/tst_logrotate.out' in case to fix it, what do you think? If ok, I will send a new patch. In addition, I have a question, Why including the rules in /etc/logrotate.d/ will cause the case failed when run it at the second time? Thanks, Cui Bixuan > Thanks, > Alexey > > >> And the test creates tst_logfile base on day time. For example, the system time is '2015 Jul 3', >> then the case will create 'messages-20150703.gz'. So 'rm -r /var/log/*`date '+%Y%m%d'`*' in patch >> only delete the message file of case created (after running it) and not other system logs. >> >> I think, if the logrotate testcase fail when run it the second time,it's a problem of >> testcase and we should fix it. > > > ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZEZih-0007SO-Cl for ltp-list@lists.sourceforge.net; Mon, 13 Jul 2015 09:08:15 +0000 Received: from szxga03-in.huawei.com ([119.145.14.66]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1ZEZid-0004Ec-9j for ltp-list@lists.sourceforge.net; Mon, 13 Jul 2015 09:08:15 +0000 Message-ID: <55A37E00.30200@huawei.com> Date: Mon, 13 Jul 2015 16:59:44 +0800 From: Cui Bixuan MIME-Version: 1.0 References: <1430827933-219682-1-git-send-email-cuibixuan@huawei.com> <5593E172.1050800@huawei.com> <5593F4E2.1040804@oracle.com> <55952961.30906@huawei.com> <5595490E.1010509@oracle.com> <55974D10.5050808@huawei.com> <559A9148.8060200@oracle.com> <559B983A.3090003@huawei.com> <559E0DD1.4010903@oracle.com> In-Reply-To: <559E0DD1.4010903@oracle.com> Subject: Re: [LTP] [PATCH v2] commands/logrotate:run the case once again will failed List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: Alexey Kodanev Cc: zhuyanpeng@huawei.com, ltp-list@lists.sourceforge.net, zhanyongming@huawei.com On 2015/7/9 13:59, Alexey Kodanev wrote: > Applied with changed commit message and subject, also removed the comment above 'include'. thanks for your help. ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZAHQx-0003ft-Gp for ltp-list@lists.sourceforge.net; Wed, 01 Jul 2015 12:48:11 +0000 Received: from szxga01-in.huawei.com ([58.251.152.64]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1ZAHQt-0007Zd-Ls for ltp-list@lists.sourceforge.net; Wed, 01 Jul 2015 12:48:11 +0000 Message-ID: <5593E172.1050800@huawei.com> Date: Wed, 1 Jul 2015 20:47:46 +0800 From: Cui Bixuan MIME-Version: 1.0 References: <1430827933-219682-1-git-send-email-cuibixuan@huawei.com> In-Reply-To: <1430827933-219682-1-git-send-email-cuibixuan@huawei.com> Subject: Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: Cui Bixuan Cc: ltp-list@lists.sourceforge.net, zhanyongming@huawei.com, zhuyanpeng@huawei.com ping ~~ :-) On 2015/5/5 20:12, Cui Bixuan wrote: > 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 > --- > 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 \ > ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list