wlauto.modules package

Submodules

wlauto.modules.active_cooling module

class wlauto.modules.active_cooling.MbedFanActiveCooling(owner, **kwargs)[source]

Bases: wlauto.core.extension.Module

aliases = AC([])
artifacts = AC([])
capabilities = ['active_cooling']
core_modules = []
description = 'Controls a cooling fan via an mbed connected to a serial port.'
finalize(*args, **kwargs)
initialize(*args, **kwargs)
kind = 'module'
name = 'mbed-fan'
parameters = AC(["Param({'kind': <type 'list'>, 'mandatory': None, 'name': 'modules', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'port', 'constraint': None, 'default': '/dev/ttyACM0', 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function integer>, 'mandatory': None, 'name': 'buad', 'constraint': None, 'default': 115200, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function integer>, 'mandatory': None, 'name': 'fan_pin', 'constraint': None, 'default': 0, 'allowed_values': None, 'global_alias': None, 'override': False})"])
start_active_cooling()[source]
stop_active_cooling()[source]
timeout = 30
validate(*args, **kwargs)
class wlauto.modules.active_cooling.OdroidXU3ctiveCooling(owner, **kwargs)[source]

Bases: wlauto.core.extension.Module

aliases = AC([])
artifacts = AC([])
capabilities = ['active_cooling']
core_modules = []
description = '\n Enabled active cooling by controling the fan an Odroid XU3\n\n .. note:: depending on the kernel used, it may not be possible to turn the fan\n off completely; in such situations, the fan will be set to its minimum\n speed.\n\n '
finalize(*args, **kwargs)
initialize(*args, **kwargs)
kind = 'module'
name = 'odroidxu3-fan'
parameters = AC(["Param({'kind': <type 'list'>, 'mandatory': None, 'name': 'modules', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})"])
start_active_cooling()[source]
stop_active_cooling()[source]
validate(*args, **kwargs)

wlauto.modules.cgroups module

class wlauto.modules.cgroups.CgroupController(mount_name)[source]

Bases: object

kind = 'cpuset'
mount(device, mount_root)[source]
class wlauto.modules.cgroups.Cgroups(owner, **kwargs)[source]

Bases: wlauto.core.extension.Module

aliases = AC([])
artifacts = AC([])
capabilities = ['cgroups']
controllers = [<wlauto.modules.cgroups.CpusetController object>]
core_modules = []
description = '\n Adds cgroups query and manupution APIs to a Device interface.\n\n Currently, only cpusets controller is supported.\n\n '
finalize(*args, **kwargs)
get_cgroup_controller(kind)[source]
initialize(*args, **kwargs)
kind = 'module'
name = 'cgroups'
parameters = AC(["Param({'kind': <type 'list'>, 'mandatory': None, 'name': 'modules', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'cgroup_root', 'constraint': None, 'default': '/sys/fs/cgroup', 'allowed_values': None, 'global_alias': None, 'override': False})"])
validate(*args, **kwargs)
class wlauto.modules.cgroups.CpusetController(*args, **kwargs)[source]

Bases: wlauto.modules.cgroups.CgroupController

create_group(name, cpus, mems)[source]
mount(device, mount_root)[source]
move_all_tasks_to(target_group)[source]
move_tasks(source, dest)[source]
class wlauto.modules.cgroups.CpusetGroup(controller, name, cpus, mems)[source]

Bases: object

add_task(tid)[source]
add_tasks(tasks)[source]
get()[source]
get_tasks()[source]
set(cpus, mems)[source]

wlauto.modules.cpufreq module

class wlauto.modules.cpufreq.CpufreqModule(owner, **kwargs)[source]

Bases: wlauto.core.extension.Module

aliases = AC([])
artifacts = AC([])
capabilities = ['cpufreq']
core_modules = []
description = '\n cpufreq-related functionality module for the device. Query and set frequencies, governors, etc.\n\n APIs in this module break down into three categories: those that operate on cpus, those that\n operate on cores, and those that operate on clusters.\n\n "cpu" APIs expect a cpufreq CPU id, which could be either an integer or or a string of the\n form "cpu0".\n\n "cluster" APIs expect a cluster ID. This is an integer as defined by the\n ``device.core_clusters`` list.\n\n "core" APIs expect a core name, as defined by ``device.core_names`` list.\n\n '
finalize(*args, **kwargs)
get_cluster_active_cpu(cluster)[source]

Returns the first active cpu for the cluster. If the entire cluster has been hotplugged, this will raise a ValueError.

get_cluster_cur_frequency(cluster)[source]
get_cluster_governor(cluster)[source]
get_cluster_governor_tunables(cluster)[source]
get_cluster_max_frequency(cluster)[source]
get_cluster_min_frequency(cluster)[source]
get_core_clusters(core, strict=True)[source]

Returns the list of clusters that contain the specified core. if strict is True, raises ValueError if no clusters has been found (returns empty list if strict is False).

get_core_cur_frequency(core)[source]
get_core_governor(core)[source]
get_core_governor_tunables(core)[source]
get_core_max_frequency(core)[source]
get_core_min_frequency(core)[source]
get_core_online_cpu(core)[source]
get_cpu_frequency(cpu)[source]

Returns the current frequency currently set for the specified CPU.

Warning, this method does not check if the cpu is online or not. It will try to read the current frequency and the following exception will be raised

:raises: DeviceError if for some reason the frequency could not be read.
get_cpu_governor(cpu)[source]

Returns the governor currently set for the specified CPU.

get_cpu_governor_tunables(cpu)[source]
get_cpu_max_frequency(cpu)[source]

Returns the max frequency currently set for the specified CPU.

Warning, this method does not check if the cpu is online or not. It will try to read the maximum frequency and the following exception will be raised

:raises: DeviceError if for some reason the frequency could not be read.
get_cpu_min_frequency(cpu)[source]

Returns the min frequency currently set for the specified CPU.

Warning, this method does not check if the cpu is online or not. It will try to read the minimum frequency and the following exception will be raised

:raises: DeviceError if for some reason the frequency could not be read.
initialize(*args, **kwargs)
kind = 'module'
list_available_cluster_governor_tunables(cluster)[source]
list_available_cluster_governors(cluster)[source]
list_available_core_frequencies(core)[source]
list_available_core_governor_tunables(core)[source]
list_available_core_governors(core)[source]
list_available_cpu_frequencies(cpu)[source]

Returns a list of frequencies supported by the cpu or an empty list if not could be found.

list_available_cpu_governor_tunables(cpu)[source]

Returns a list of tunables available for the governor on the specified CPU.

list_available_cpu_governors(cpu)[source]

Returns a list of governors supported by the cpu.

name = 'devcpufreq'
parameters = AC(["Param({'kind': <type 'list'>, 'mandatory': None, 'name': 'modules', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})"])
probe(device)[source]
set_cluster_cur_frequency(cluster, freq)[source]
set_cluster_governor(cluster, governor, **tunables)[source]
set_cluster_governor_tunables(cluster, governor, **tunables)[source]
set_cluster_max_frequency(cluster, freq)[source]
set_cluster_min_frequency(cluster, freq)[source]
set_core_cur_frequency(core, freq)[source]
set_core_governor(core, governor, **tunables)[source]
set_core_governor_tunables(core, tunables)[source]
set_core_max_frequency(core, freq)[source]
set_core_min_frequency(core, freq)[source]
set_cpu_frequency(cpu, frequency, exact=True)[source]

Set’s the minimum value for CPU frequency. Actual frequency will depend on the Governor used and may vary during execution. The value should be either an int or a string representing an integer.

If exact flag is set (the default), the Value must also be supported by the device. The available frequencies can be obtained by calling get_available_frequencies() or examining

/sys/devices/system/cpu/cpuX/cpufreq/scaling_available_frequencies

on the device (if it exists).

Raises:ConfigError if the frequency is not supported by the CPU.
Raises:DeviceError if, for some reason, frequency could not be set.
set_cpu_governor(cpu, governor, **kwargs)[source]

Set the governor for the specified CPU. See https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt

Parameters:
  • cpu – The CPU for which the governor is to be set. This must be the full name as it appears in sysfs, e.g. “cpu0”.
  • governor – The name of the governor to be used. This must be supported by the specific device.

Additional keyword arguments can be used to specify governor tunables for governors that support them.

Note:On big.LITTLE all cores in a cluster must be using the same governor. Setting the governor on any core in a cluster will also set it on all other cores in that cluster.
Raises:ConfigError if governor is not supported by the CPU.
Raises:DeviceError if, for some reason, the governor could not be set.
set_cpu_governor_tunables(cpu, governor, **kwargs)[source]

Set tunables for the specified governor. Tunables should be specified as keyword arguments. Which tunables and values are valid depends on the governor.

Parameters:
  • cpu – The cpu for which the governor will be set. This must be the full cpu name as it appears in sysfs, e.g. cpu0.
  • governor – The name of the governor. Must be all lower case.

The rest should be keyword parameters mapping tunable name onto the value to be set for it.

Raises:ConfigError if governor specified is not a valid governor name, or if a tunable specified is not valid for the governor.
Raises:DeviceError if could not set tunable.
set_cpu_max_frequency(cpu, frequency)[source]

Set’s the minimum value for CPU frequency. Actual frequency will depend on the Governor used and may vary during execution. The value should be either an int or a string representing an integer. The Value must also be supported by the device. The available frequencies can be obtained by calling get_available_frequencies() or examining

/sys/devices/system/cpu/cpuX/cpufreq/scaling_available_frequencies

on the device.

Raises:ConfigError if the frequency is not supported by the CPU.
Raises:DeviceError if, for some reason, frequency could not be set.
set_cpu_min_frequency(cpu, frequency)[source]

Set’s the minimum value for CPU frequency. Actual frequency will depend on the Governor used and may vary during execution. The value should be either an int or a string representing an integer. The Value must also be supported by the device. The available frequencies can be obtained by calling get_available_frequencies() or examining

/sys/devices/system/cpu/cpuX/cpufreq/scaling_available_frequencies

on the device.

Raises:ConfigError if the frequency is not supported by the CPU.
Raises:DeviceError if, for some reason, frequency could not be set.
validate(*args, **kwargs)

wlauto.modules.cpuidle module

class wlauto.modules.cpuidle.Cpuidle(owner, **kwargs)[source]

Bases: wlauto.core.extension.Module

aliases = AC([])
artifacts = AC([])
capabilities = ['cpuidle']
core_modules = []
description = '\n Adds cpuidle state query and manupution APIs to a Device interface.\n\n '
finalize(*args, **kwargs)
get_cpuidle_driver()[source]
get_cpuidle_governor()[source]
get_cpuidle_states(cpu=0)[source]
initialize(*args, **kwargs)
kind = 'module'
name = 'cpuidle'
parameters = AC(["Param({'kind': <type 'list'>, 'mandatory': None, 'name': 'modules', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})"])
probe(device)[source]
root_path = '/sys/devices/system/cpu/cpuidle'
validate(*args, **kwargs)
class wlauto.modules.cpuidle.CpuidleState(device, index, path)[source]

Bases: object

disable
get(prop)[source]
ordinal
set(prop, value)[source]
time
usage

wlauto.modules.flashing module

class wlauto.modules.flashing.FastbootFlasher(owner, **kwargs)[source]

Bases: wlauto.modules.flashing.Flasher

aliases = AC([])
artifacts = AC([])
core_modules = []
delay = 0.5
description = '\n Enables automated flashing of images using the fastboot utility.\n\n To use this flasher, a set of image files to be flused are required.\n In addition a mapping between partitions and image file is required. There are two ways\n to specify those requirements:\n\n - Image mapping: In this mode, a mapping between partitions and images is given in the agenda.\n - Image Bundle: In This mode a tarball is specified, which must contain all image files as well\n as well as a partition file, named ``partitions.txt`` which contains the mapping between\n partitions and images.\n\n The format of ``partitions.txt`` defines one mapping per line as such: ::\n\n kernel zImage-dtb\n ramdisk ramdisk_image\n\n '
finalize(*args, **kwargs)
flash(image_bundle=None, images=None)[source]
initialize(*args, **kwargs)
kind = 'module'
name = 'fastboot'
parameters = AC(["Param({'kind': <type 'list'>, 'mandatory': None, 'name': 'modules', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})"])
partitions_file_name = 'partitions.txt'
serial_timeout = 30
validate(*args, **kwargs)
class wlauto.modules.flashing.Flasher(owner, **kwargs)[source]

Bases: wlauto.core.extension.Module

Implements a mechanism for flashing a device. The images to be flashed can be specified either as a tarball “image bundle” (in which case instructions for flashing are provided as flasher-specific metadata also in the bundle), or as individual image files, in which case instructions for flashing as specified as part of flashing config.

Note

It is important that when resolving configuration, concrete flasher implementations prioritise settings specified in the config over those in the bundle (if they happen to clash).

aliases = AC([])
artifacts = AC([])
capabilities = ['flash']
core_modules = []
finalize(*args, **kwargs)
flash(image_bundle=None, images=None)[source]

Flashes the specified device using the specified config. As a post condition, the device must be ready to run workloads upon returning from this method (e.g. it must be fully-booted into the OS).

initialize(*args, **kwargs)
parameters = AC(["Param({'kind': <type 'list'>, 'mandatory': None, 'name': 'modules', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})"])
validate(*args, **kwargs)
class wlauto.modules.flashing.VersatileExpressFlasher(owner, **kwargs)[source]

Bases: wlauto.modules.flashing.Flasher

aliases = AC([])
artifacts = AC([])
core_modules = []
deploy_image_bundle(device, bundle)[source]
deploy_images(device, image_bundle=None, images=None)[source]
description = "\n Enables flashing of kernels and firmware to ARM Versatile Express devices.\n\n This modules enables flashing of image bundles or individual images to ARM\n Versatile Express-based devices (e.g. JUNO) via host-mounted MicroSD on the\n board.\n\n The bundle, if specified, must reflect the directory structure of the MicroSD\n and will be extracted directly into the location it is mounted on the host. The\n images, if specified, must be a dict mapping the absolute path of the image on\n the host to the destination path within the board's MicroSD; the destination path\n may be either absolute, or relative to the MicroSD mount location.\n\n "
finalize(*args, **kwargs)
flash(image_bundle=None, images=None, recreate_uefi_entry=True)[source]
initialize(*args, **kwargs)
kind = 'module'
name = 'vexpress'
overlay_images(device, images)[source]
parameters = AC(["Param({'kind': <type 'list'>, 'mandatory': None, 'name': 'modules', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})"])
validate(*args, **kwargs)
wlauto.modules.flashing.expand_path(original_path)[source]
wlauto.modules.flashing.get_mapping(base_dir, partition_file)[source]
wlauto.modules.flashing.validate_image_bundle(bundle)[source]

wlauto.modules.reset module

class wlauto.modules.reset.NetioSwitchReset(owner, **kwargs)[source]

Bases: wlauto.core.extension.Module

aliases = AC([])
artifacts = AC([])
capabilities = ['reset_power']
core_modules = []
description = '\n Enables hard reset of devices connected to a Netio ethernet power switch\n '
finalize(*args, **kwargs)
hard_reset()[source]
initialize(*args, **kwargs)
kind = 'module'
name = 'netio_switch'
parameters = AC(["Param({'kind': <type 'list'>, 'mandatory': None, 'name': 'modules', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'host', 'constraint': None, 'default': 'ippowerbar', 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function integer>, 'mandatory': None, 'name': 'port', 'constraint': None, 'default': 1234, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'username', 'constraint': None, 'default': 'admin', 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'password', 'constraint': None, 'default': 'admin', 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function integer>, 'mandatory': None, 'name': 'psu', 'constraint': None, 'default': 1, 'allowed_values': None, 'global_alias': None, 'override': False})"])
validate(*args, **kwargs)

Module contents