1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 19:01:15 +01:00
Commit Graph

43 Commits

Author SHA1 Message Date
Sebastian Goscik
5203188d9e LinuxDevice: Added as_root to kick_off 2016-02-12 09:54:14 +00:00
Sergei Trofimov
eaabe01fa5 BaseLinuxDevice: added insmod() method.
Allows insting a kernel module on the target from a .ko located on the
host.
2016-01-27 17:15:41 +00:00
Sergei Trofimov
dc07c8d87e BaseLinuxDevice: added lsmod() method
Execute lsmod on the target device and parses the output into named
tuples.
2016-01-27 16:50:29 +00:00
Sebastian Goscik
1e6eaff702 revent: Added record and replay commands
Added two commands to WA to record and replay input events using revent.

As part of this also added the ability to get a device model from
android and linux device. This may need to be improved in the future.
2016-01-22 10:40:03 +00:00
Sebastian Goscik
7c35c604f4 BaseLinuxDevice: Tidied up the way binaries are handled
Added:
get_binary_path: Checks binary_directory for the wanted binary, if
                 if its not there, it will use which to find a
                 system one. returns the full path

install_if_needed: will install a binary only if it is not present.

Changes:
 - Busybox is now deployed to non-rooted devices
 - is_installed has now been removed as the new functions supersede it
 - binaries will now always be installed to `binaries_directory` and
   not system folders.
 - updated workloads to use these new functions
   - rt-app and sysbench might still need work
2016-01-19 10:45:09 +00:00
Sebastian Goscik
bef8fb40ef Updated pylint for v1.5.1
Fixed WA for the latest version of pylint (1.5.1)
2015-12-09 16:52:39 +00:00
Sergei Trofimov
c02a1118d7 BaseLinuxDevice: list_file_systems() now handles blank lines
mount() may return an empty line at the end of the output; this update
handles that.
2015-11-24 15:50:38 +00:00
Sergei Trofimov
2e5b3671e9 LinuxDevice fix: do not invoke super's hard_reset()
as it does not have one...
2015-11-16 12:43:52 +00:00
Sergei Trofimov
552ea2a1bb fix: moving is_file and is_directory into BaseLinuxDevice, as relied on by get_properties. 2015-10-05 16:30:33 +01:00
Sergei Trofimov
b6442acf80 device: more reliable get_properites
Pulling entries from procfs does not work on some platforms. This commit
updates get_properites() to cat the contents of a property_file and
write it to output file on the host, rather than pulling it (directories
are still pulled).
2015-09-30 12:39:49 +01:00
Sergei Trofimov
5abb42eab9 Do not attempt to get_sysfile_value() as root on unrooted devices. 2015-09-18 09:33:17 +01:00
Sergei Trofimov
205934d55b juno: use bootargs on hard_reset with u-boot 2015-08-17 14:36:28 +01:00
Sergei Trofimov
b8e25efdd4 ssh: attempt to deal with dropped connections 2015-07-10 11:44:01 +01:00
Sergei Trofimov
4904c6cf71 listdir on Linux: return empty list for an empty directory
Previously, was returning a list with a single empty string element
2015-06-29 11:28:47 +01:00
Sergei Trofimov
e0ecc9aaf4 Added an invoke() method to devices.
This allows invoking an executable on the device under controlled
contions (e.g. within a particular directory, or taskset to specific
CPUs)
2015-06-18 15:07:44 +01:00
Vasilis Flouris
90c0ed281d Documentation: punctuation error fix 2015-06-18 10:46:29 +01:00
Vasilis Flouris
aac69a9c14 Documentation update 2015-06-18 10:39:20 +01:00
Sergei Trofimov
d9f45db71e Implementing dynamic device modules
Dynamic modules may be loaded automatically on device initialization if
the device supports them. Dynamic modules implent probe() method to
determine whether they are supported by a particular deviced.

devcpufreq and cpuidle have been converted into dynamic modules
2015-06-18 09:42:40 +01:00
Sergei Trofimov
73d85c2b4e cleaning up initialize()
- standardisded on a single context argument
- removed Device.init() no longer necessary as initilize now
  automatically gets propagated up the hierarchy. Renamed the existing
  use of it to "initilize".
- related pylint cleanup.
2015-06-18 09:30:38 +01:00
Sergei Trofimov
55b38556fe cpufreq: splitting out cpufreq stuff into a device module 2015-06-18 09:30:38 +01:00
Sergei Trofimov
4eb0d9d750 Reverting to the old way of getting the abi on Android
uname is not available on all Android devices, and we cannot rely on
busybox for establishing the ABI, as we need to get the ABI before we
can depoly the right version of busybox.
2015-06-16 15:15:18 +01:00
Sergei Trofimov
53de517488 device: set core_clusters from core_names if not explicitly specified
if core_names are specified in the device config but core_clusters are
not, assume that all cores with the same name are on the same cluster.
2015-06-16 12:21:44 +01:00
Sergei Trofimov
4d3feeba64 list_file_systems: fix for Android M and Linux devices
In previous versions of Android, "mount" returned output in the format
similar to fstab entries, which is what list_file_systems expected. This
fixes it to be able to handle the more traditional "mount" output in the
format

	<device> on <mount point> type <fs type> <options>

as well as continue to parse the Android output correctly.
2015-06-16 08:49:58 +01:00
Vasilis Flouris
2f214da8a2 fix: uname utility is unavailable in Android. It has to be invoked through busybox. 2015-06-11 18:58:34 +01:00
Sergei Trofimov
557b792c77 Made abi property common between Android and Linux devices
In both cases, the ABI is now obtained by executing "uname -m" on the
device and perfroming a mapping from the returned machine architecture
a known ABI. If no known ABI is found the architecture string itself is
returned.
2015-06-11 17:45:09 +01:00
Sergei Trofimov
ecb1a9f1f9 Adding /proc/cmdline to pulled metadata 2015-06-02 15:05:52 +01:00
Vasilis Flouris
1fa93c04d2 fixes a few minor bugs. 2015-06-02 10:53:20 +01:00
Sergei Trofimov
ebe6202e22 push/pull commands always raise DeviceError + handle error on pulling a property file.
Previosuly, they raised CalledProcessError/DeviceError based on
implementation. Making it consistent to facillitated handling in calling
code.
2015-06-01 17:25:59 +01:00
Sergei Trofimov
b4971d76d6 pull more stuff during run initialization
added more paths to pull by default when device.get_properties is
invoked during run initialization. Also moved the LinuxDevice
implementation into BaseLinuxDevice, so that AndroidDevice tires to pull
the same files (on top of the Android-specific stuff).
2015-06-01 16:41:33 +01:00
Sergei Trofimov
a254a44f0e adding abi property to LinuxDevice 2015-05-28 09:08:46 +01:00
Sergei Trofimov
9b16e3f282 linux device: removing (keyfile or password) validation check
It may be possible to connect to a device without either, so it
should not be invalid to not specifiy either in the device config.
2015-05-13 08:46:10 +01:00
Sergei Trofimov
40bd32280a minor fixes to cpufreq APIs
- adding missing cpu id conversion to set_cpu_min_freq
- adding "exact" parameter to set_cpu_frequency; only produce an error
  when the specified frequency is not supported by the cpu if "axact"
  is set; (otherwise let cpufreq decide what the actual frequency will
  be).
2015-05-11 12:12:41 +01:00
Vasilis Flouris
2929106049 Energy model: fixing sysbench taskset failure
Make sure when migrating sshd to root cgroup also migrate their
children, including the bash for the wa session. So the subsequent
processes kicked off from that shell can be taskset to any cluster.
2015-05-11 12:12:41 +01:00
Sergei Trofimov
950f0851bf Fix: implementing get_pid_of() and ps() for linux devices.
Existing implementation relied on android version of ps.
2015-05-11 12:12:41 +01:00
Sergei Trofimov
c82dd87830 Adding cpuidle modules and refactoring Device cpufreq APIs.
cpuidle module implements cpuidle state discovery, query and
manipulation for a Linux device. This replaces the more primitive
get_cpuidle_states method of LinuxDevice.

Renamed APIs (and added a couple of new ones) to be more consistent:

"core" APIs take a core name as the parameter (e.g. "a15") or whatever
is listed in core_names for that device.
"cluster" APIs take a numeric cluster ID (eg. 0) as the parameter. These
get mapped using core_clusters for that device.
"cpu" APIs take a cpufreq cpu ID as a parameter. These could be
integers, e.g. 0, or full string id, e.g. "cpu0".
2015-05-11 12:12:40 +01:00
Sergei Trofimov
bb6421b339 Fixing file_exists on linux devices. 2015-04-28 10:29:47 +01:00
Sergei Trofimov
c5d3c2bd62 Fixing reboot on Linux devices [part 2]
- connect() to device before issuing the initial reboot, as soft reset
  requires a device connection.
- boot() has been implemented to wait properly for the device to reboot
  after reset.
- port now defaults to 22 rather than being left unset, as need
  something to connect to when polling for device after reboot.
- Only use -P option for scp when port is *not* 22; as that option
  appears to cause intermittent issues with default scp on Ubuntu 12.04
2015-04-10 17:04:22 +01:00
Sergei Trofimov
fea32de3d3 Parameterizing password prompt for sudo in Ssh interface.
On some devices, sudo presents a different prompt when asking for a
password. All the prompt to be specified in device configruation to
handle such cases.
2015-04-10 09:03:48 +01:00
Sergei Trofimov
7b5f5e2ed0 Fixing Linux device reset.
_is_ready was being set to False before invoking execute("reboot")
causing a device not ready error.
2015-04-07 09:09:13 +01:00
Lisa Nguyen
a7895a17bf common/linux/device.py: Create binaries_directory path if it doesn't exist
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>
2015-04-01 08:05:11 +01:00
Sergei Trofimov
925c354551 Fix hotplugging all cores on a cluster.
When attempting to set number of cores on a cluster to 0, make
sure at least one core is enabled on the other cluster beforehand.
2015-03-27 12:54:26 +00:00
Kevin Hilman
bf12d18457 common/linux/device.py: don't require sudo if already root user
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)
2015-03-23 10:18:32 +00:00
Sergei Trofimov
a747ec7e4c Initial commit of open source Workload Automation. 2015-03-10 13:09:31 +00:00