summaryrefslogtreecommitdiff
path: root/tests/lib/Makefile.inc
diff options
context:
space:
mode:
authorJakub Czapiga <jacz@semihalf.com>2021-07-22 08:52:46 +0200
committerJulius Werner <jwerner@chromium.org>2021-09-02 00:31:02 +0000
commit6f3fd6358f605c181f958ded9ef92803cec172fd (patch)
treec9c9a79bcf6d8c2837c686f8b966395eba5e8ef0 /tests/lib/Makefile.inc
parent6813d561b2fcd89e0df23a3c41843433767edec3 (diff)
tests: Add lib/cbfs-verification-test test case
This commit adds test case for lib/cbfs verification mechanisms. Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Change-Id: I1d8cbb1c2d0a9db3236de065428b70a9c2a66330 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56601 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'tests/lib/Makefile.inc')
-rw-r--r--tests/lib/Makefile.inc32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/lib/Makefile.inc b/tests/lib/Makefile.inc
index 45cef1b4ca..44679eb08a 100644
--- a/tests/lib/Makefile.inc
+++ b/tests/lib/Makefile.inc
@@ -32,6 +32,10 @@ tests-y += spd_cache-ddr3-test
tests-y += spd_cache-ddr4-test
tests-y += cbmem_stage_cache-test
tests-y += libgcc-test
+tests-y += cbfs-verification-no-sha512-test
+tests-y += cbfs-verification-has-sha512-test
+tests-y += cbfs-no-verification-no-sha512-test
+tests-y += cbfs-no-verification-has-sha512-test
string-test-srcs += tests/lib/string-test.c
string-test-srcs += src/lib/string.c
@@ -176,3 +180,31 @@ cbmem_stage_cache-test-srcs += src/lib/imd.c
cbmem_stage_cache-test-config += CONFIG_CBMEM_STAGE_CACHE=1
libgcc-test-srcs += tests/lib/libgcc-test.c
+
+# CBFS varification tests are compiled with CONFIG_CBFS_VERIFICATION
+# and VB2_SUPPORT_SHA512 set and unset. Code should work with and without
+# verification and with hash structure of different sizes.
+cbfs-verification-no-sha512-test-stage := bootblock
+cbfs-verification-no-sha512-test-srcs := tests/lib/cbfs-verification-test.c \
+ tests/stubs/console.c \
+ tests/stubs/die.c \
+ tests/mock/cbfs_file_mock.c \
+ src/lib/cbfs.c \
+ src/commonlib/bsd/cbfs_private.c \
+ src/commonlib/mem_pool.c \
+ src/commonlib/region.c
+cbfs-verification-no-sha512-test-mocks += cbfs_get_boot_device cbfs_lookup
+cbfs-verification-no-sha512-test-config += CONFIG_COLLECT_TIMESTAMPS=0 \
+ CONFIG_CBFS_VERIFICATION=1 \
+ CONFIG_NO_CBFS_MCACHE=1 \
+ VB2_SUPPORT_SHA512=0
+
+$(call copy-test,cbfs-verification-no-sha512-test,cbfs-verification-has-sha512-test)
+cbfs-verification-has-sha512-test-config += VB2_SUPPORT_SHA512=1
+
+$(call copy-test,cbfs-verification-no-sha512-test,cbfs-no-verification-no-sha512-test)
+cbfs-no-verification-no-sha512-test-config += CONFIG_CBFS_VERIFICATION=0
+
+$(call copy-test,cbfs-verification-no-sha512-test,cbfs-no-verification-has-sha512-test)
+cbfs-no-verification-has-sha512-test-config += CONFIG_CBFS_VERIFICATION=0 \
+ VB2_SUPPORT_SHA512=1