Tests reference¶
Protoplaster contains tests described in the following sections:
ADC12DJ3200 SPI test¶
This module provides tests for the ADC12DJ3200:
Tests¶
test_default_valuescheck if some ADC12DJ3200 registers have default reset values
LTC2493 device test¶
This module provides tests for LTC2493:
Parameters¶
address:intI2C address of device
bus:int | strI2C bus
vref:floatVoltage reference
Tests¶
test_is_alivecheck if responds correctly to simple requests
LTC2499 device test¶
This module provides tests for LTC2499:
Parameters¶
address:intI2C address of device
bus:int | strI2C bus
vref:floatVoltage reference
Tests¶
test_is_alivecheck if responds correctly to simple requests
ADC device test¶
This module provides tests for ADC devices: dev.name
Parameters¶
channels:list[adc.__Channel]Device-dependent channel configuration
__Channel(type with attributes defined below)
channel:intChannel number
v_expected:floatExpected voltage for channel
dev:__ADCADC device config
name:strName of ADC
driver:strName of an ADC driver class defined in
protoplaster/tests/adc(further parameters required)
device_name:strExpected name for drivers that can return a name
tolerance:floatAbsolute tolerance for results measured vs expected [V]
Tests¶
test_device_name(if applicable) check if the device name is
device_nametest_is_alivecheck if
dev.nameexists and respondstest_read_adcverify that voltages measure within
self.tolerance: 0.5 V of their expected values
Eye Scan tests¶
This module provides tests for Eye Scan using IBERT:
Tests¶
test_create_diagramparse `` and create diagram
test_eye_sizeparse `` and assert eye size
test_transceiver_statuscheck if the transceiver link is correctly established via verifying STATUS property
Camera sensor tests¶
This module provides tests dedicated to V4L devices on specific video node: device
Parameters¶
camera_name:str, requiredCamera sensor name
device:str, requiredVideo device
driver_name:str, requiredVideo driver name
save_file:strOutput file for frame test
Tests¶
test_device_namecheck if the camera sensor name is
camera_nametest_driver_namecheck if the camera sensor driver name is
driver_nametest_frametry to capture frame
LMK04828 SPI test¶
This module provides tests for the LMK04828:
Tests¶
test_default_valuescheck if read-only LMK04828 registers have their default reset value
LTC2655 device test¶
This module provides tests for LTC2655:
Tests¶
test_is_alivecheck if LTC2655 responds correctly to simple requests
LTC2657 device test¶
This module provides tests for LTC2657:
Tests¶
test_is_alivecheck if LTC2657 responds correctly to simple requests
DAC device test¶
This module provides tests for DAC devices:
Tests¶
test_sysfs_interfacecheck if the sysfs interface exists: ``
Eye Scan tests¶
This module provides tests for Eye Scan:
Tests¶
test_create_diagramparse `` and create diagram
test_eye_sizeparse `` and assert eye size
DAC38J8x SPI test¶
This module provides tests for the DAC38J8x:
Tests¶
test_config127_valueverify the default value of the read-only CONFIG127 register
Extended simple tests¶
This module extends TestSimple:
Parameters¶
device:str, requiredName to use in dummy tests
skipped_devices:list[str]List of devices to skip
Tests¶
test_conditional_skipThis test is skipped if the device name is “skip” or its contained in skipped_devices list
test_configure_runs_onceThis test asserts
configurehas been executed and the class state is correctly initialized for the current test run.test_failureThis test always fails.
test_record_artifactThis test always succeeds, and records an artifact.
test_successThis test always succeeds.
Flash chip test¶
This module provides tests dedicated to flash chips: dev.name
Parameters¶
binary:str, requiredPath to file to be flashed
dev:__Flash, requiredDevice config
name:strStorage device name
driver:strName of a device driver class defined in
protoplaster/tests/flash(further parameters required)
Tests¶
test_flashingtry flashing file
binaryonto devicetest_presencecheck if device
dev.nameis presenttest_validate_flashingcheck if file was flashed correctly (if possible)
Flashing FPGA test¶
This module provides tests for flashing the fpga:
Tests¶
PI4IO tests¶
This module provides tests dedicated to the PI4IOE5V96224
Parameters¶
address:intI2C address of device
bus:intI2C bus
Tests¶
test_is_alivecheck if PI4IOE5V96224 responds correctly to simple requests
GPIOs tests¶
This module provides tests dedicated to GPIO on specified bus: dev.name
Parameters¶
dev:_GPIOGPIO device
name:strGPIO device name
driver:strName of a GPIO driver class defined in
protoplaster/tests/gpio(further parameters required)
pins:list[gpio.__GPIO_Pin]List of pins to test
__GPIO_Pin(type with attributes defined below)
pin:intPin number
direction:strDirection (‘in’ or ‘out’)
state:boolExpected pin state
test_name:strCustom name for the test
Tests¶
test_is_alive(if applicable) check if device
dev.nameresponds
HTTP echo tests¶
This module tests HTTP responses between nodes: dev1, dev2
Parameters¶
dev1:str, requiredDevice 1 to be used in tests
dev2:str, requiredDevice 2 to be used in tests
port:intPort for this machine to run server on
test_string:strString to send in tests (default: “Hello World!”)
Tests¶
test_echo_asyncAsync Orchestration test:
Main PC starts HTTP server.
dev2 starts polling for the message (non-blocking).
Main PC thread sleeps for 5 seconds.
dev1 connects to Main PC and POSTs “Hello world”.
dev2 receives the message and returns it.
test_echo_fully_asyncFully Async test:
Main PC starts HTTP server.
Triggers dev2 (read) AND dev1 (write) asynchronously.
Waits for both to complete.
test_echo_multinodeOrchestration test:
Main PC starts HTTP server.
dev1 connects to Main PC and POSTs “Hello world”.
dev2 connects to Main PC and GETs the message.
Main PC verifies the message matches.
I2C device tests¶
This module provides tests dedicated to i2c devices on a specific bus: dev.name
Parameters¶
dev:_I2CI2C controller
name:strName of I2C controller
driver:strName of an I2C driver class defined in
protoplaster/tests/i2c(further parameters required)
devices:list[i2c.__I2C_Device], requiredList of I2C devices
__I2C_Device(type with attributes defined below)
name:strName of I2C device
address:intAddress of I2C device
Tests¶
test_addressesdetection test:
check for device
nameon addressaddress
TCA9548A test¶
This module provides tests for the TCA9548A:
Parameters¶
i2c_address:int, requiredI2C device address
i2c_bus:int | str, requiredI2C bus address
reset_gpio:int | strGPIO number for resetting device
reset_state:boolGPIO reset pin logic level – active-low (False) or active-high (True)
smbus_force:boolUse address even if already in use by another kernel driver
Tests¶
test_is_alivecheck if TCA9548A responds correctly to simple requests
test_resetCheck whether the TCA9548A responds correctly to a reset triggered by pulling low
I2C multiplexer test¶
This module provides generic tests for I2C multiplexers: dev.name
Parameters¶
dev:__MuxI2C multiplexer
name:strDevice name
model:strName of a mux driver class defined in
protoplaster/tests/i2c/i2c_mux(further parameters may be required)parent:_I2CParent I2C bus (attribute
devof I2C test)name:strName of I2C controller
driver:strName of an I2C driver class defined in
protoplaster/tests/i2c(further parameters required)
i2c_address:intI2C address of multiplexer
gpio_dev:protoplaster.tests.gpio.gpio.test._GPIO | NoneGPIO device for reset functionality
_GPIO, NoneType(type with attributes defined below)
name:strGPIO device name
driver:strName of a GPIO driver class defined in
protoplaster/tests/gpio(further parameters required)
reset_gpio:int | NoneGPIO reset pin
reset_state:boolGPIO reset pin logic level – active-low (False) or active-high (True)
Tests¶
test_is_alivecheck if muxer responds correctly to simple requests
test_reset(skipped) check whether the multiplexer responds correctly to a reset triggered by pulling the reset pin low
DMA test¶
This module provides tests for DMA:
Tests¶
test_memoryverify the integrity of memory of size with iterations.
Network interface tests¶
This module provides tests dedicated to network interfaces: interface
Parameters¶
interface:str, requiredNetwork device to perform tests on
speed:strSpeed of network device [Mbit/s]
Tests¶
test_existcheck if the interface exists
test_speedcheck if the interface speed is
speedMbit/s
DA9062 device test¶
This module provides tests for DA9062:
Tests¶
test_config_idverify that the DA9062 PMIC returns the expected config ID: ``
test_current_ldosverify voltage of:
test_current_selectionsverify selection of:
test_customer_idverify that the DA9062 PMIC returns the expected customer ID: ``
test_is_alivecheck if DA9062 responds correctly to simple requests
test_variant_idverify that the DA9062 PMIC returns the expected variant ID: ``
UCD90320U device test¶
This module provides tests for UCD90320U:
Tests¶
test_clear_faultsclear the faults latched by the UCD90320U in preparation for a new test run
test_is_alivecheck if UCD90320U responds correctly to simple requests
test_read_faultsread the faults latched by the UCD90320U after the test run
Simple tests¶
This module provides simple dummy tests: device
Parameters¶
device:str, requiredName to use in dummy tests
Tests¶
test_conditional_skipThis test is skipped if the device name is “skip”
test_configure_runs_onceThis test asserts
configurehas been executed and the class state is correctly initialized for the current test run.test_failureThis test always fails.
test_record_artifactThis test always succeeds, and records an artifact.
test_successThis test always succeeds.
SPI device tests¶
This module provides tests dedicated to SPI devices: dev.name
Parameters¶
command:list[int]Command to send
dev:__SPIDevice config
name:strSPI device name
driver:strName of an SPI driver class defined in
protoplaster/tests/spi(further parameters required)
response_expected:list[int]Expected response to command
Tests¶
test_spi_responsecheck if device responds to command
commandwithresponse_expected
TMP431 device test¶
This module provides tests for TMP431:
Tests¶
test_is_alivecheck if TMP431 responds correctly to simple requests
USB tests¶
This module provides tests for USB devices: device
Parameters¶
device:str, requiredName of device as seen by kernel
speed:intExpected speed [Mbps]
Tests¶
test_negotiated_speedcheck if the negotiated USB speed is Mbps
test_sysfs_interfacecheck if the sysfs interface exists: ``