1
0
mirror of https://github.com/ARM-software/devlib.git synced 2024-10-05 18:30:50 +01:00
Commit Graph

90 Commits

Author SHA1 Message Date
Douglas Raillard
38d4796e41 utils/ssh: Allow passing known_hosts path via strict_host_check value
Allow passing a known_hosts file path to strict_host_check.
2024-07-11 18:54:15 -05:00
Metin Kaya
b7d7b46626 tools/setup_host.sh: Rename install_base.sh to setup_host.sh
install_base.sh is left-over from LISA/install_base.sh. Scope of the
script in question is different (and potentially can diverge more) than
its root in LISA. Hence, give it a more descriptive (hopefully) name.

Signed-off-by: Metin Kaya <metin.kaya@arm.com>
2024-06-26 15:27:07 -05:00
Metin Kaya
b5f311feff tools/docker: Add Docker image support for devlib
Introduce a Dockerfile in order to create Docker image for devlib and
``run_tests.sh`` script to test Android, Linux, LocalLinux, and QEMU
targets on the Docker image.

The Dockerfile forks from ``Ubuntu-22.04``, installs required system
packages, checks out ``master`` branch of devlib, installs devlib,
creates Android virtual devices via ``tools/android/install_base.sh``,
and QEMU images for aarch64 and x86_84 architectures.

Note that Android command line tools version, buildroot and devlib
branches can be customized via environment variables.

Signed-off-by: Metin Kaya <metin.kaya@arm.com>
2024-04-01 14:02:38 -05:00
Metin Kaya
1431bebd80 tools/buildroot: Add support for generating Linux target system images
Integrate buildroot into devlib in order to ease building kernel and
root filesystem images via 'generate-kernel-initrd.sh' helper script.

As its name suggests, the script builds kernel image which also includes
an initial RAM disk per default config files located under
configs/<arch>/.

Provide config files for buildroot and Linux kernel as well as a
post-build.sh script which tweaks (e.g., allowing root login on SSH)
target's root filesystem.

doc/tools.rst talks about details of kernel and rootfs configuration.

Signed-off-by: Metin Kaya <metin.kaya@arm.com>
2024-03-20 12:16:12 +00:00
Metin Kaya
598c0c1d3c tools/android: Add support for creating Android virtual devices
Introduce ``tools/android/install_base.sh`` [1] script to install
Android command line tools including necessary platforms and
system-images for Linux and create Android Virtual Devices (AVD) for
Pixel 6 with Android v12 & v14 as well as an Android virtual *desktop*
device (v13) for ChromeOS tests.

[1] Forked from https://github.com/ARM-software/lisa/blob/main/install_base.sh

Signed-off-by: Metin Kaya <metin.kaya@arm.com>
2024-03-20 11:56:49 +00:00
Metin Kaya
e334f8816c target: Customize as_root parameter of *write_value()
Not all command executions (or write operations in this specific case)
requires being root. So, allow write_value() and dependent
revertable_write_value() to support non-root executions by introducing
'as_root' optional parameter whose default is True to preserve current
behavior of the aforementioned methods.

Meanwhile, update the copyright year of the touched file, too.

Signed-off-by: Metin Kaya <metin.kaya@arm.com>
2024-01-23 06:51:59 -08:00
Metin Kaya
cb36347dfe doc/connection: Fix typo Telenet
It should be *telnet* instead.

Signed-off-by: Metin Kaya <metin.kaya@arm.com>
2024-01-23 06:51:59 -08:00
Metin Kaya
14b4e2069b target: Add helper function to check Android screen's locking state
Introduce is_screen_locked() which returns true if device screen is
locked and false otherwise.

This will be useful to automate unlocking the screen [1].

Also fix a typo in is_screen_on()'s documentation.

[1] https://github.com/ARM-software/workload-automation/pull/1246

Signed-off-by: Metin Kaya <metin.kaya@arm.com>
2024-01-09 07:39:56 -08:00
Douglas Raillard
18ab9f80b0 target: Expose Target(max_async=50) parameter
Allow the user to set a maximum number of conrruent connections used to
dispatch non-blocking commands when using the async API.
2022-07-28 14:40:15 +01:00
Marc Bonnici
77f0b1f06d docs: Add readthedocs config and requirements.txt
The default versions used for sphinx and docuilts on
readthedocs are no longer compatible. Explicitly list
the package versions that should be used when building
the documentation.
2021-10-28 11:03:08 +01:00
Douglas Raillard
b719808ef2 target: Add Target.pull(via_temp=False) parameter
Allow pulling a file via a temporary location on the target, to
side-step performance issues when pulling big files from sysfs.
2021-10-08 13:14:42 +01:00
Marc Bonnici
5cf18a7b3c docs: Add note to hostid about PowerPc64 devices
Add caveat for the hostid on PowerPC64 devices due to the library
used when linking the included binary.
2021-04-19 10:46:46 +01:00
Marc Bonnici
ca84124fae doc/target: Fix Typo 2021-04-07 18:21:33 +01:00
Marc Bonnici
1f41853341 docs/target: Add new Target attributes 2021-04-07 18:21:33 +01:00
Marc Bonnici
09d0a0f500 docs: Fix Formatting / typos 2021-03-31 11:02:49 +01:00
douglas-raillard-arm
d953377ff3 doc: Extend doc of Target.background()
Add doc for parameters "force_locale" and "timeout".
2021-03-24 19:05:50 +00:00
Jonathan Paynter
1fc9f6cc94 doc/target: Add polling to target push method
Update the documentation for ``target`` to mention transfer polling,
and redirect to more information in ``connection``.
2020-11-03 10:01:43 +00:00
Jonathan Paynter
ef2d1a6fa4 doc/connection: Add transfer poll parameter info
Also update SSHConnection parameters to reflect the current state.
2020-11-03 10:01:43 +00:00
Jonathan Paynter
b2950686a7 devlib/target: Enable screen stay-on mode:
Adds the ability to set the android global setting
``stay_on_while_plugged_in``.

This setting has 4 main modes:
- 0: never stay on
- 1: stay on when plugged in to AC charger
- 2: stay on when plugged in to USB charger
- 4: stay on when wirelessly charged

These values can be OR-ed together to produce combinations.
2020-09-02 18:06:07 +01:00
douglas-raillard-arm
24e6de67ae target: Add Target.{push,pull}(globbing=False) parameter
When globbing=True, the source is interpreted as a globbing pattern on
the target and is expanded before pulling the files or folders.

This also aligns the behaviour of all targets:
    * adb connection was supported a limited form of globbing by default
      (only on the last component of the path)
    * SCP was supporting a limited form of globbing
    * GEM5 was not supporting globbing at all
    * paramiko was not supporting globbing at all

Also fix a race condition on push/pull as root, where pushing/pulling
the same file from multiple threads would have ended up using the same
temporary file.
2020-07-20 15:49:14 +01:00
douglas-raillard-arm
07bbf902ba docs/target: Update Target.{push,pull}() description
Document the fact that it accepts folders as source and destination in
addition to files.
2020-07-20 15:49:14 +01:00
douglas-raillard-arm
590069f01f target: Add Target.makedirs()
Create a directory on the target.
2020-07-20 15:49:14 +01:00
Marc Bonnici
bae741dc81 docs/overview: Fix python2 style print 2020-06-08 17:37:06 +01:00
Marc Bonnici
ccde9de257 devlib/AndroidTarget: Update screen state methods to handle doze
Newer devices can have a "DOZE" or always on screen state.
Enable the screen state to handle these cases and report these
states as `ON`.
2020-06-05 17:12:35 +01:00
Marc Bonnici
ea9f9c878b docs/ssh: Add note about connecting to passwordless machines. 2020-05-13 16:42:58 +01:00
Marc Bonnici
3c85738f0d docs/target: Fix method name 2020-05-12 10:25:08 +01:00
Marc Bonnici
45881b9f0d utils/android: Expose connection_attempts argument to AdbConnection
Allow for configuring the number of connection attempts that will be
made to the device before failing to connect. This allows for waiting longer
periods of time for the device to come online.
2020-05-12 10:24:47 +01:00
Marc Bonnici
b6cab6467d docs: Add LinuxTarget and LocalLinuxTarget to the documentation 2020-03-20 15:35:16 +00:00
Marc Bonnici
ec0a5884c0 docs: Update to use module diretive
Update the documentation to indicated which module each class is
located. This allows the documentation to be referenced from other
modules as well as enabling links to the source code directly from the
documentation.
2020-03-20 15:35:16 +00:00
Marc Bonnici
b72fb470e7 docs: Update to include Collector information 2019-12-20 15:16:32 +00:00
Marc Bonnici
baa7ad1650 devlib/AndroidTarget: Move adb specific commands into the ADB connection
The `AndroidTarget` class should not depend on ADB specific commands as
is is possible to use this target with other connection types e.g. ssh.
Therefore move the adb specific commands into the `AdbConnection`.

- `wait_for_device` and `reboot_bootloader` are now exposed in AndroidTarget
as generic methods and call through to the connection method.
- `adb_kill_server` is now a standalone function of the AdbConnection.
2019-12-20 15:15:45 +00:00
Marc Bonnici
745dc9499a modules/flash: Add a connect parameter to the flash method
Adds a `connect` parameter to the flash method to specifiy whether
devlib should attempt to connect to the target after flashing has
completed.
2019-11-28 17:11:24 +00:00
Michalis Spyrou
0fa91d6c4c Add options to ssh connection
The user can pass a dictionary containg the key and value
pairs with the extra ssh configuration options. Multiple
options will be passed as '-o key1=value1 -o key2=value2'

Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com>
2019-11-21 14:19:34 +00:00
Marc Bonnici
d4f3316120 doc/target: Update documentation for install_module 2019-10-22 17:58:34 +01:00
Marc Bonnici
c5d06ee3d6 doc/target: Correct terminology 2019-10-22 17:58:34 +01:00
Marc Bonnici
6b72b50c40 docs/instrumenation: Document teardown behaviour for instrument API 2019-10-03 11:36:11 +01:00
Marc Bonnici
c73266c3a9 docs/instrumentation: Fix typos 2019-10-03 11:36:11 +01:00
Marc Bonnici
66de30799b doc/connection: Update connection documentation 2019-09-11 10:46:00 +01:00
Douglas RAILLARD
9c86174ff5 target: Add Target.execute(force_locale='C') parameter
To avoid locale-specific variations in the output of commands, set LC_ALL=C by
default. This can be disabled by using None, or set to another locale.
2019-09-04 16:09:06 +01:00
Douglas RAILLARD
988de69b61 target: Add Target.revertable_write_value()
Same as write_value(), but returns a context manager that will write
back the old value on exit.

Also add batch_revertable_write_value() that takes a list of kwargs
dict, and will call revertable_write_value() on each of them, returning
a single combined context manager.
2019-07-30 18:05:21 +01:00
Quentin Perret
e01a76ef1b doc: Explain the 'tar' flag of target.read_tree_values
Signed-off-by: Quentin Perret <quentin.perret@arm.com>
2019-02-01 11:21:09 +00:00
Douglas RAILLARD
22a5945460 ftrace: Turn TraceCollector into a context manager
This allows using an TraceCollector instance as a context manager, so
tracing will stop even if the devlib application is interrupted, or if
an exception is raised.
2018-12-03 15:20:48 +00:00
Marc Bonnici
4a4739cefb doc: Fix formatting 2018-10-31 10:17:21 +00:00
Marc Bonnici
01c39cfe4c doc/conns: Update documentation to include strip_colors parameter 2018-10-31 10:17:21 +00:00
Marc Bonnici
fa41bb01d2 modules: Update docs with 'setup' stage for module initialization
Update documentation to include the 'setup' stage for module
initialization.
2018-10-10 10:31:45 +01:00
Pierre-Clement Tosi
63d2fb53fc Instrument/BaylibreAcme: Add IIO-based ACME instr.
Add BaylibreAcmeInstrument, a new instrument providing support for the
Baylibre ACME board as a wrapper for the IIO interface. This class
provides better access to the ACME hardware (e.g. the ability to control
the sampling frequency) and to the retrieved samples than what the other
instrument, AcmeCapeInstrument, provides. Furthermore, it removes an
unnecessary and limiting dependency by interfacing directly with the IIO
drivers instead of relying on an intermediate script ("iio-capture") potentially
introducing unexpected bugs. Finally, it allows handling multiple probes
(the ACME can have up to 8) through an easy-to-use single instance of this
class instead of having to have an instance of AcmeCapeInstrument per channel
potentially (untested) leading to race conditions between the underlying
scripts for accessing the hardware.

This commit does not overwrite AcmeCapeInstrument as
BaylibreAcmeInstrument does not provide interface compatibility with
that class. Anyhow, we believe that anything that can be achieved with
AcmeCapeInstrument can be done with BaylibreAcmeInstrument (the
reciprocal is not true) so that BaylibreAcmeInstrument might eventually
replace AcmeCapeInstrument.

Add BaylibreAcmeInstrument documentation detailing the class interface
and the ACME instrument itself and discussing the way it works and its
potential limitations.
2018-08-22 16:00:25 +01:00
Douglas RAILLARD
cc0582ef59 exceptions: Update doc for transient exceptions 2018-08-15 14:32:53 +01:00
Sergei Trofimov
e8a03e00f3 doc: mention ChromeOsTarget in overview
Mention ChromeOsTarget when listing available target types in the
overview.
2018-07-18 09:59:11 +01:00
Marc Bonnici
4b5f65699f doc/version: Update to release version 2018-07-13 16:05:49 +01:00
Sergei Trofimov
ae8db119a9 doc: document Target.model
Add missing documentation for Target.model
2018-07-13 13:18:39 +01:00