Bug 8118

Summary: Add support for retrieve target system status when test fails
Product: [QA/Testing] Runtime Testing Reporter: Aníbal Limón <anibal.limon>
Component: generalAssignee: Mariano Lopez <mariano.lopez>
Status: VERIFIED FIXED QA Contact: Daniel Istrate <daniel.alexandrux.istrate>
Severity: enhancement    
Priority: Medium+ CC: bogdanx.a.voiculescu, daniel.alexandrux.istrate, mariano.lopez
Version: 1.9   
Target Milestone: 1.9 M3   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Bug Depends on:    
Bug Blocks: 8176    

Description Aníbal Limón 2015-08-06 18:18:25 UTC
When a runtime test fails will be good to have information about the status of the system.

- Processes running.
- Memory information.
- dmesg.
- Network information, netstat.
- X log.

One way to do that is to send commands over serial port to the qemu target running.
Comment 1 Mariano Lopez 2015-08-11 21:42:57 UTC
Currently the console for the QemuRunner class is only used to check if the target booted, there is need to implement a method to allow communication on the target using the console.
Comment 2 Mariano Lopez 2015-08-13 15:19:56 UTC
Sent some patches for review, currently the commands and dump dir location are harcoded in oeRuntimeTest, however this is not the best approach. I will send another series of patches to have the ability to customize these on the testimage class
Comment 3 Mariano Lopez 2015-08-17 21:35:42 UTC
Sent a patch that fixed some issues in the last batch of patches
Comment 4 Daniel Istrate 2015-08-24 14:36:58 UTC
Hi,

These patches break functionality for running testimage on real hardware (#8203)

Thanks,
--Daniel
Comment 5 Mariano Lopez 2015-08-25 16:09:18 UTC
Sent patches that also fix the regression issue with real hardware.

http://lists.openembedded.org/pipermail/openembedded-core/2015-August/109376.html
Comment 6 Mariano Lopez 2015-08-31 14:25:03 UTC
Patches to fix the regression to test on real hardware were accepted on now are in master in commit:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=277571bbd0a7864e996fad5acd3a10d31c84fdbd
Comment 7 Mariano Lopez 2015-08-31 14:27:36 UTC
Sent patch to make compatible run exported test with HostDumper.

http://lists.openembedded.org/pipermail/openembedded-core/2015-August/109714.html
Comment 8 Mariano Lopez 2015-09-07 13:47:34 UTC
These are the changes that were introduced when solved this bug:

There are new classes in oeqa/utils named HostDumper and TargetDumper. These would run commands on the host or target and save the output.

It was added the capability to run commands in the qemu target using the serial console.

When qemu ends unexpectedly it will get the dumps from the host running qemu.

There are 3 new bitbake vars that would define where and what commands to dump, these vars are:
    - TESTIMAGE_DUMP_DIR
    - testimage_dump_target
    - testimage_dump_host

It was solved the break with the real hardware.
Comment 10 Daniel Istrate 2015-10-05 13:21:02 UTC
Verified on master: eac61f37e36099f74485dab398b57f3812826d17

Steps to verify:
1. Add to local.conf:
TESTIMAGE_DUMP_DIR = "test_folder"
testimage_dump_host = "10.237.112.240"
testimage_dump_target = "192.168.7.2"

INHERIT += "testimage"
TEST_SUITES = "auto"

2. bitbake core-image-sato-sdk -c testimage

3. When tests fail "test_folder" will hold information about
 host & target such as ps, df, dmesg,netstat, top etc