Bug 12444

Summary: [Test Case 1542] test_2_logrotate fails in MinnowMax with core-image-lsb-sdk-genericx86-64 image
Product: [Build System, Metadata & Runtime] BSPs Reporter: yeoh ee peng <ee.peng.yeoh>
Component: bsps-configurationAssignee: yeoh ee peng <ee.peng.yeoh>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: Medium+ CC: richard.purdie, yp.bsp.watcher, yp.watcher
Version: 2.4.1   
Target Milestone: 2.5 M2   
Hardware: MinnowBoard Max   
OS: x86_64   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
/etc/logrotate.conf from device none

Description yeoh ee peng 2017-12-21 07:57:05 UTC
Step to reproduce error:
1) Boot up MinnowMax with core-image-lsb-sdk-genericx86-64 image
2) Configure local.conf following steps in BSP Test Plan
https://wiki.yoctoproject.org/wiki/BSP_Test_Plan
3) Run bitbake core-image-lsb-sdk -c testimage

RESULTS - logrotate.LogrotateTest.test_1_logrotate_setup - Testcase 1544: PASSED
RESULTS - logrotate.LogrotateTest.test_2_logrotate - Testcase 1542: FAILED

NOTE:   test_1_logrotate_setup (logrotate.LogrotateTest)
DEBUG: Checking if at least one of logrotate is installed
DEBUG: [Running]$ ssh -l root -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR 172.30.199.124 export PATH=/usr/sbin:/sbin:/usr/bin:/bin; mkdir $HOME/logrotate_dir
DEBUG: time: 1513754065.3160224, endtime: 1513754365.3126523
DEBUG: [Command returned '0' after 0.18 seconds]
DEBUG: Command: mkdir $HOME/logrotate_dir
Output:  

DEBUG: [Running]$ ssh -l root -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR 172.30.199.124 export PATH=/usr/sbin:/sbin:/usr/bin:/bin; sed -i "s#wtmp {#wtmp {\n    olddir $HOME/logrotate_dir#" /etc/logrotate.conf
DEBUG: time: 1513754065.5603456, endtime: 1513754365.5569317
DEBUG: [Command returned '0' after 0.18 seconds]
DEBUG: Command: sed -i "s#wtmp {#wtmp {\n    olddir $HOME/logrotate_dir#" /etc/logrotate.conf
Output:  

NOTE:  ... OK (0.426s)
NOTE:   test_2_logrotate (logrotate.LogrotateTest)
DEBUG: [Running]$ ssh -l root -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR 172.30.199.124 export PATH=/usr/sbin:/sbin:/usr/bin:/bin; logrotate -f /etc/logrotate.conf
DEBUG: time: 1513754065.7415323, endtime: 1513754365.7380984
DEBUG: Partial data from SSH call: error: destination /var/log/dnf.log-20171220 already exists, skipping rotation
error: destination /var/log/dnf.librepo.log-20171220 already exists, skipping rotation
error: destination /var/log/dnf.rpm.log-20171220 already exists, skipping rotation
error: destination /var/log/hawkey.log-20171220 already exists, skipping rotation

DEBUG: time: 1513754065.9317398, endtime: 1513754365.931738
DEBUG: [Command returned '1' after 0.19 seconds]
DEBUG: Command: logrotate -f /etc/logrotate.conf
Output:  error: destination /var/log/dnf.log-20171220 already exists, skipping rotation
error: destination /var/log/dnf.librepo.log-20171220 already exists, skipping rotation
error: destination /var/log/dnf.rpm.log-20171220 already exists, skipping rotation
error: destination /var/log/hawkey.log-20171220 already exists, skipping rotation

NOTE:  ... FAIL (0.197s)
DEBUG: [Running]$ ssh -l root -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR 172.30.199.124 export PATH=/usr/sbin:/sbin:/usr/bin:/bin; rm -rf $HOME/logrotate_dir
DEBUG: time: 1513754065.9389927, endtime: 1513754365.9349895
DEBUG: [Command returned '0' after 0.18 seconds]
DEBUG: Command: rm -rf $HOME/logrotate_dir
Output:
Comment 1 Joshua Lock 2017-12-21 16:47:30 UTC
It looks like the sed command failed/is incorrectly formatted as the errors indicate logrotate is trying to rotate logs in /var/log/ but the sed command should have set the log directory to $HOME/logrotate_dir

Could you attach a copy of the /etc/logrotate.conf from the DUT?
Comment 2 yeoh ee peng 2018-01-23 09:21:50 UTC
Created attachment 4183 [details]
/etc/logrotate.conf from device
Comment 3 yeoh ee peng 2018-01-23 09:24:07 UTC
Hi Joshua,

While I tried to retrieve the /etc/logrotate.conf from device.
I rerun the testimage again but it was passing this time, let me close this ticket for now while I will try if I can reproduce this issue.