[elbe-devel] [RFC PATCH 0/3] Build validation - Boot images with QEMU

Olivier Dion dion at linutronix.de
Mon May 18 03:35:31 CEST 2020


This patch queue introduces a way to validate images in a build
generated by Elbe using QEMU and serial communication.

This is WIP and I request feedback.

The pexpect package <https://pexpect.readthedocs.io/en/stable/> was
chosen for doing the serial communication with a guest.  It's similar
to the expect program, except it is not Tcl, thank God.

Users are expected to add <check-img> tag(s) to their project XML.
Each <check-img> should describe the emulation and serial
communication of an image file of the final build produced by Elbe.
This is greatly detailed in the log and in the schema.

Once this is done, users are expected to call 'elbe check-build
/path/to/elbe-build'.  Since this work is based on my previous WIP of
cdroms validation, you can use the '--skip-cdroms' if you just want to
test the emulation of images.

Note!  It's very important to pass either '-nographic' or '-serial stdio',
but not both, to your interpreter options (see <interpreter-opt> tag).

Also, I find helpful of having a transcript of the communication
between the host and the guest if things went wrong, and thus one is
printed at the end of each emulation

Finally, one thing that I hit during testing but didn't fix yet is
that sometime when shutting down the machine (see the XML example),
you might get a systemd anomaly "a stop job is running" with a timeout
that is greater than the default timeout in pexpect (30s) and you will
get a timeout error.

Olivier Dion (3):
  schema dbsfed: Add schema definitions for check-img
  commands check-build: Add CheckImage test
  examples minimal-grub-buster: Add an example of check-img

 elbepack/commands/check-build.py              | 100 ++++++++++++++++-
 .../x86_32-pc-hdimg-minimal-grub-buster.xml   |  16 +++
 schema/dbsfed.xsd                             | 101 ++++++++++++++++++
 3 files changed, 213 insertions(+), 4 deletions(-)

-- 
2.26.2




More information about the elbe-devel mailing list