Wind River Support Network

HomeDefectsLIN6-10059
Fixed

LIN6-10059 : LTP testcase wrongly assume sudo availability

Created: Jun 25, 2015    Updated: Dec 3, 2018
Resolved Date: Jul 13, 2015
Found In Version: 6.0.0.16
Fix Version: 6.0.0.23
Severity: Standard
Applicable for: Wind River Linux 6
Component/s: Userspace

Description

LTP testcase utimensat01 failes when rootfs is missing sudo functionality.

The testcase have lines like:

...
    if test -e $FILE; then
        sudo $s_arg chattr -ai $FILE || return $?
        sudo $s_arg rm -f $FILE || return $?
    fi
...
    sudo $s_arg -u $test_user touch $FILE || return $?
...

and so on... it is using sudo unconditionally.

Best would be to first check if we already run as root (which we do in this case) and then just carry on.

If not root, check if sudo is possible (sudo ls /tmp?) and then carry on using sudo when needed. If sudo not available/don't work, then it should fail.

Workaround

Add sudo to rootfs.

Steps to Reproduce

Build a wrl6 platform, make sure ltp is added and that rootfs don't have sudo.
Try to run LTP successfully.

Other Downloads


Live chat
Online