Bug 13871 - testimage assumes tools are installed on target for testimage_dump_target() function
Summary: testimage assumes tools are installed on target for testimage_dump_target() f...
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: Scripts and Tools (show other bugs)
Version: 3.1
Hardware: x86 Multiple
: Medium normal
Target Milestone: 5.99
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2020-04-15 12:24 UTC by Tim Orling
Modified: 2026-04-30 15:20 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Orling 2020-04-15 12:24:42 UTC
Additional task from original Bug #13681.

The testimage.bbclass assumes multiple tools will be installed on target for the testimage_dump_target() function [1]. These are NOT common tools for targets.

testimage_dump_target () {
    top -bn1
    ps
    free
    df
    # The next command will export the default gateway IP
    export DEFAULT_GATEWAY=$(ip route | awk '/default/ { print $3}')
    ping -c3 $DEFAULT_GATEWAY
    dmesg
    netstat -an
    ip address
    # Next command will dump logs from /var/log/
    find /var/log/ -type f 2>/dev/null -exec echo "====================" \; -exec echo {} \; -exec echo "====================" \; -exec cat {} \; -exec echo "" \;
}

First of all, these should be in a packagegroup for easy inclusion. Said packagegroup should be mentioned in a comment in the class. The class should check for whether those tools are installed and report a useful error to the user, rather than just a slew of file or path not found type errors.

[1] http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/classes/testimage.bbclass#n99
Comment 1 Randy MacLeod 2020-04-16 08:00:24 UTC
On taget, check if executable exists before calling it. For host, just skip entirely.
Comment 2 Trevor Gamblin 2020-04-28 07:22:41 UTC
Working on this. Is there an easy way with bitbake to check if these packages are installed already? Otherwise I'll do "command -v foo || echo "..."" sorts of additions to testimage_dump_target.
Comment 3 Randy MacLeod 2023-10-30 15:37:31 UTC
Build move to 5.0 -- ../Randy
Comment 4 Randy MacLeod 2024-04-25 01:13:58 UTC
Bulk move of 5.0 medium importance issues to 5.99.
Move to 5.1 if you want to actively work on an issue.
Comment 5 Randy MacLeod 2024-04-25 01:23:11 UTC
Move to 5.99 since no one is actively working on this issue.
Move to 5.x if you start on a task, please.