From 8a3b3e809205081e1350ec717c7008eed8f9e433 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Tue, 3 Jun 2025 15:26:29 +0200 Subject: [PATCH] CI: add test_systemd_stage0_version Add a test that ensures systemd-stage0 and systemd have the same pkgver. Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6440 [ci:skip-build]: already built successfully in CI --- .ci/testcases/test_systemd.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .ci/testcases/test_systemd.py diff --git a/.ci/testcases/test_systemd.py b/.ci/testcases/test_systemd.py new file mode 100644 index 000000000..e3b2f0474 --- /dev/null +++ b/.ci/testcases/test_systemd.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 +# Copyright 2025 Oliver Smith +# SPDX-License-Identifier: GPL-3.0-or-later +import logging +import os + +import pmb.parse +from pmb.core.context import get_context +from pathlib import Path + + +def test_systemd_stage0_version(): + """Ensure systemd-stage0 and systemd have the same pkgver.""" + # Don't clutter output with verbose APKBUILD parsing messages + logging.getLogger().setLevel(logging.DEBUG) + + config = get_context().config + pma_systemd = os.path.join(config.aports[0], "extra-repos/systemd") + + sd0 = pmb.parse.apkbuild(Path(os.path.join(pma_systemd, "systemd-stage0/APKBUILD"))) + sd1 = pmb.parse.apkbuild(Path(os.path.join(pma_systemd, "systemd/APKBUILD"))) + + assert sd0["pkgver"] == sd1["pkgver"], ( + f"systemd-stage0 pkgver ({sd0['pkgver']}) doesn't match systemd pkgver ({sd1['pkgver']})!" + )