commit | 3dec744ea65174c71d46c7f38b8154eaa25eddc8 | [log] [tgz] |
---|---|---|
author | Jerome Forissier <jerome.forissier@linaro.org> | Wed Jan 30 17:50:05 2019 +0100 |
committer | Jérôme Forissier <jerome.forissier@linaro.org> | Thu Jan 31 13:19:57 2019 +0100 |
tree | 269b58a1f4e593602521f292b3552d05c51018b3 | |
parent | 52c67e89bb5f39eef4e2fb70490155d906a3116f [diff] |
regression: 4002: run MAC tests in multiple increments The .in_incr field of struct xtest_mac_case is currently used for a single step, that is, update() is called to process in_incr byte, then the rest of the input buffer is passed to final(). This commit allows to run the CBC MAC update() several times in chunks of in_incr bytes, then the remaining bytes in the input buffer (<= in_incr) are passed to final(). All MAC tests that have a non-zero increment (.in_incr) are now run twice: first in two steps, then in multiple steps of in_incr size. This is a test case for [1]. Link: [1] https://github.com/OP-TEE/optee_os/pull/2779 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
The optee_test git contains the source code for the TEE sanity testsuite in Linux using the ARM(R) TrustZone(R) technology. It is distributed under the GPLv2 and BSD 2-clause open-source licenses. For a general overview of OP-TEE, please see the Notice.md file.
The client applications (optee_test/host/*
) are provided under the GPL-2.0 license. The user TAs (optee_test/ta/*
) are provided under the BSD 2-Clause license.
xtest test suite comes with a standard test suite, freely available. When installing OP-TEE through the manifest, the build component provides the xtest
target which builds optee_test. It makes use of the following environment variables:
CROSS_COMPILE_HOST
: the cross compiler used to compile the Non-Secure Client Application (host/xtest
)CROSS_COMPILE_TA
: the cross compiler used to compile the Trusted Applications (ta
)TA_DEV_KIT_DIR
: the path to the Trusted Application Dev Kit. It can be found in optee_os repository, once optee_os has been compiled.O
: the output repositoryDevelopers can purchase the Global Platform Compliance Test suite. This test suite comes with .xml files describing the tests and the Trusted Applications.
Standard tests can be extended with the Global Platform test suite. The user must only:
xml
files in $CFG_GP_PACKAGE_PATH
make patch
(or call make xtest-patch
from the build
repository) before compiling xtest. This must be run a single time after the installation of OP-TEE.This will:
ta/GP_xxx
host/xtest
, as for example xtest_9000.c
xtest_7000.c
, adding new tests.Then the tests must be compiled with CFG_GP_PACKAGE_PATH=<path>
.
It makes use of the following environment variable:
COMPILE_NS_USER
: 32
or 64
if application shall be compiled in 32 bits mode on in 64 bits mode. If COMPILE_NS_USER
is not specificed, build relies on CFG_ARM32_core=y
from OP-TEE core build to assume applications are in 32 bits mode, Otherwise, 64 bits mode is assumed.# all xtest boot and execute on your target $ ifconfig lo 127.0.0.1 $ tee-supplicant & $ xtest # single xtest boot and execute on your target $ ifconfig lo 127.0.0.1 $ tee-supplicant & $ xtest <testnumber> (i.e.: xtest 1001) # family xtest (i.e.: Family 1000) boot and execute on your target $ ifconfig lo 127.0.0.1 $ tee-supplicant & $ xtest _<family> (i.e.: xtest _1) # running all benchmarks (secured storage, aes/sha) boot and execute on your target $ tee-supplicant & $ xtest -t benchmark # running single benchmark boot and execute on your target $ tee-supplicant & $ xtest -t benchmark <benchmark_number> (i.e. xtest 2001)
It's also possible to run SHA/AES benchmarks by using sha-perf/aes-perf modules within xtest. These modules allow to run custom benchmarks with user-defined params.
# running sha-perf with default params boot and execute on your target $ tee-supplicant & $ xtest --sha-perf # getting usage details and list of possible options for sha-perf $ xtest --sha-perf -h
To be able to see the full command when building you could build using following flag:
$ make V=1
To state where build files are stored use the O
flag.
$ make O=$HOME/foo
By default optee_test
expects that optee_client
is located at the same folder level. However if you build optee_client in another location, then you also would need to use (or export) the following flag:
$ make OPTEE_CLIENT_EXPORT=$HOME/my_new_location/out/export
In this project we are trying to adhere to the same coding convention as used in the Linux kernel (see CodingStyle). We achieve this by running checkpatch from Linux kernel. However there are a few exceptions that we had to make since the code also follows GlobalPlatform standards. The exceptions are as follows:
Since checkpatch is licensed under the terms of GNU GPL License Version 2, we cannot include this script directly into this project. Therefore we have written the Makefile so you need to explicitly point to the script by exporting an environment variable, namely CHECKPATCH. So, suppose that the source code for the Linux kernel is at $HOME/devel/linux
, then you have to export like follows:
$ export CHECKPATCH=$HOME/devel/linux/scripts/checkpatch.pl
thereafter it should be possible to use one of the different checkpatch targets in the Makefile. There are targets for checking all files, checking against latest commit, against a certain base-commit etc. For the details, read the Makefile.