Skip to content

Commit e74939b

Browse files
committed
sbchooser: test --first-sig-only
This test submits the following shims, each listed twice, in a random order: shim-16.1-4.el10.x64.msft2011.efi shim-16.1-4.el10.x64.msft2011.msft2023.efi shim-16.1-4.el10.x64.msft2023.efi Against a "db" which includes: The 2023 UEFI CA cert This test puts "--first-sig-only" on the sbchooser command line, so all but the first signature on each input should be ignored. This should produce the following output (annotated here): shim-16.1-4.el10.x64.msft2023.efi - allowed by 2023 cert shim-16.1-4.el10.x64.msft2023.efi - same Note that shim-16.1-4.el10.x64.msft2011.msft2023.efi is not included, because its first signature is with the 2011 cert. Signed-off-by: Peter Jones <pjones@redhat.com>
1 parent b2d911b commit e74939b

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

tests/Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ TESTS = test.dmpstore.export \
2323
test.sbchooser.sha512.vs.db \
2424
test.sbchooser.db.vs.dbx \
2525
test.sbchooser.identical.secbits \
26+
test.sbchooser.first.sig.only \
2627

2728
all: clean $(TESTS)
2829

@@ -420,6 +421,29 @@ test.sbchooser.identical.secbits:
420421
$(quiet)rm -f test.sbchooser.identical.secbits.result
421422
$(quiet)echo passed
422423

424+
test.sbchooser.first.sig.only.result:
425+
$(quiet)ls -1 shim-16.1-4.el10.x64.msft2011.efi \
426+
shim-16.1-4.el10.x64.msft2011.msft2023.efi \
427+
shim-16.1-4.el10.x64.msft2023.efi \
428+
shim-16.1-4.el10.x64.msft2011.efi \
429+
shim-16.1-4.el10.x64.msft2011.msft2023.efi \
430+
shim-16.1-4.el10.x64.msft2023.efi \
431+
| sort -R | LD_LIBRARY_PATH=../src ../src/sbchooser -d db.msft2023 \
432+
--no-system-dbx \
433+
--first-sig-only \
434+
> "$@"
435+
436+
test.sbchooser.first.sig.only:
437+
$(quiet)echo testing sbchooser sorting with only the first signature
438+
$(quiet)$(MAKE) --quiet test.sbchooser.first.sig.only.result
439+
$(quiet)if ! cmp test.sbchooser.first.sig.only.goal.txt test.sbchooser.first.sig.only.result ; then \
440+
diff -U 200 test.sbchooser.first.sig.only.goal.txt test.sbchooser.first.sig.only.result ; \
441+
exit 1 ; \
442+
fi
443+
$(quiet)cmp test.sbchooser.first.sig.only.goal.txt test.sbchooser.first.sig.only.result
444+
$(quiet)rm -f test.sbchooser.first.sig.only.result
445+
$(quiet)echo passed
446+
423447
.PHONY: all clean $(TESTS)
424448

425449
# vim:ft=make
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
shim-16.1-4.el10.x64.msft2023.efi
2+
shim-16.1-4.el10.x64.msft2023.efi

0 commit comments

Comments
 (0)