* [LTP] [PATCH] commands/logrotate:run the case once again will failed
@ 2015-05-05 12:12 Cui Bixuan
[not found] ` <555D8E94.20605@huawei.com>
2015-07-01 12:47 ` Cui Bixuan
0 siblings, 2 replies; 15+ messages in thread
From: Cui Bixuan @ 2015-05-05 12:12 UTC (permalink / raw)
To: ltp-list; +Cc: zhuyanpeng, zhanyongming
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
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
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed
[not found] ` <555D8E94.20605@huawei.com>
@ 2015-05-21 9:28 ` s00318865
2015-05-29 1:25 ` Cui Bixuan
0 siblings, 1 reply; 15+ messages in thread
From: s00318865 @ 2015-05-21 9:28 UTC (permalink / raw)
To: Cui Bixuan; +Cc: ltp-list, peifeiyue
[-- Attachment #1.1: Type: text/plain, Size: 1813 bytes --]
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 \
[-- Attachment #1.2: Type: text/html, Size: 3239 bytes --]
[-- Attachment #2: Type: text/plain, Size: 409 bytes --]
------------------------------------------------------------------------------
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
[-- Attachment #3: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed
2015-05-21 9:28 ` s00318865
@ 2015-05-29 1:25 ` Cui Bixuan
2015-05-30 7:01 ` Yuan Sun
0 siblings, 1 reply; 15+ messages in thread
From: Cui Bixuan @ 2015-05-29 1:25 UTC (permalink / raw)
To: s00318865; +Cc: ltp-list, peifeiyue
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed
2015-05-29 1:25 ` Cui Bixuan
@ 2015-05-30 7:01 ` Yuan Sun
2015-06-01 2:46 ` Li Wang
0 siblings, 1 reply; 15+ messages in thread
From: Yuan Sun @ 2015-05-30 7:01 UTC (permalink / raw)
To: Cui Bixuan; +Cc: ltp-list, peifeiyue
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed
2015-05-30 7:01 ` Yuan Sun
@ 2015-06-01 2:46 ` Li Wang
2015-06-01 3:44 ` Yuan Sun
0 siblings, 1 reply; 15+ messages in thread
From: Li Wang @ 2015-06-01 2:46 UTC (permalink / raw)
To: Yuan Sun; +Cc: ltp-list, peifeiyue
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed
2015-06-01 2:46 ` Li Wang
@ 2015-06-01 3:44 ` Yuan Sun
0 siblings, 0 replies; 15+ messages in thread
From: Yuan Sun @ 2015-06-01 3:44 UTC (permalink / raw)
To: Li Wang; +Cc: ltp-list, peifeiyue
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed
2015-05-05 12:12 [LTP] [PATCH] commands/logrotate:run the case once again will failed Cui Bixuan
[not found] ` <555D8E94.20605@huawei.com>
@ 2015-07-01 12:47 ` Cui Bixuan
2015-07-01 14:10 ` Alexey Kodanev
1 sibling, 1 reply; 15+ messages in thread
From: Cui Bixuan @ 2015-07-01 12:47 UTC (permalink / raw)
To: Cui Bixuan; +Cc: ltp-list, zhanyongming, zhuyanpeng
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 <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
>
> 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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed
2015-07-01 12:47 ` Cui Bixuan
@ 2015-07-01 14:10 ` Alexey Kodanev
2015-07-02 12:06 ` Cui Bixuan
0 siblings, 1 reply; 15+ messages in thread
From: Alexey Kodanev @ 2015-07-01 14:10 UTC (permalink / raw)
To: Cui Bixuan; +Cc: zhuyanpeng, ltp-list, zhanyongming
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<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
>>
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed
2015-07-01 14:10 ` Alexey Kodanev
@ 2015-07-02 12:06 ` Cui Bixuan
2015-07-02 14:22 ` Alexey Kodanev
0 siblings, 1 reply; 15+ messages in thread
From: Cui Bixuan @ 2015-07-02 12:06 UTC (permalink / raw)
To: Alexey Kodanev; +Cc: zhuyanpeng, ltp-list, zhanyongming
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<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
>>>
>
> 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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed
2015-07-02 12:06 ` Cui Bixuan
@ 2015-07-02 14:22 ` Alexey Kodanev
2015-07-04 3:03 ` Cui Bixuan
0 siblings, 1 reply; 15+ messages in thread
From: Alexey Kodanev @ 2015-07-02 14:22 UTC (permalink / raw)
To: Cui Bixuan; +Cc: zhuyanpeng, ltp-list, zhanyongming
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed
2015-07-02 14:22 ` Alexey Kodanev
@ 2015-07-04 3:03 ` Cui Bixuan
2015-07-06 14:31 ` Alexey Kodanev
0 siblings, 1 reply; 15+ messages in thread
From: Cui Bixuan @ 2015-07-04 3:03 UTC (permalink / raw)
To: Alexey Kodanev; +Cc: zhuyanpeng, ltp-list, zhanyongming
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH] commands/logrotate:run the case once again will failed
2015-07-04 3:03 ` Cui Bixuan
@ 2015-07-06 14:31 ` Alexey Kodanev
2015-07-07 9:13 ` [LTP] [PATCH v2] " Cui Bixuan
0 siblings, 1 reply; 15+ messages in thread
From: Alexey Kodanev @ 2015-07-06 14:31 UTC (permalink / raw)
To: Cui Bixuan; +Cc: zhuyanpeng, ltp-list, zhanyongming
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* [LTP] [PATCH v2] commands/logrotate:run the case once again will failed
2015-07-06 14:31 ` Alexey Kodanev
@ 2015-07-07 9:13 ` Cui Bixuan
2015-07-09 5:59 ` Alexey Kodanev
0 siblings, 1 reply; 15+ messages in thread
From: Cui Bixuan @ 2015-07-07 9:13 UTC (permalink / raw)
To: Alexey Kodanev; +Cc: zhuyanpeng, ltp-list, zhanyongming
Including the rules in /etc/logrotate.d/ will cause the case failed
when run it at the second time.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Signed-off-by: Cui Bixuan <cuibixuan@huawei.com>
---
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
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH v2] commands/logrotate:run the case once again will failed
2015-07-07 9:13 ` [LTP] [PATCH v2] " Cui Bixuan
@ 2015-07-09 5:59 ` Alexey Kodanev
2015-07-13 8:59 ` Cui Bixuan
0 siblings, 1 reply; 15+ messages in thread
From: Alexey Kodanev @ 2015-07-09 5:59 UTC (permalink / raw)
To: Cui Bixuan; +Cc: zhuyanpeng, ltp-list, zhanyongming
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH v2] commands/logrotate:run the case once again will failed
2015-07-09 5:59 ` Alexey Kodanev
@ 2015-07-13 8:59 ` Cui Bixuan
0 siblings, 0 replies; 15+ messages in thread
From: Cui Bixuan @ 2015-07-13 8:59 UTC (permalink / raw)
To: Alexey Kodanev; +Cc: zhuyanpeng, ltp-list, zhanyongming
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
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2015-07-13 9:08 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-05 12:12 [LTP] [PATCH] commands/logrotate:run the case once again will failed Cui Bixuan
[not found] ` <555D8E94.20605@huawei.com>
2015-05-21 9:28 ` s00318865
2015-05-29 1:25 ` Cui Bixuan
2015-05-30 7:01 ` Yuan Sun
2015-06-01 2:46 ` Li Wang
2015-06-01 3:44 ` Yuan Sun
2015-07-01 12:47 ` Cui Bixuan
2015-07-01 14:10 ` Alexey Kodanev
2015-07-02 12:06 ` Cui Bixuan
2015-07-02 14:22 ` Alexey Kodanev
2015-07-04 3:03 ` Cui Bixuan
2015-07-06 14:31 ` Alexey Kodanev
2015-07-07 9:13 ` [LTP] [PATCH v2] " Cui Bixuan
2015-07-09 5:59 ` Alexey Kodanev
2015-07-13 8:59 ` Cui Bixuan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox