Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test SUSE KMP building with the kernel-module devel #676

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 - ; \
dirkmueller marked this conversation as resolved.
Show resolved Hide resolved
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 ; \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fails on SLES 16 with:

2.118 + rpmbuild -bb vhba-kmp.spec
2.242 error: Failed build dependencies:
2.242 	suse-kernel-rpm-scriptlets is needed by vhba-kmp-20240202-0.x86_64

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dcermak yes, thats why there is a PR fixing it for 3 weeks waiting for review here: SUSE/BCI-dockerfile-generator#2017

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/*/vhba.ko"
)


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