Exploring openSUSE's automated testing tool for ISO images
Command and Control
Successfully booting a SUSE installation disk or ISO file requires input, even at the first screen (Figure 2). Luckily, KVM/Qemu starts a VNC server and allows users to send input remotely (via the VNC protocol) to the virtual machine. This API is called the Qemu/KVM Monitor. You can send mouse moves and events like clicks, any keyboard input, and more into the virtual machine [2]. On the other hand, it's also possible to grab screenshots and extract audio.
The developers of openQA let their scripts take several screenshots per second. Videos like those provided on the website are simply series of those pictures rendered using standard tools such as Image Magick or Mplayer/Mencoder – tools that are probably already on your Linux box. The openQA developers are still working on sound/audio and general multimedia support.
Comparing Images
In the next step, openQA compares the screenshots acquired to screenshots prepared and taken from a working system. The openQA web interface shows the resulting errors or the success.
In a nutshell, just imagine the boot screen. If you hit the Down arrow, GRUB must select the next entry in the list. To test this action, a developer will have prepared an image with the second entry highlighted. openQA then compares this image to the screenshot just taken. If the images match, then openQA will send a Return key command to the virtual machine to proceed with the installation.
Needles, Pins and Tests
Some processes just don't matter – like when SUSE randomly tells the user about its newest features while the installation wizard is busily copying files. To make sure only areas of interest are compared and evaluated for possible errors, the openQA developers invented the concept of needles [3] (Figures 3 and 4, Listing 1).
Listing 1
A Thunderbird Needle
A needle describes an area within a screenshot. The openQA website has an online editor that allows you to drag and drop the square you want to have inspected onto the picture. Or, you can go to the JSON files and edit the needle yourself. An openQA test can consist of countless needles. Additionally, hundreds of tests are already available, including specialized tests for KDE, Gnome, and other desktops.
You can test for network connectivity, check if an SSH server was successfully started, and much more – the web interface will report success and failure in long lists. If you want to extract the results and work with them, you can download them in a JSON file called results.json
. Initial variables are stored in vars.json
and might describe certain behaviors (Listings 2 and 3).
Listing 2
Excerpt from results.json
Listing 3
vars.json
The web interface lets you download these files and offers detailed insight into the tests (Figures 5 and 6). If you want to dive in deeper and start writing your own tests, see the HowTos available online [3] [4].
« Previous 1 2 3 4 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
So Long Neofetch and Thanks for the Info
Today is a day that every Linux user who enjoys bragging about their system(s) will mourn, as Neofetch has come to an end.
-
Ubuntu 24.04 Comes with a “Flaw"
If you're thinking you might want to upgrade from your current Ubuntu release to the latest, there's something you might want to consider before doing so.
-
Canonical Releases Ubuntu 24.04
After a brief pause because of the XZ vulnerability, Ubuntu 24.04 is now available for install.
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.