Commit Graph

21 Commits

Author SHA1 Message Date
Oliver Smith d38bd6be2b
CI: drop support for cached venv + ci runner (MR 2080)
CI started failing with:
/builds/ollieparanoid/pmbootstrap/venv/bin/python3: No module named pytest

I've briefly tried to fix this with the existing scripts. However,
instead of investing more time into that, do the long overdue
refactoring of the scripts that involve dropping the venv logic and
support for a custon gitlab-ci-runner using some python docker image as
base. This configuration hasn't been used for a long time and is
probably broken anyway.

Refactor the logic to skip the qemu test case in gitlab CI by using
pytest markers. The new script is now similar to bpo's .ci/pytest.py.
2021-07-04 22:51:53 +02:00
Caio Fontes 27746db188
enforce E501 in test/ (MR 2058) 2021-06-06 19:21:31 +02:00
Oliver Smith 1c791da482
treewide: bump copyright to 2021 2021-01-07 23:30:47 +01:00
Ralf Rachinger 72e24f7f96
Use $XDG_CONFIG_HOME instead of hardcoded path (MR 1969) 2020-08-23 13:51:42 +02:00
Minecrell 181687a2d7
test: test_qemu_running_processes: ensure "none" UI boots correctly (!1911)
No special process needs to be running, SSH is good already :)
2020-04-11 20:56:57 +02:00
Minecrell 903491f518
test/test_qemu_running_processes: use Alpine virt kernel (!1886)
The QEMU device ports no longer make use of the linux-postmarketos-
stable/mainline kernels, causing the test to fail with

  RuntimeError: Selected kernel (stable) is not configured for device qemu-amd64.
  Please run 'pmbootstrap init' to select a valid kernel.

Let's configure the test to use the "virt" kernel.
2020-03-14 08:05:32 +01:00
Minecrell 345425ef48
test/test_qemu_running_processes: make timeout actually work (!1886)
Just counting the number of tries does not prevent the QEMU tests
from running long periods of time. In some situations, the ssh command
will keep trying to reach the destination almost indefinitely.

To make the 5 minutes timeout work correctly we need to:
  - Add an appropriate ConnectTimeout to the ssh command
  - Don't sleep for another second if ssh already took several seconds
  - Check the elapsed time instead of setting a fixed amount of tries
2020-03-14 08:05:32 +01:00
Minecrell 320b2faa4c
pmb.qemu: remove QEMU mesa driver setup question (!1886)
mesa-dri-swrast and mesa-dri-virtio are both provided by mesa-dri-gallium
now, so this option does not have much use anymore. With both selections,
exactly the same packages are installed.
2020-03-14 08:05:32 +01:00
Oliver Smith f21c216a26
Cosmetic: use SPDX license header (!1877)
While at it, also remove unnecessary "#!/usr/bin/env python3" in files
that only get imported, and adjust other empty/comment lines in the
beginnings of the files for consistency.

This makes files easier to read, and makes the pmbootstrap codebase more
consistent with the build.postmarketos.org codebase.
2020-02-24 03:11:10 +03:00
Oliver Smith e605a0af32
test/pmb_test: prepare for common test code (!1876)
Replace the "Add topdir to import path" boilerplate lines in each test
file with a simple "import pmb_test". Use the "# noqa" comment if
"pmb_test" is not used further in the test file, so flake8 does not
complain about an unused module.

Make the path to the testdata available as pmb_test.const.testdata, and
use pmb.config.pmb_src to access the topdir in all tests.

This is in preparation for new "pmbootstrap status" related tests, which
will have shared test code in test/pmb_test/. Also, this makes the
pmbootstrap codebase more consistent with the bpo codebase, which has a
similar "import bpo_test" mechanism.
2020-02-24 03:01:04 +03:00
Oliver Smith 948e3f931f
Change copyright to 2020 2020-01-06 02:43:00 +01:00
Luca Weiss 2ad8b66ccc
Fix case sensitivity: Qemu => QEMU (!1800) 2019-07-05 20:27:12 +02:00
Idan Horo fd79a60383
pmbootstrap install: make --no-fde default (!1798)
Implement --fde, add deprecation warning to --no-fde, update related
help files and tests.
2019-07-05 20:04:10 +02:00
Oliver Smith d604ebd8fe
test_qemu_running_processes: wait 5 min, not 3 (!1799)
Be more patient with waiting for processes to start up. From looking at
the logs, it seems that the only reason CI was failing is because we did
not wait long enough.
2019-07-03 22:22:59 +02:00
Oliver Smith f26eb0d9b8
Qemu test: use pmbootstrap --details-to-stdout (!1785)
The qemu test executes a pmbootstrap instance with
pmb.helpers.run.user(). Use the --details-to-stdout flag from now on for
the started pmbootstrap process, so it is not silent when downloading
packages with apk, and will therefore not run into the timeout of the
parent process (which kills processes that are silent for more than five
minutes by default).

This fixes the test in our CI infrastructure.
2019-05-16 23:39:03 +02:00
Oliver Smith 424ad3f078 tests import path: put shipped pmb code first
Always test the pmb code from the parent folder of the tests, even if
a stable version of pmbootstrap is installed with pip or pysetup.
2018-11-12 07:05:22 +00:00
Oliver Smith 0d7802d7ef
s/system partition/rootfs: fix remaining mentions
Follow-up to !1373, where `pmbootstrap flasher flash_system` was
replaced with `pmbootstrap flasher flash_rootfs`. We still had used
terms like "system partition" in a lot of places.

This commit replaces it everywhere, so it's clear that we're talking
about the pmOS rootfs (which may or may not be installed to Android's
system partition).
2018-07-15 23:41:31 +02:00
Oliver Smith 8268dc0e3d pmbootstrap: kill process if silent for 5 minutes (rewrite logging) 2018-07-14 01:13:28 +00:00
Oliver Smith 796668d7df More obvious test failure messages for QEMU test
If the test case couldn't connect to the VM with SSH, it used to fail
with a Python error of accessing the 'missing' variable without having
it defined.

With this commit, it prints out 'Could not connect to the VM via SSH'
instead.
2018-07-11 19:37:06 +00:00
Oliver Smith 2a096e6a56
Qemu test case: wait dynamically until booted (#1330)
We have a test case, that performs full installations with with XFCE4
and Plasma Mobile. After each installation is through, we run
"pmbootstrap qemu" and connect to the VM via SSH to check for specific
running processes.

Before this commit, we assumed that the boot takes 90 seconds at most
and then the processes should exist. But sometimes the boot is faster
(so Travis waits just doing nothing) and sometimes it is slower (which
causes the test case to fail), all depending on the current workload
of the Travis CI servers. Now we try to find the processes we're
interested in each second for 3 minutes until we either succeed or
reach the time limit.
2018-03-14 21:24:13 +00:00
Oliver Smith 5e85d72ca0
Testsuite: Run UIs in Qemu and check running processes and more (#982)
* Testsuite: Run UIs in Qemu and check running processes (and other changes)

* When `pmbootstrap qemu` gets killed, it now takes down the Qemu process with it
* `test/check_checksums.py` got a new optional `--build` parameter, which makes
  it build all changed packages instead of just checking the checksums
* We run this before running the testsuite now, so all changed packages get
  built before running tests (otherwise tests would hang without any output
  while a changed package is building)
* New testcase, that zaps all chroots, installs a specific UI (xfce4 and
  plasma-mobile currently, easy to extend), runs it via Qemu and checks the
  running processes via SSH.
* Version checking testcase: rewritten to include Alpine's testsuite file in
  our source tree, so we don't need to clone their git repo anymore. Now it
  is enabled for Travis.
* All this gives us a nice 10% code coverage boost
* Increased the `hello-world` pkgrel to verify that the Travis job is working.

* Various fixes
* Build device-packages for the device arch and don't raise an
  exception, but print a note if --ignore-depends is not specified
  and therefore the kernel gets installed, too.
* Don't use --force when building in Travis (because abuild doesn't
  check the checksums then. Bug report on the way.)
* Don't run the building process in the background, but wait for its
  completion
* Exit with 1 when showing usage in check_checksums.py
2018-02-02 00:16:29 +00:00