tests: new image-generator test tool used for nested tests - #17694
sergiocazzolato wants to merge 1 commit into
Conversation
This is a new tool used to create the images used for nested tests and ubuntu-core tests. Also it is moved the ubuntu-image tool setup to the tool which previoulsy was installed in several places.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Relative output paths create broken symlinks, logging failures are masked, and the new central utility lacks focused tests.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (3)
What changed in this PR
Introduces a shared image-generation utility and centralizes Ubuntu Core/nested test image setup.
Changes:
- Adds configurable
image-generator. - Migrates nested and reflash image creation.
- Removes duplicated
ubuntu-imagesetup.
| File | Description |
|---|---|
tests/lib/tools/image-generator |
Adds image generation utility. |
tests/lib/prepare.sh |
Uses the utility for reflash images. |
tests/lib/nested.sh |
Uses the utility for nested Core images. |
spread.yaml |
Removes redundant setup. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| run_ubuntu_image() { | ||
| local return_code | ||
|
|
||
| if [ -n "$LOG_FILE" ]; then | ||
| set +e | ||
| env "${ENVIRONMENT[@]}" "${COMMAND[@]}" |& tee "$LOG_FILE" | ||
| return_code="${PIPESTATUS[0]}" | ||
| set -e | ||
| if [ "$return_code" -ne 0 ]; then | ||
| echo "image-generator: ubuntu-image failed with exit code $return_code (see $LOG_FILE)" >&2 | ||
| exit "$return_code" | ||
| fi | ||
| else | ||
| env "${ENVIRONMENT[@]}" "${COMMAND[@]}" | ||
| fi | ||
| } |
| fi | ||
| fi | ||
|
|
||
| ln -s "$OUTPUT_DIR/$IMAGE_BASE_NAME-$boot_volume.img" "$OUTPUT_DIR/$IMAGE_NAME" |
| postprocess_image | ||
| } | ||
|
|
||
| main() { |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #17694 +/- ##
==========================================
- Coverage 78.39% 78.38% -0.01%
==========================================
Files 1417 1415 -2
Lines 200662 200588 -74
Branches 2503 2503
==========================================
- Hits 157302 157237 -65
+ Misses 33925 33917 -8
+ Partials 9435 9434 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Tue Sep 22 16:07:04 UTC 2026 Test Predictor AnalysisPreparing
Executing
Restoring
Skipped tests from snapd-testing-skipIf you wish to have any of the below tests run in your PR, in your PR description, add 'unskip:' followed by a copy-and-pasted list of the below tests you wish to run (unskip plus test list must be valid yaml)
|


This is a new tool used to create the images used for nested tests and ubuntu-core tests.
Also it is moved the ubuntu-image tool setup to the tool which previoulsy was installed in several places.