Image test
Introduction
Once you have created and built an image, it is possible to test it. In order to test it, the factory needs to know several parameters:
-
The board model to use to run the image
- It is really linked to the type of image you want to test, if you want to test an image for a real board, you need first to integrate this board in the redpesk factory (indeed, by default only the
qemu-redpesk-x86_64is supported)
- It is really linked to the type of image you want to test, if you want to test an image for a real board, you need first to integrate this board in the redpesk factory (indeed, by default only the
-
The package to use to run the test
- This package contains every verification you need to do inside the image. It has to contains a
-redtestsubpackage like a standard application to test, the difference here is that the test is about the image, not the application - You can use the package provided by the distribution to start:
redpesk-images-tester, it tests that all systemd services are correctly started and that thehelloworld-bindingtests are passing correctly
- This package contains every verification you need to do inside the image. It has to contains a
You also have the possibility to specify additional parameters:
- The time-out: maximum time for the test to take place (default: 5 minutes)
- Comment: a comment that describes your test (default: “”)
All these parameters can be saved in the factory as “default parameters”. Once set, the factory will use those if nothing is specified or if the test is started automatically (after a successful build if the auto field is activated in the image settings).
Using the WebUI
Start an image test
Enable automatic test
Configure default test settings
Using rp-cli
Start an image test
$ rp-cli images test my-demo-image -b qemu-redpesk-x86-64 -p redpesk-images-tester --time-out 10
-- Image test requested by user --
Testing the image on build 5233...
[STATE CHANGE] pending -- TOTAL => 0
[STATE CHANGE] deploying -- TOTAL => 0
[STATE CHANGE] started -- TOTAL => 0
[STATE CHANGE] started -- TOTAL => 0
[STATE CHANGE] success -- TOTAL => 5
------- Image test succeeded ------
Enable automatic test
$ rp-cli images update my-demo-image --auto-test true
-- Image update requested by user --
Update of "My demo image" image...[OK]
Configure default test settings
$ rp-cli images tests set-default-settings my-demo-image -b qemu-redpesk-x86-64 -p redpesk-images-tester --time-out 15
-- Set default test settings for image --
Update of "My demo image" image...[OK]