Skip to content

Commit

Permalink
Test SUSE KMP building with the kernel-module devel
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmueller committed Dec 3, 2024
1 parent 7fae3a3 commit 35f6abd
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/test_kernel_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,34 @@ def create_kernel_test(containerfile: str) -> ParameterSet:
)


# the commit hash and the download link for the sources need to be updated together
# there is no significance to the chosen hash, it is simple the tip of tree with the
# corresponding sources to fetch.
KMP_CONTAINER = create_kernel_test(
r"""WORKDIR /src
RUN set -euxo pipefail; \
curl -sf https://src.opensuse.org/pool/vhba-kmp/archive/f7b947967abfd854991eed3a50a333f2efa4c47932e3d7d2fc1d07c6afdb79bd.tar.gz | tar -xzf - ; \
cp -a vhba-kmp/* /usr/src/packages/SOURCES; cd /usr/src/packages/SOURCES ; \
curl -LO https://downloads.sf.net/cdemu/vhba-module-20240202.tar.xz ; \
rpmbuild -bb vhba-kmp.spec ; \
openssl req -new -x509 -newkey rsa:2048 -sha256 -keyout key.asc -out cert.der \
-outform der -nodes -days 4745 -addext "extendedKeyUsage=codeSigning" \
-subj "/CN=Donut Eat/" ; \
modsign-repackage -c ./cert.der -k ./key.asc /usr/src/packages/RPMS/$(uname -m)/vhba-kmp-default-*.rpm ; \
rpm -i --nodeps RPMS/$(uname -m)/vhba-kmp-default-*.rpm
""",
)


@pytest.mark.parametrize("container", [KMP_CONTAINER], indirect=True)
def test_kmp_builds(container: ContainerData) -> None:
"""Test that we can build a SUSE Kernel Module Package with signed modules."""

assert "Donut Eat" in container.connection.check_output(
"modinfo /lib/modules/*-default/updates/vhba.ko"
)


@pytest.mark.skipif(
OS_VERSION in ("16.0",),
reason="can't install additional packages yet on 16",
Expand Down

0 comments on commit 35f6abd

Please sign in to comment.