Bug 10489

Summary: "test_1_logrotate_setup" fails on second run of test image due existing files
Product: [QA/Testing] Runtime Testing Reporter: Jose Perez C <jose.perez.carranza>
Component: generalAssignee: Jose Perez C <jose.perez.carranza>
Status: RESOLVED FIXED QA Contact: Juan Ramos <juan.fernandox.ramos.frayle>
Severity: enhancement    
Priority: Medium    
Version: 2.2   
Target Milestone: 2.3 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Jose Perez C 2016-10-24 16:16:30 UTC
A cleanup is needed on logrotate, on second execution is failing:

1.- Add below info to conf/local.conf

INHERIT += "testimage"
TEST_TARGET = "simpleremote"
TEST_SERVER_IP = "HOST ip" --> IP of the machine being used to launch tests
TEST_TARGET_IP = "DUT ip"  --> IP of the device under test
TEST_SUITES = "logrotate"

2.- run `bitbake core-image-sato-sdk -c testimage`
3.- run again `bitbake core-image-sato-sdk -c testimage`

Expected Results:
   All test cases should be PASS

Actual Result:

======================================================================
FAIL: test_1_logrotate_setup (oeqa.runtime.logrotate.LogrotateTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pokylsbx86-x64/meta/lib/oeqa/utils/decorators.py", line 97, in wrapped_f
    return f(*args, **kwargs)
  File "/home/pokylsbx86-x64/meta/lib/oeqa/runtime/logrotate.py", line 18, in test_1_logrotate_setup
    self.assertEqual(status, 0, msg = "Could not create logrotate_dir. Output: %s" % output)
AssertionError: 1 != 0 : Could not create logrotate_dir. Output: mkdir: cannot create directory '/home/root/logrotate_dir': File exists

----------------------------------------------------------------------

===================== STEPS ===================================
Comment 1 Jose Perez C 2017-01-06 20:38:02 UTC
Patch sent to the list 

http://lists.openembedded.org/pipermail/openembedded-core/2017-January/130845.html
Comment 2 Jose Perez C 2017-01-17 13:59:16 UTC
this was already merged on master 

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=970b76a728509854ee5048f4e2ee8cdab827f25f