Skip to content
Snippets Groups Projects
Commit 68a25e0b authored by Jens Wiklander's avatar Jens Wiklander Committed by Jérôme Forissier
Browse files

Add support for gp-suite in optee_test


By passing GP_PACKAGE=<path to GP-suite archive> optee_test is
configured to compile with the GlobalPlatform test suite. The test suite
is unpacked and patched in the build directory as part of the buildroot
process when building optee_test.

Acked-by: default avatarJoakim Bech <joakim.bech@linaro.org>
Acked-by: default avatarJerome Forissier <jerome@forissier.org>
Signed-off-by: default avatarJens Wiklander <jens.wiklander@linaro.org>
parent 38cc5a8c
No related branches found
Tags 3.13.0-rc1
No related merge requests found
......@@ -24,4 +24,17 @@ config BR2_PACKAGE_OPTEE_TEST_EXT_CROSS_COMPILE
help
some help
config BR2_PACKAGE_OPTEE_TEST_EXT_GP_PACKAGE
string "GP package"
default ""
help
Path to the GlobalPlatform package containing description files
and TAs needed to build the complete GP test suite. The package
is free for GP members, but can be acquired directly from
GlobalPlatform for non-members. See
https://globalplatform.org/test-suites/tee-initial-configuration-test-suite-with-excluded-tests-list/
The name of the package is currently "TEE Initial Configuration
Test Suite with Excluded Tests List v2.0.0.2" with the file name
TEE_Initial_Configuration-Test_Suite_v2_0_0_2-2017_06_09.7z
endif
......@@ -10,6 +10,16 @@ OPTEE_TEST_EXT_CONF_OPTS = -DOPTEE_TEST_SDK=$(OPTEE_TEST_EXT_SDK)
OPTEE_TEST_EXT_TAS = os_test_lib os_test_lib_dl os_test *
uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
ifneq ($(BR2_PACKAGE_OPTEE_TEST_EXT_GP_PACKAGE),"")
OPTEE_TEST_EXT_CONF_OPTS += -DWITH_GP_TESTS=1
OPTEE_TEST_EXT_PRE_CONFIGURE_HOOKS += OPTEE_TEST_EXT_PREPARE_GP_SUITE
endif
define OPTEE_TEST_EXT_PREPARE_GP_SUITE
sh $(@D)/host/xtest/gp/prepare_suite.sh $(@D) \
$(BR2_PACKAGE_OPTEE_TEST_EXT_GP_PACKAGE)
endef
define OPTEE_TEST_EXT_BUILD_TAS
@$(foreach f,$(call uniq,$(foreach t,$(OPTEE_TEST_EXT_TAS),$(wildcard $(@D)/ta/$(t)/Makefile))), \
echo Building $f && \
......@@ -27,7 +37,27 @@ define OPTEE_TEST_EXT_INSTALL_TAS
&&) true
endef
define OPTEE_TEST_EXT_BUILD_GP_TAS
@$(foreach f,$(wildcard $(shell echo $(@D)/host/xtest/gp-suite/TTAs_Internal_API_1_1_1/*/*/{*/,}code_files/Makefile)), \
echo Building $f && \
$(MAKE) CROSS_COMPILE="$(shell echo $(BR2_PACKAGE_OPTEE_TEST_EXT_CROSS_COMPILE))" \
O=out TA_DEV_KIT_DIR=$(OPTEE_TEST_EXT_SDK) \
$(TARGET_CONFIGURE_OPTS) -C $(dir $f) all &&) true
endef
define OPTEE_TEST_EXT_INSTALL_GP_TAS
@$(foreach f,$(wildcard $(shell echo $(@D)/host/xtest/gp-suite/TTAs_Internal_API_1_1_1/*/*/{*/,}code_files/out/*.ta)), \
mkdir -p $(TARGET_DIR)/lib/optee_armtz && \
$(INSTALL) -v -p --mode=444 \
--target-directory=$(TARGET_DIR)/lib/optee_armtz $f \
&&) true
endef
OPTEE_TEST_EXT_POST_BUILD_HOOKS += OPTEE_TEST_EXT_BUILD_TAS
OPTEE_TEST_EXT_POST_BUILD_HOOKS += OPTEE_TEST_EXT_BUILD_GP_TAS
OPTEE_TEST_EXT_POST_INSTALL_TARGET_HOOKS += OPTEE_TEST_EXT_INSTALL_TAS
OPTEE_TEST_EXT_POST_INSTALL_TARGET_HOOKS += OPTEE_TEST_EXT_INSTALL_GP_TAS
$(eval $(cmake-package))
......@@ -265,6 +265,7 @@ BR2_PACKAGE_OPTEE_TEST_EXT ?= y
BR2_PACKAGE_OPTEE_TEST_EXT_CROSS_COMPILE ?= $(CROSS_COMPILE_S_USER)
BR2_PACKAGE_OPTEE_TEST_EXT_SDK ?= $(OPTEE_OS_TA_DEV_KIT_DIR)
BR2_PACKAGE_OPTEE_TEST_EXT_SITE ?= $(OPTEE_TEST_PATH)
BR2_PACKAGE_OPTEE_TEST_EXT_GP_PACKAGE := $(GP_PACKAGE)
BR2_PACKAGE_STRACE ?= y
BR2_TARGET_GENERIC_GETTY_PORT ?= $(if $(CFG_NW_CONSOLE_UART),ttyAMA$(CFG_NW_CONSOLE_UART),ttyAMA0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment