pmaports/.gitlab-ci/testcases/test_kernel.py
Alexey Minnekhanov 33c62a1f58
CI: fix broken test_aports_kernel (MR 2272)
Missing '/' in aports path will make glob below invalid.
It will find 0 files and thus effectively skip all tests.
Construct full path using f-strings.

Double '/' in path that can be there if args.aports ends
with slash is harmless.
2021-06-25 18:42:11 +03:00

24 lines
619 B
Python

#!/usr/bin/env python3
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import pytest
import sys
import os
import add_pmbootstrap_to_import_path
import pmb.parse
def test_aports_kernel(args):
"""
Various tests performed on the /**/linux-* aports.
"""
for path in glob.iglob(f"{args.aports}/**/linux-*/APKBUILD", recursive=True):
apkbuild = pmb.parse.apkbuild(args, path)
if "pmb:cross-native" not in apkbuild["options"]:
raise RuntimeError("\"pmb:cross-native\" missing in"
f" options= line: {path}")