@@ -48,6 +48,34 @@ def create_kernel_test(containerfile: str) -> ParameterSet:
48
48
)
49
49
50
50
51
+ # the commit hash and the download link for the sources need to be updated together
52
+ # there is no significance to the chosen hash, it is simple the tip of tree with the
53
+ # corresponding sources to fetch.
54
+ KMP_CONTAINER = create_kernel_test (
55
+ r"""WORKDIR /src
56
+ RUN set -euxo pipefail; \
57
+ curl -sf https://src.opensuse.org/pool/vhba-kmp/archive/f7b947967abfd854991eed3a50a333f2efa4c47932e3d7d2fc1d07c6afdb79bd.tar.gz | tar -xzf - ; \
58
+ cp -a vhba-kmp/* /usr/src/packages/SOURCES; cd /usr/src/packages/SOURCES ; \
59
+ curl -LO https://downloads.sf.net/cdemu/vhba-module-20240202.tar.xz ; \
60
+ rpmbuild -bb vhba-kmp.spec ; \
61
+ openssl req -new -x509 -newkey rsa:2048 -sha256 -keyout key.asc -out cert.der \
62
+ -outform der -nodes -days 4745 -addext "extendedKeyUsage=codeSigning" \
63
+ -subj "/CN=Donut Eat/" ; \
64
+ modsign-repackage -c ./cert.der -k ./key.asc /usr/src/packages/RPMS/$(uname -m)/vhba-kmp-default-*.rpm ; \
65
+ rpm -i --nodeps RPMS/$(uname -m)/vhba-kmp-default-*.rpm
66
+ """ ,
67
+ )
68
+
69
+
70
+ @pytest .mark .parametrize ("container" , [KMP_CONTAINER ], indirect = True )
71
+ def test_kmp_builds (container : ContainerData ) -> None :
72
+ """Test that we can build a SUSE Kernel Module Package with signed modules."""
73
+
74
+ assert "Donut Eat" in container .connection .check_output (
75
+ "modinfo /lib/modules/*-default/updates/vhba.ko"
76
+ )
77
+
78
+
51
79
@pytest .mark .skipif (
52
80
OS_VERSION in ("16.0" ,),
53
81
reason = "can't install additional packages yet on 16" ,
0 commit comments