Wind River Support Network

HomeDefectsLIN7-4281
Fixed

LIN7-4281 : CLONE - LTP testcase wrongly assume sudo availability

Created: Jul 13, 2015    Updated: Sep 8, 2018
Resolved Date: Jul 13, 2015
Previous ID: LIN6-10127
Found In Version: 7.0.0.5
Fix Version: 7.0.0.8
Severity: Standard
Applicable for: Wind River Linux 7
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