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
-
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.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.