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
-
New Slimbook EVO with Raw AMD Ryzen Power
If you're looking for serious power in a 14" ultrabook that is powered by Linux, Slimbook has just the thing for you.
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.