Test automation can be fun and openQA is good at it but it has limitations. This project is meant to find out where the limits are for applications with lots of things moving on the screen, e.g. a game. Completely unrelated, web based tools become the norm for many users, e.g. when working from a chromebook or similar environments. The idea here is to try to use only web based tools and not force users to use a terminal which can be frightening :) As a third requirement: Some people are not feeling comfortable using openQA "because tests are written in Perl". This is not necessarily true because tests are rather written using a simplistic test API and only a small subset of Perl knowledge is necessary, however, we still want to support other entry points so there is Python support added in . To find out what this new way is capable of this project should use only that Python support and find out any restrictions.



current status and findings

starting situation

I had applied for the closed Beta for "github codespaces", something like "Virtual Studio Code in the cloud", but so far was not granted access. Means I need to find other solutions.

I did not manage yet to have the python backend for os-autoinst in merged as surprisingly tests failed even though I am pretty sure this worked some months ago. As an alternative last week I did to allow a custom openQA worker engine so that for example I an experiment with the mentioned python support on production openQA workers while the pull request is still open.

day 1

To provide a custom openQA worker engine with python support I changed to publish packages and add a container including the changes directly

<publish> <enable/> </publish> … <repository name="containers"> <path project="openSUSE:Templates:Images:Tumbleweed" repository="containers"/> <arch>x86_64</arch> </repository>

and in the project config from

``` %if "%_repository" == "containers" Type: docker Repotype: none Patterntype: none %endif

Prefer: openSUSE-release-appliance-docker ```

then branched to . All using the OBS web UI as using the terminal is to be avoided in this hackweek project ;)

Now I can find the container image on*

Now to be used like in I created a new API key+secret pair in and added a new secret variable on name OPENQA_O3_USER_KEY_SECRET with value okurz:<my_key>:<my_secret> with <my_key> and <my_secret> filled from the key and secret from . Now I can trigger a test job on every push like the following (untested example):


So that this can be done by github actions for every push to a branch in my fork of the openSUSE openQA tests I created a branch "hackweek_20"

where I should merge the content from current upstream master and then add instructions with the above curl command to trigger a job for a to-be-written test, e.g. for 0ad. Also, at best the trigger with curl can already include a command line to use a customized openQA worker engine following , e.g.

curl … ISOTOVIDEO="podman run --pull=always --rm -it /usr/bin/isotovideo -d" CASEDIR=

As a further web-based IDE I envision something like using and with alternatives

day 2

Included the above proposal in

``` name: openqa

yamllint disable-line rule:truthy

on: [push, pullrequest] jobs: openqa: runs-on: ubuntu-latest name: "Trigger an openQA test with custom new test together with a custom os-autoinst backend" container: image: curlimages/curl steps: - name: Trigger openQA test # see regarding the repo and branch variables # hdd variable needs to be updated when old images are pruned run: | curl -u ${{ secrets.OPENQAO3USERKEYSECRET }} -X POST \ -H "Content-Type: application/json" \ -d '{"ARCH": "x8664", "FLAVOR": "test", "VERSION": "Tumbleweed", "MACHINE": "64bit", \ "TEST": "okurzhackweek200ad", \ "ISOTOVIDEO": "podman run --pull=always --rm -it /usr/bin/isotovideo -d", \ "CASEDIR": "${{ github.repository }}#${GITHUBREF#refs/heads/}", \ "HDD1": "opensuse-Tumbleweed-x8664-20210320-Tumbleweed@64bit.qcow2", \ "SCHEDULE": "tests/boot/boottodesktop,tests/games/0ad" \ }' \ ```

with so far using the normal github web editor. This nicely triggers github actions which execute rather fast (8s) but fails in with {"error":"TEST field mandatory"}. So JSON mode does not seem to work as I expected. Let's try url-encoded way for curl:

curl -u ${{ secrets.OPENQA_O3_USER_KEY_SECRET }} \ -d 'arch=x86_64&flavor=test&version=Tumbleweed&machine=64bit&test=okurz_hackweek_20_0ad&isotovideo="podman run --pull=always --rm -it /usr/bin/isotovideo -d"&casedir=${{ github.repository }}#${GITHUB_REF#refs/heads/}&hdd_1=opensuse-Tumbleweed-x86_64-20210320-Tumbleweed@64bit.qcow2&schedule="tests/boot/boot_to_desktop,tests/games/0ad" \

This seems to work better: triggered

The job is incomplete missing "podman" on workers which of course so far is not available. For testing purposes I installed podman on openqaworker7.o.o. Likely I need to add it to apparmor profiles, but let's see it first. So adding the test parameter worker_class=openqaworker7 and getting with still "No such file or directory" as if the parameter quoting has gone wrong.

Seems like curl can handle the parameter with just the spaces and without additional quotes ending up in which ends up in "Permission denied" for podman as expected due to apparmor. So I did aa-genprof /usr/share/openqa/script/worker to include podman and multiple reruns to come up with a complete profile and now we have in

Error: please update to v2.0.1 or later: outdated conmon version

Well, that's interesting :) rpm -qa conmon reveals conmon-2.0.20-lp152.4.3.1.x86_64, maybe again apparmor? Calling aa-complain usr.share.openqa.script.worker and retriggering yields what I can also confirm when running sudo -u _openqa-worker podman run --rm -it mini/base cat /etc/os-release on openqaworker7.o.o:

Error: error creating runtime static files directory: mkdir /var/lib/empty/.local: permission denied

Well, /var/lib/empty is the actual home directory of the user _openqa-worker and it's correct that the user is denied writing there. mentions the possibility to specify a different path for which again the best would be a config file in the home directory of the user. Trying to specify a different working directory with:

sudo -u _openqa-worker sh -c 'HOME=/tmp; podman run --rm -it mini/base cat /etc/os-release'

this yields:

ERRO[0000] cannot find UID/GID for user _openqa-worker: No subuid ranges found for user "_openqa-worker" in /etc/subuid - check rootless mode in man pages. Completed short name "mini/base" with unqualified-search registries (origin: /etc/containers/registries.conf) Trying to pull name unknown Trying to pull Getting image source signatures Copying blob d0cfd5f0b761 done Copying blob 5f4e1487b379 done Copying blob 2aecc7e1714b done Copying blob ebe21ca6e618 done Copying config 81d4bcc7ba done Writing manifest to image destination Storing signatures Error processing tar file(exit status 1): potentially insufficient UIDs or GIDs available in user namespace (requested 0:42 for /etc/shadow): Check /etc/subuid and /etc/subgid: lchown /etc/shadow: invalid argument

I think I have seen this before. I assume rootless podman on openSUSE Leap 15.2 standard packages is not that easy. Ok, going with sudo podman, ending up in with

[2021-03-23T20:51:58.0353 CET] [debug] +++ worker notes +++ Trying to pull Getting image source signatures Copying blob sha256:0c0b1fc21e7c891fd7642e4f8a4e624a677c212a09553ea655deae26561d0046 Copying blob sha256:81605b3fa72198ecbd994128ebb2651ba4658f73f4b5be9bcfb3f9aed1df0105 Copying config sha256:4d0d2f262c72b58efb8f3795a5ca30c185025c78c98f0fb34b63e4b7e5eb983c Writing manifest to image destination Storing signatures Error: error creating network namespace for container d9e41dac8a7078fba899988c9fa784dc2d851cf5951e3a588306a7fdd26ef714: failed to create namespace: open /proc/14057/task/14116/ns/net: permission denied [2021-03-23T20:52:30.0581 CET] [info] Isotovideo exit status: 126

For now switching on again apparmor

Side-story of the day: For the whole day I have used a Microsoft Surface Go Tablet with pen and keyboard. Works nice so far :)

day 3

So, for the story of "web-based development tools" I thought: "What would be a possibility to run git rebase --interactive without needing a local console?" and then I found using . There is also . First I followed the tutorial covering Azure as I never worked with Azure. But the cloud shell (nice that one can select bash as well as PowerShell) needs persistent storage which costs something. For now I am exploring free options although the cost is rather minimal and I have "170 $" available in my Azure trial account and I am sure the cost for me or my employer SUSE for persistent storage in a personal cloud shell option would be negligible.

So over to . Seems like it has persistent storage without cost as I cloned a small repo from github in the cloudshell and after closing that and reopening on another computer the data was still there! is a mini-tutorial how one can add a link to a specific git project to immediately clone within a google cloudshell all behind a button that can be put into the web. I imagine this is something we could use in various projects, e.g. a "try out the openQA client here" link?

According to managing secrets incurs cost. Of course I don't want to save my password in cleartext in this environment. So following and I setup a dedicated github authentication token to be used instead of a password when authenticating against github.

As additional permissions I only selected "workflows" to be allowed for this token. Then within a google cloud shell session I did

git config --global --unset credential.helper git config --global credential.helper store git config --global "Oliver Kurz" git config --global "" git clone opensuse git remote add okurz git remote update git checkout -b hackweek_20 okurz/hackweek_20 git pull --rebase origin master git push okurz -f

which asked me for username ("okurz") and password, where I entered the token. All worked nicely so far :) This again triggered a new github action which in turn triggered an openQA job:

With this one can find a rapid development cycle that feels efficient enough, either using the editor component or just the bare shell, e.g. using vim and git command line tools. So I continued with the actual openQA test. First, I thought I might get something running using the perl test backend and the first problem I hit was that the test module file name "0ad" is causing a problem because perl wants to define a package with the same name but package names are only allowed to be non-numerical :D After every change I commit and push and refresh in a second browser tab.

By the way, I learned by clicking on the three-dot menu on top right of Cloud Shell that there is a weekly usage limit of 50h. Oh, and docker works as well, no podman though: docker run --rm -it mini/base

As 0ad is not in openSUSE:Factory I tried to install from the "games" repository but the installation fails on missing dependencies about libiuuc. Might be transient but anyway it's easier to select something that is part of Tumbleweed already. So switching to . After minor changes I have with e.g. the specific job that fails in with "no pak set found". I guess by default we do not follow recommends. zypper -n in --recommends simutrans also does not pull in recommends it seems. Likely we do not have a pak in Factory at all.

I also learned that one can run a web service on port 8080, then click the "Web Preview" button in top right and have an immediate access to a web service. So one can for example use commands like

docker run -p 8080:3000 -ti my/service_on_port_3000

then click "Web Preview" and "Preview on port 8080" and a browser tab opens pointing to that service

The cloud shell session is not persistent but the filesystem content seems to be. With that I can quickly reinstantiate something like an os-autoinst development environment:

echo 'sudo apt-get install -y libssh2-1-dev fftw-dev libfftw3-dev libtheora-dev libsndfile-dev libopencv-dev cpanminus && cd ~/os-autoinst && cpanm --installdeps --with-feature=test --with-feature=devel --with-recommends . && cpanm Carton && export PATH=~/perl5/bin:$PATH && export PERL5LIB=~/perl5/lib/perl5:$PERL5LIB && carton install && mkdir -p build.cmake && (cd build.cmake && cmake .. && make && sudo make symlinks) && carton exec -- prove -I. t/04-testapi-python.t' > ./test && bash ./test

only that cpanm does not seem to install dependencies for the "test" phase and such.

Switching to "wesnoth":

Recorded a video showing the develop+test cycle using Google Cloud Shell, github actions and openQA:

day 4

I am a bit limited in my time this week due to "sick child care" at home. However, would I could do: As the markdown rendering on seems to be … special at times, especially code and URL rendering, I was exploring alternatives. Following from my fellow team colleague I tried hugo on gitlab in but failed to publish anything on so far but experimented with which can be directly started from gitlab on a repo, nice. This is apparently using the same editor component as google Cloud Shell based on Visual Studio Code.

cdywan and mkittler joined me in for a nice mini-mob and we learned something about perl+python together :) I managed to run all os-autoinst tests within the Google Cloud Shell so also qemu runs fine. With this I could update for the os-autoinst change "Add python binding/import/wrapping code for testapi".´As the build of os-autoinst as well as docker runs nicely (fast download, fast build, qemu works) within Google Cloud Shell I tried out to run a test module with isotovideo and surprisingly managed to trigger a segfault :D

Trying to run a custom isotovideo container works like:

docker run --rm -it --pull=always -v ~/opensuse:/opt/opensuse /usr/bin/isotovideo -d casedir=/opt/opensuse schedule=tests/games/

shows that the container does not include the custom os-autoinst that it should have. I wonder if I should create another project and add that as repo.


During this hack week project due to some capacity constraints I focussed on the "web based development" part. I found that a development environment based on Google Cloud Shell can be very efficient and offers all what is commonly needed for the work where I feel the need for a terminal. Multiple alternatives exist. Also gitpod with its browser extension looks very good. A short video how the gitpod browser extension can be used together with github: . I can recommend any of the above solutions to anyone needing a terminal for free-software work from time to time from anywhere :) openQA support for python based test modules exists in . I deliberately kept the PR open to try out another feature to run a custom backend, including an os-autoinst version in a container. In theory that approach works but so far I have not yet found a convincing way how to control necessary permissions. This is something I would like to explore further and properly think about but I think we will find a convincing way. Then I failed to include my custom os-autoinst version in a container image built by OBS. For the actual openQA test after trying out for 0ad and simutrans I settled for wesnoth which so far is very simple, both in python code that I am not exactly sure if it will work as well as in stable perl code. .


Looking for hackers with the skills:

Nothing? Add some keywords!

This project is part of:

Hack Week 20


  • over 3 years ago: mkittler joined this project.
  • over 3 years ago: bchou liked this project.
  • over 3 years ago: cdywan liked this project.
  • over 3 years ago: mkittler liked this project.
  • over 3 years ago: ilausuch liked this project.
  • over 3 years ago: okurz started this project.
  • over 3 years ago: dancermak liked this project.
  • over 3 years ago: okurz originated this project.

  • Comments

    Be the first to comment!

    Similar Projects

    This project is one of its kind!