Firmware Images
Each build flavor names and packages its images differently. Images
maps a role, such as spl or kernel, to a file using the
artifacts.toml of the test category, so one test runs against every
flavor. See Write a test.
Resolve firmware images by role from the artifacts.toml descriptor.
- class hw_tests.images.Images(context, github)
Find and download the images used by a test.
Images are looked up by role (for example
spl,uboot,kernel) intests/<category>/artifacts.toml, under the table of the currentflavor. Each role setsartifact(artifact name glob),file(file glob inside the artifact), and optionallysource(a release from the[sources]table).When several artifacts or files match, the ones containing all
needsfrom the context are preferred.- Parameters:
context – Test context.
github –
GitHubclient to download with.
- property flavor
Image flavor, such as
br2-externaloru-boot.flavorfrom the context, else the name of the repository that built the images. Skips the test if neither is known.
- get(role)
Download the artifact for
roleand return the image path.Each artifact is downloaded once per instance. Release assets are also cached on disk across runs, see
GitHub.download. To use local release files instead, put them in_artifacts/<test name>/release/<source>.Skips the test if the flavor has no such role.
- artifact_path(role)
Return the image path for
role, relative to its artifact.Use it to place the file at the same path on a target or server. Calls
get()if needed.