The goal is to install openQA in a local virtual machine with the capacity to run 2 workers.
In this document, the following assumptions are made:
/media/fastapt-cacher-ng is running and available inside the VM at 192.168.122.1:3142Host System Preparation (user=root on the host)
If you are using virt-manager: Install on the host
apt-get install virt-manager
If you are using VirtualBox: Create an easily accessible folder on your Windows host, for example: C:\media\fast.
Download the latest netinst image (user=you on the host)
https://get.debian.org/images/release/current/amd64/iso-cddebian-X.Y.Z-amd64-netinst.iso (where X, Y and Z are version numbers)VirtualBox: Place your downloaded ISO files inside the folder you created (C:\media\fast)Start virtual machine manager (user=you on the host)
virt-manager, or VirtualBox, launch it.Prepare virtual machine (user=you on the host)
Create a new virtual machine
If you are using virt-manager:
File | New Virtual MachineQEMU/KVMDebian 13If you are using VirtualBox:
VirtualBoxopenqaMemory: 8192, this is enough for openqa (1GiB), 1 big (4GiB) and 1 small worker (2GiB)
3, one for openqa and one for each workerHard Disk Configuration:
virt-manager:
80 GiBVirtualBox:
80 GiBopenqa, do this, if you're using virt-manager, but skip as you've done it previously for VirtualBoxConfigure Shared Folder:
virt-manager:
virtio-9p/media/fast/external_iso_filesVirtualBox:
external_iso_filesIf you are using virt-manager click Begin Installation, if you are using VirtualBox click Start
en_US.UTF-8 as localeopenqaroot as password for root (twice)useruser (twice)yeshttp://192.168.122.1:3142 (if you have apt-cacher-ng installed, otherwise leave it blank)/dev/vdauser and password usergnome-terminal and press Entersu - and type root after Passworduser=rootuser=userIf you are using VirtualBox, add the Guest Additions for better performance
VirtualBox, enable Devices | Shared Clipboard | BidirectionalIn the menu of VirtualBox, click Devices | Insert Guest Additions CD image...
In the gnome-terminal inside the VM (user=root)
apt install -y build-essential dkms linux-headers-generic
mount /dev/cdrom /mnt
sh /mnt/VBoxLinuxAdditions.run
reboot
After rebooting, open two tabs in the gnome-terminal (one as user, one as root), then continue with the next steps
Use dep822 for apt (user=root)
apt --yes modernize-sources
rm /etc/apt/sources.list~
rm /etc/apt/sources.list.bak
Prepare to use fasttrack (user=root)
apt-get install fasttrack-archive-keyring
Activate fasttrack (user=root)
cat << EOF > /etc/apt/sources.list.d/fasttrack.sources
Types: deb
URIs: https://fasttrack.debian.net/debian-fasttrack/
Suites: trixie-fasttrack
Components: main
Signed-By: /usr/share/keyrings/fasttrack-archive-keyring.gpg
EOF
Install required and preferred packages (user=root)
rm /etc/apt/apt.conf # This contains the proxy that was used during the installer
apt-get update # Update the package list
apt-get install auto-apt-proxy
apt-get install aptitude # For looking at package dependencies etc.
apt-get install --yes ansible ssh-askpass rsync # For the configuration of the openqa server
Install the Debian package openqa and friends (user=root)
apt-get install --yes -t trixie-fasttrack openqa openqa-worker
Configure openqa (for non-ssl) (user=root)
/usr/share/openqa/script/configure-web-proxy
a2dissite 000-default
a2ensite openqa
systemctl reload apache2
Configure the login procedure (user=root)
cat << EOF > /etc/openqa/openqa.ini.d/50-download_domains.ini
[global]
# Allowed domains for ISO_URL
download_domains = reproducible-builds.org debian.org
EOF
cat << EOF > /etc/openqa/openqa.ini.d/50-auth.ini
[auth]
# Simple authentication
method = Fake
EOF
Download and prepare the tests (user=root)
su geekotest -s /bin/bash
cd /var/lib/openqa/share/tests
git clone https://salsa.debian.org/qa/openqa/openqa-tests-debian.git debian
ln -s debian debian-live
ln -s debian debian-edu
ln -s debian kali
ln -s debian windows
exit # To become root again
Generate the documentation (user=root)
markdown /var/lib/openqa/share/tests/debian/documentation/install.md > /usr/share/openqa/public/install.html
markdown /var/lib/openqa/share/tests/debian/documentation/work_on_tests.md > /usr/share/openqa/public/work_on_tests.html
markdown /var/lib/openqa/share/tests/debian/documentation/evolution_of_test_scenario.md > /usr/share/openqa/public/evolution_of_test_scenario.html
Apply the Debian branding (user=root)
mkdir -p /usr/share/openqa/templates/webapi/branding/openqa.debian.net
cat << EOF > /usr/share/openqa/templates/webapi/branding/openqa.debian.net/sponsorbox.html.ep
<div class="text-end" id="sponsorbox">
<a href="https://www.debian.org" title="Debian"><img alt="Debian" src="https://www.debian.org/logos/openlogo.svg"></a>
</div>
EOF
cat << EOF > /usr/share/openqa/templates/webapi/branding/openqa.debian.net/docbox.html.ep
<h1>Welcome to the openQA instance of Debian</h1>
<p>Life is too short for manual testing!</p>
<p>
<a class="btn btn-primary btn-lg" href="http://open.qa" role="button">Learn more »</a>
<a class="btn btn-primary btn-lg" href="/https/openqa.debian.net/install.html" role="button">Install your own copy of openQA »</a>
<a class="btn btn-primary btn-lg" href="/https/openqa.debian.net/work_on_tests.html" role="button">Work together on tests »</a>
<a class="btn btn-primary btn-lg" href="/https/openqa.debian.net/evolution_of_test_scenario.html" role="button">Evolution of a test scenario »</a>
</p>
EOF
cat << EOF > /etc/openqa/openqa.ini.d/50-branding.ini
[global]
branding=openqa.debian.net
EOF
Restart the openQA webui (user=root)
systemctl reload openqa-webui
openqa-cli api --apibase http://localhost -X GET login | grep "Logged in as"
Configure the API key, to avoid providing the values on each openqa-cli command (user=user)
mkdir ~/.config/openqa
cat << EOF >> ~/.config/openqa/client.conf
[localhost]
key = 1234567890ABCDEF
secret = 1234567890ABCDEF
EOF
Create a new SSH key for Ansible (user=user)
ssh-keygen -t ed25519 -C "VM Debian-openQA"
cat ~/.ssh/id_ed25519.pub >> ~/.ssh/authorized_keys
# Make localhost known
ssh-keyscan localhost >> ~/.ssh/known_hosts
# Ugly, needs improvement: create the groups manually and remove the deleted ids
# At the time of writing this, the highest id was 24
for i in $(seq 1 24); do openqa-cli api -X POST job_groups name=dummy_group$i; done
for i in $(seq 1 9) 15; do openqa-cli api -X DELETE job_groups/$i; done
cd /var/lib/openqa/share/tests/debian/configuration
ansible-playbook configure_openqa.yaml -i server_localhost.yaml
Mount the pre-existing ISOs that have been made available (user=root)
If you are using virt-manager:
echo "/external_iso_files /var/lib/openqa/share/factory/iso 9p trans=virtio,ro 0 0" >> /etc/fstab
systemctl daemon-reload
mount /var/lib/openqa/share/factory/iso
If you are using VirtualBox:
cat << EOF >> /etc/fstab
external_iso_files /var/lib/openqa/share/factory/iso vboxsf rw,auto 0 0
EOF
systemctl daemon-reload
mount /var/lib/openqa/share/factory/iso
Note: this mount point must be unmounted before updating openqa with apt-get
Disable the (currently) not needed slirp VDE service (user=root)
systemctl disable openqa-slirpvde
Use the proxy when running installers under openQA (user=root)
cat << EOF > /etc/openqa/workers.ini.d/50-http_proxy.ini
[global]
# Use the proxy (apt-cacher-ng) from the host
HTTP_PROXY = http://192.168.122.1:3142/
# The value http://localhost:9/ could be used for a 'network-access-denied' setting
EOF
Configure a second worker with more memory (user=root)
cat << EOF > /etc/openqa/workers.ini.d/55-bigmem-worker.ini
# x86_64 worker for jobs that require more memory
[2]
WORKER_CLASS=qemu_x86_64,qemu_x86_64_bigmem
EOF
Configure the secrets (user=root)
cat << EOF > /etc/openqa/client.conf
[localhost]
key = 1234567890ABCDEF
secret = 1234567890ABCDEF
EOF
chown _openqa-worker /etc/openqa/client.conf
chmod 0400 /etc/openqa/client.conf
Start the cache service (user=root)
systemctl restart openqa-worker-cacheservice
systemctl restart openqa-worker-cacheservice-minion
Enable the workers (user=root)
systemctl enable openqa-worker@1
systemctl enable openqa-worker@2
systemctl start openqa-worker@1
systemctl start openqa-worker@2
It is possible to test arm64 images using emulation. Be warned that this is slow.
Install the suitable qemu package (user=root)
apt-get install qemu-system-arm
Configure a worker for arm64 (user=root)
cat << EOF > /etc/openqa/workers.ini.d/60-arm-worker.ini
# arm64 worker
[10]
WORKER_CLASS=qemu_aarch64
QEMU_NO_KVM=1
QEMUCPU=max
QEMUMACHINE=virt,usb=off
EOF
Activate the worker (user=root)
systemctl enable openqa-worker@10
systemctl start openqa-worker@10
Before running the tests, ensure that the API key is still valid and the workers are running
Download the netinst image (on the host)
cd /media/fast
wget --timestamping https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-13.1.0-amd64-netinst.iso
Run the netinst tests (user=user)
openqa-cli api -X POST isos ISO=debian-13.1.0-amd64-netinst.iso DISTRI=debian VERSION=stable FLAVOR=netinst-iso ARCH=x86_64 BUILD=1310
Note: the tests with the prefix rescue will initially fail by design: they attempt to work on the previous installed image, which will not be present in the initial run. After xfce_HD and xfce_HD@64bit have finished, you can restart the rescue jobs and they will pass.
The arm64 worker needs to be configured.
Download the netinst image (on the host)
cd /media/fast
wget --timestamping https://cdimage.debian.org/debian-cd/current/arm64/iso-cd/debian-13.1.0-arm64-netinst.iso
Run the netinst tests (user=user)
openqa-cli api -X POST isos ISO=debian-13.1.0-arm64-netinst.iso DISTRI=debian VERSION=stable FLAVOR=netinst-iso ARCH=aarch64 BUILD=1310
Download the live image (on the host)
cd /media/fast
wget --timestamping https://get.debian.org/images/release/current-live/amd64/iso-hybrid/debian-live-13.1.0-amd64-gnome.iso
Run the tests (user=user)
openqa-cli api -X POST isos ISO=debian-live-13.1.0-amd64-gnome.iso DISTRI=debian-live VERSION=trixie FLAVOR=gnome ARCH=x86_64 BUILD=1310 CHECKSUM=1886e3fcfdbe60d01ed5e878e143e56ca0443afa8a655404cf3bc057f39a622c
Note: the tests with the prefix dualboot will initially fail by design: they attempt to work on a Windows image, which will not be present in the initial run, they can be created later
Log in as administrator on the openQA web interface (user=user)
Explore the web interface of openQA
If you want to run dual boot tests, you'll need at least a Windows 11 installed image, and optionally a Windows 10 image. Note that these installed images require a lot of disk space.
Install the TPM emulation (user=root)
apt-get install swtpm
Download the official Windows ISO files from Microsoft for Windows 10 (about 5GB) and Windows 11 (about 8GB) to /media/fast (user=you on the host)
Note: on the production server the files are stored in the subdirectory fixed to ensure that the ISO file will never be deleted
Verify that the download was successful by checking the checksums (the values are given on the download page) (user=you on the host)
sha256sum filename.isoGet-FileHash filename.isoPrepare the Windows harddisk images in openQA (user=user)
# For the Windows 10 image
openqa-cli api -X POST isos DISTRI=windows FLAVOR=windows10 VERSION=10 BUILD=22H2 ARCH=x86_64 ISO=Win10_22H2_English_x64v1.iso
# For the Windows 11 image
openqa-cli api -X POST isos DISTRI=windows FLAVOR=windows11 VERSION=11 BUILD=25H2 ARCH=x86_64 ISO=Win11_25H2_English_x64.iso
Restart the dualboot tests -> they should pass now
If you need to reset the database and start from scratch (but you can keep the installed packages and configuration) follow the next steps.
Warning: this will remove all content from the database
Stop all services (user=root)
systemctl stop openqa-webui
systemctl stop openqa-gru
systemctl stop openqa-websockets
systemctl stop openqa-scheduler
Drop the database (user=geekotest)
dropdb openqa
There should not be a line like DETAIL: There are N other sessions using the database., otherwise a few more openqa-related services need to be stopped
Regenerate the empty database (user=root)
systemctl start openqa-webui
Recreate the job groups and redo the steps with Ansible