Skip to content

Commit be42f2c

Browse files
KernelGhostanbe42
authored andcommitted
Add test case for module signing failure
1 parent 6b1e4d3 commit be42f2c

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

run_test.sh

+14
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,20 @@ Certificate file /no/such/path.crt not found and can't be generated, modules won
765765
766766
Cleaning build area... done.
767767
Building module(s)... done.
768+
Cleaning build area... done.
769+
EOF
770+
771+
echo 'Building the test module with a failing sign_file command'
772+
cp test/framework/fail_sign_file_path.conf /etc/dkms/framework.conf.d/dkms_test_framework.conf
773+
run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_test -v 1.0 --force << EOF
774+
Sign command: /bin/false
775+
Signing key: /tmp/dkms_test_private_key
776+
Public certificate (MOK): /tmp/dkms_test_certificate
777+
778+
Cleaning build area... done.
779+
Building module(s)... done.
780+
${SIGNING_MESSAGE}Warning: Failed to sign module '/var/lib/dkms/dkms_test/1.0/build/dkms_test.ko'!
781+
768782
Cleaning build area... done.
769783
EOF
770784
rm /tmp/dkms_test_private_key
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sign_file="/bin/false"
2+
mok_signing_key="/tmp/dkms_test_private_key"
3+
mok_certificate="/tmp/dkms_test_certificate"

0 commit comments

Comments
 (0)