Some Linux devices may run on minimal root file systems
(e.g. buildroot) where /usr/local/bin path doesn't exist. Create
the binaries_directory if it doesn't exist instead of letting WA
quit and return errors such as:
INFO Runner: Skipping the rest of the iterations for this spec.
ERROR Runner: Error while running memcpy
ERROR Runner: CalledProcessError("Command 'sshpass
-p '<password>' /usr/bin/scp -r
/usr/local/lib/python2.7/dist-packages/
wlauto-2.3.0-py2.7.egg/wlauto/workloads/memcpy
/memcpy root@192.168.x.x:/usr/local/bin/memcpy'
returned non-zero exit status 1")
ERROR Runner: Got:
ERROR Runner:
ERROR Runner: scp: /usr/local/bin/memcpy:
No such file or directory
Signed-off-by: Lisa Nguyen <lisa.nguyen@linaro.org>
On generic_linux devices, one might ssh as the root user, in which
case there is no need to use sudo.
In addition, some root filesystems may not have sudo (e.g. minimal
buildroot/busybox).
This patch attempts to detect the root user using 'id -u' and, if it
detects the root user, avoids the use of sudo for running commands as
well.
Cc: Lisa Nguyen <lisa.nguyen@linaro.org>
Signed-off-by: Kevin Hilman <khilman@linaro.org>
(setrofim: modified to only test once)