From Fedora Project Wiki

Revision as of 17:44, 11 June 2024 by Dbrouwer (talk | contribs) (Remove outdated link to docker containers for openQA)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This page provides specific steps to do a basic one-system installation of openQA (with jobs run on the same system as the server) on Fedora (25 or higher), directly to the system. For more details and background information on this process, see the upstream install guide.

trial on PowerPC host
refer to few comments in discussion tab.
  • Install the required packages:
sudo dnf install openqa openqa-httpd openqa-worker fedora-messaging python3-jsonschema
  • Configure httpd:
cd /etc/httpd/conf.d/
cp openqa.conf.template openqa.conf
cp openqa-ssl.conf.template openqa-ssl.conf
setsebool -P httpd_can_network_connect 1
systemctl restart httpd
  • Configure the web UI by editing /etc/openqa/openqa.ini:
[global]
branding=plain
download_domains = fedoraproject.org
  • To use insecure but convenient 'fake' authentication, add:
[auth]
method = Fake
  • To use more secure FAS-based authentication, add:
[auth]
method=OpenID
[openid]
provider = https://id.fedoraproject.org/
httpsonly = 1
  • install and configure PostgreSQL required for new version of openQA
dnf install postgresql-server
postgresql-setup --initdb
  • Start the services (consider also running enable if you want persistence):
 systemctl start postgresql
 systemctl start httpd
 systemctl start openqa-gru
 systemctl start openqa-scheduler
 systemctl start openqa-websockets
 systemctl start openqa-webui
 systemctl start fm-consumer@fedora_openqa_scheduler
  • Create non-temporary API keys in the web interface at http://localhost. Click Login, then Manage API Keys and create a key and secret. Edit /etc/openqa/client.conf as follows:
[localhost]
key = insert key from web api
secret = insert secret from web api
  • Start a worker, and check that it shows up in the web UI admin interface:
systemctl start openqa-worker@1
  • To start more workers, change the number after the @ sign in the above command.
  • Check out the Fedora tests and load them into openQA:
cd /var/lib/openqa/tests/
git clone https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git fedora
chown -R geekotest:geekotest fedora
cd fedora
./fifloader.py -l -c templates.fif.json templates-updates.fif.json
  • To run some of the tests, you will also need to build some hard disk images:
git clone https://pagure.io/fedora-qa/createhdds.git ~/createhdds
dnf install libguestfs-tools libguestfs-xfs python3-fedfind python3-libguestfs libvirt-daemon-config-network libvirt-python3 virt-install withlock
mkdir -p /var/lib/openqa/factory/hdd/fixed
cd /var/lib/openqa/factory/hdd/fixed
~/createhdds/createhdds.py all
chown geekotest *
Long running process
Note that this will take quite a long time to run. You can continue with the rest of the set up while it runs, but until all the images are generated, some tests will fail to run correctly.
  • [optional] Set up a cron job that will run regularly and re-generate some of the images every two weeks or so. Create a file /etc/cron.daily/createhdds with this content (adjusting /path/to/createhdds as appropriate):
#!/bin/sh
cd /var/lib/openqa/share/factory/hdd/fixed
LIBGUESTFS_BACKEND=direct withlock /var/lock/createhdds.lock /path/to/createhdds/createhdds.py all --clean
  • To stay up-to-date as the tests are updated, you can do this periodically:
cd /var/lib/openqa/share/tests/fedora
git pull
./fifloader.py -l -c templates.fif.json templates-updates.fif.json

At this point you should be able to schedule jobs (see the fedora_openqa instructions) and most of the tests should work. However, a few of the tests require two or more workers to be able to communicate with each other (e.g. the FreeIPA tests, where one job sets up a server, and other jobs set up clients and try to connect to the server). For these tests to work, you must do some quite complex software-defined networking configuration on the worker host(s). Instructions for this are in the page OpenQA_advanced_network_guide.

To run some tests (currently only one specific test for IoT images), you will also need to set up TPM emulation. To do this:

dnf install swtpm swtpm-tools
curl -o /etc/systemd/system/openqa-swtpm@.service https://pagure.io/fedora-infra/ansible/blob/master/f/roles/openqa/worker/files/openqa-swtpm@.service
systemctl daemon-reload
curl -o systemd-swtpm.pp https://pagure.io/fedora-infra/ansible/blob/master/f/roles/openqa/worker/files/systemd-swtpm.pp
semodule -i ./systemd-swtpm.pp
systemctl enable openqa-swtpm@1.service
systemctl start openqa-swtpm@1.service

Repeat the last two commands as many times as you have worker instances enabled, incrementing the number each time (so if you have three worker instances, do them three times, for openqa-swtpm@1.service, then openqa-swtpm@2.service, then openqa-swtpm@3.service). You will also need to edit /etc/openqa/workers.ini and include tpm in the WORKER_CLASS setting.