Commit graph

246 commits

Author SHA1 Message Date
Leandro Pereira c0e9519d2e tests: crypto: Fix ccm_mode test after updating TinyCrypt to 0.2.7
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-01 10:35:06 -04:00
Inaky Perez-Gonzalez 3d498dd10c build: workaround build bug in tests
When an app uses a construct such as:

obj-y = main.o ../../../../samples/bluetooth/gatt/hrs.o

in its makefile, it causes said object module to be built in the
source tree, not in the object tree.

When building massively parallel, this usually resuls on the files
getting corrupted, leading to bugs such as:

https://jira.zephyrproject.org/browse/ZEP-2316
https://jira.zephyrproject.org/browse/ZEP-2317

src/../../../../samples/bluetooth/gatt/.gap.o.cmd:3: warning: NUL character seen; rest of line ignored
src/../../../../samples/bluetooth/gatt/.gap.o.cmd:4: warning: NUL character seen; rest of line ignored
src/../../../../samples/bluetooth/gatt/.gap.o.cmd:5: *** missing separator.  Stop.

as multiple build are trying to touch the same file in the source tree
and of course, race and causes a build bug.

We have known about this issue for a long time, but it requires
modifications in the build system that there is no time to tackle.

A suggested workaround is to include the source files into a local .c
file, so this is what this patch does, to remove the random noise.

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-07-27 14:09:40 -04:00
Anas Nashif 5f63386c34 tests: crypto: fix coding style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-06 10:34:41 -05:00
Kumar Gala 8f77cddc77 tests: crypto: sha256: limit to systems with >48k of memory
We fail to build this test on stm32f3_disco which has 40k of SRAM.
Bump up the min_ram requirement to 48k.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-06 09:53:00 -05:00
Anas Nashif 8d108c9d59 tests: mbedtls: cleanup prj.conf
Remove platform specific option CONFIG_ARC_INIT and a copy/pasted
comment with "#nothing here".

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Anas Nashif 52a4916cab tests: crypto: do not build when DEBUG is enabled
The external mbedTLS library seems to have some issues when DEBUG is
enabled, so disable this here becauase we will not change external 3rd
party code.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Anas Nashif 882c19ddbc tests: remove build_only tag
build_only is set to false by default, so remove it.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Jean-Paul Etienne b31b41604e tests: crypto: include back riscv32 arch for ecc_dh, ecc_dsa and mbedtls
Issue fixed by commit "riscv32: fixed context restore upon exiting ISR"

Jira: ZEP-2020

Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-06-30 06:31:51 -04:00
Anas Nashif d1e562c924 tests: replace filters in testcase files
Where possible, replace the use of filter with newly added keywords.
This will speed things up and in some cases add more coverage due to bad
filters.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-28 09:51:40 -05:00
Anas Nashif 470c5f3189 tests: remove testcase.ini files
We now use yaml files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Anas Nashif cc24f4b03c tests: samples: convert testcase files to yaml
This will prepare test cases and samples with metadata and information
that will be consumed by the sanitycheck script which will be changed to
parse YAML files instead of ini.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Anas Nashif 397d29db42 linker: move all linker headers to include/linker
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-18 09:24:04 -05:00
Anas Nashif 2d1ac45f01 tests: rename test directory test_sha256 -> sha256
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif 0772abff24 tests: rename test directory test_mbedtls -> mbedtls
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif 38fca5cb5d tests: rename test directory test_hmac_prng -> hmac_prng
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif abaa5cb42f tests: rename test directory test_hmac -> hmac
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif 4ce66b728f tests: rename test directory test_ecc_dh -> ecc_dh
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif dfe3195db8 tests: rename test directory test_ecc_dsa -> ecc_dsa
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif d8dfdceb65 tests: rename test directory test_ctr_prng -> ctr_prng
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif 3c3aac9e44 tests: rename test directory test_ctr_mode -> ctr_mode
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif e10e013082 tests: rename test directory test_cmac_mode -> cmac_mode
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif 99b8dc0534 tests: rename test directory test_ccm_mode -> ccm_mode
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif 2d1a4a1284 tests: rename test directory test_cbc_mode -> cbc_mode
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif f18ef22824 tests: rename test directory test_aes -> aes
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Anas Nashif 1084bd5ed3 tests: crypto: reduce high timeout value
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-01 09:37:34 -04:00
Kumar Gala eaaa175b92 tests: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.

Jira: ZEP-2051

Change-Id: I6c676bc6c5e850a8725785554cd535e32067f33e
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 09:53:49 -05:00
Kumar Gala 789081673f Introduce new sized integer typedefs
This is a start to move away from the C99 {u}int{8,16,32,64}_t types to
Zephyr defined u{8,16,32,64}_t and s{8,16,32,64}_t.  This allows Zephyr
to define the sized types in a consistent manor across all the
architectures we support and not conflict with what various compilers
and libc might do with regards to the C99 types.

We introduce <zephyr/types.h> as part of this and have it include
<stdint.h> for now until we transition all the code away from the C99
types.

We go with u{8,16,32,64}_t and s{8,16,32,64}_t as there are some
existing variables defined u8 & u16 as well as to be consistent with
Zephyr naming conventions.

Jira: ZEP-2051

Change-Id: I451fed0623b029d65866622e478225dfab2c0ca8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-20 16:07:08 +00:00
Andrew Boie 2d9a559df8 tests: crypto: enable on other arches
Some tests have large RAM requirements, appropriate filters added.
Redundant 'build_only = false' removed.

Issue: ZEP-1721
Change-Id: Id8b06b2ea8a63cf19cf155a75f1513810c383521
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-18 20:51:39 +00:00
Anas Nashif 4c80a2fb71 tests: crypto: disable 2 tests that are ridiculously slow
Change-Id: I54194c06a1f3dfe1412dbfff50e9866134cf881a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-14 10:42:29 -04:00
Andrew Boie a313353344 xtensa: re-enable tinycrypt test cases
Tinycrypt 0.2.6 fixed the issue with the definition of 'bool'.

Issue: ZEP-1722
Change-Id: Ie470e25dfe02a58d9c3f2324cab85bc02f574b51
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-12 16:32:29 +00:00
ethan gao 8e22350651 tests: add AES cmac test to mbedtls test
it covers the story "Port AES-CMAC-PRF-128 [RFC 4615]
encryption library for Thread support"

ZEP-734

Change-Id: I6213309b51da435060c3e3cfadde67e21a927b2b
Signed-off-by: ethan gao <ethan.gao@intel.com>
2017-04-12 05:49:11 +00:00
Flavio Santes c3f79e1d46 test/crypto: Update ECC DSA test case
The ECC DSA test case was updated in TinyCrypt 0.2.6.

Fix the length of the random vector.

Change-Id: I7545a51c6855959afdefe00a1e0b53e5c3001a7c
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-25 15:42:13 +00:00
Flavio Santes 3692aed6a8 test/crypto: Update ECC DH test case
The ECC DH test case was updated in TinyCrypt 0.2.6.

This patch adds two helper arrays for the Monte Carlo routine.

Change-Id: If28292512b351feffc3fe470942cd97b18851a57
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-25 15:42:13 +00:00
Anas Nashif 33746d4b7c Revert "tests/crypto: Update testcase.ini to build on more platforms"
This reverts commit 7b652b1f84.

Breaks on many boards.

Change-Id: Ie74e7a656094a54b999b99de9a462093525202c3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-23 07:13:42 -08:00
Flavio Santes 7b652b1f84 tests/crypto: Update testcase.ini to build on more platforms
This patch excludes qemu riscv32 due to the following msg:

qemu-system-riscv32: cannot set up guest memory
'riscv_sifive_board.ram': Cannot allocate memory

Jira: ZEP-1721

Change-Id: Ib1784fa57ad1e3d69871d4e216af1ad5dbe55a76
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-23 13:19:21 +00:00
Andrew Boie da7864e727 REVERTME: tests: crypto: disable on Xtensa
Tinycrypt's definition of 'bool' does not work properly with
Xtensa's XCC compiler.

Issue: ZEP-1722
Change-Id: Id71b5f1bcf738c83e672b64a592a68751758dbc9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 11:53:24 -08:00
Anas Nashif 6e6e94bc77 tests: disable qemu_riscv32 on test_ecc_dh test [REVERT ME]
Change-Id: Iafba43007ab8daf1652b038bfbec184fe92b5ffc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-11 07:00:42 +00:00
David B. Kinder ac74d8b652 license: Replace Apache boilerplate with SPDX tag
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-19 03:50:58 +00:00
Anas Nashif 2bc9d69981 build: abstract emulation and replace qemu goal with run
This will replace the current goal of 'make qemu' with 'make run' and
moves Qemu handling into its own file and into the boards instead of
being architecture specific.

We should be able to add new boards that support some other type of
emulation (by adding scripts/Makefile.<emu type>) and allow the board to
define their own options for the use type of emulation.

'make qemu' will still work, however it will be deprecated, starting
with this commit it is recommended to use 'make run'.

Jira: ZEP-359
Change-Id: I1cacd56b4ec09421a58cf5d010e22e9035214df6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-10 20:20:47 +00:00
Anas Nashif 66cfcc26bc tests: introduce Makefile.test
To customise test builds and support test related features such as time
stamps and a boot banner, introduce a Makefile variant that is dedicated
to testing.

Initially we introduce a new config overlay that is used for all tests, in
this case we enable BOOT_BANNER and BUILD_TIMESTAMP. This will print the
current version and the date, useful when reporting bugs and also an
indicator that the system has booted before the test has started.

For example:

[QEMU] CPU: qemu32
***** BOOTING ZEPHYR OS v1.6.99 - BUILD: Dec 21 2016 19:57:13 *****
tc_start() - Test Nanokernel CPU and thread routines
Initializing nanokernel objects
...
..

Change-Id: I224318cdeb55a301964ea366dbc577e2e3a09175
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-03 17:48:44 +00:00
Anas Nashif fe958df4dd libc: rework libc selection and reduce Kconfigs
Moved all libc Kconfigs to where the code is and remove the default
Kconfig for selecting the minimal libc. Minimal libc is now the default
if nothing else is configured in.

Removed the options for extended libc, this obviously was restricting
features in the minimal libc without a good reason, most of the
functions are available directly when using newlib, so there is no
reason why we need to restrict those in minimal libc.

Jira: ZEP-1440
Change-Id: If0a3adf4314e2ebdf0e139dee3eb4f47ce07aa89
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-15 22:31:28 +00:00
Marcus Shawcroft 954baea90b random: Restructure RANDOM Kconfig
Restructure the RANDOM Kconfig to match the structure used in other
drivers with a single top level menu.  Move the true random number
generators to appear first in the menu, with pseudo generators at the
bottom.  Do not present pseudo generators if a true random generator
is presented.

This change implies that tests, samples and applications that require
the random driver interface must now select CONFIG_RANDOM_GENERATOR.

In order for tests and samples to build (and run) on platforms that
have no random driver it remains necessary to select
the CONFIG_TEST_RANDOM_GENERATOR.

Note that CONFIG_TEST_RANDOM_GENERATOR retains its original purpose of
enabling a random driver that delivers non random numbers for the
purpose of testing only.

Change-Id: I2e28e44b4adf800e64a885aefe36a52da8aa455a
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-13 22:50:18 +00:00
Marcus Shawcroft fe8d044d9a tests: Remove unnecessary CONFIG_TEST_RANDOM_GENERATOR
Remove CONFIG_TEST_RANDOM_GENERATOR from each test and sample where it
is not required.

Change-Id: I949f8e93c2cb1881622a5e48efeb87c43122a170
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-13 22:50:18 +00:00
Marcus Shawcroft 409b754a15 Remove application calls to sys_rand32_init.
The random driver, if enabled, is initialized by the kernel
initialization function.  There is no need for applications or tests
to re-initialize the driver.

Change-Id: Ib4712dda937a7a83a8079c8aa662cec03c5416f8
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-11 11:18:18 +00:00
Flavio Santes 8d2a511557 tests/tinycrypt: Solve style issues in test_ccm_mode
This commit fixes some style issues detected by checkpatch:

- Lines over 80 characters
- Comment block

Furthermore test legends are homogenized.

Change-Id: If92bbbdcf915164da945a60c8bcdbb7452ad0da0
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-18 01:05:33 +00:00
Flavio Santes 6a3ca408cf tests/tinycrypt: Fix wrong sizeof argument in test_ccm_mode (2nd)
This commit fixes an issue in the test_ccm_mode.c file:

sizeof(data) is used to compute the length of the array pointed to
by the 'uint8_t *data' pointer.

At the same function scope, there is a variable (dlen) that already
specifies the required length, so we use that variable instead of
the 'sizeof' function call.

This issue was not reported by Coverity, although is worth to fix it.

Change-Id: I27cbf8c7000a4189a42d193f6445996d4b852aa6
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-18 01:05:32 +00:00
Flavio Santes 5b47ca7395 tests/tinycrypt: Fix wrong sizeof argument in test_ccm_mode
This commit fixes the wrong sizeof argument error reported by
Coverity.

Coverity-CID: 152032

Change-Id: I2ee3089b4b840f4a1b8ba0303e92a3311c07ffeb
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-18 01:05:31 +00:00
Flavio Santes 0f231c70d3 tests/tinycrypt: Fix dead code issue (2nd)
This commit fixes the dead code issue reported by Coverity.

Coverity-CID: 151977

Change-Id: Iaa31c032456f48e1af1d1c9d722f051ac5519ccf
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-18 01:05:30 +00:00
Flavio Santes 7ac025ea14 tests/tinycrypt: Fix dead code issue (1st)
This commit fixes the dead code issue reported by Coverity.

Coverity-CID: 151975

Change-Id: I449341d1f540abe149e8ad9197a64d52cd5722cd
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-18 01:05:29 +00:00
Flavio Santes 9c426ba3f8 test/tinycrypt: Solve style issues in test_hmac_prng
Style issues fixed by this commit:

- Comments
- Variable declaration/definition
- Space between cast

Change-Id: Ia6eb7718c55b976cd0899ede742d89483db191b3
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-18 00:31:10 +00:00
Flavio Santes 9c2c57b730 tests/tinycrypt: Fix wrong sizeof argument
Fix the issue reported by Coverity: wrong sizeof argument.

Coverity-CID: 152042

Change-Id: I5d593ba54bf8f69f3c9d41a8b2878827d1cc186a
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-18 00:31:09 +00:00
Flavio Santes bb8f324d94 tests/tinycrypt/aes: Replace spaces by tabs
This commit replaces spaces by tabs in the TinyCrypt AES test.

Three 'space required before the open brace' issues are also
fixed by this commit.

Change-Id: I27e961484899873a25847452d569b50322dba74d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-18 00:27:23 +00:00
Flavio Santes 455ed30fee tests/tinycrypt/aes: Solve style issues in comments
This commit solves some style issues found in comment blocks.

Change-Id: I1f4f7344e33b5898ac7d1fb2cd13d75946b4ee5e
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-18 00:27:23 +00:00
Flavio Santes ef86c7d6f3 tests/tinycrypt/aes: Variable declarations at the beginning of a block
This commit moves variable declarations at the beginning of the test
routines.

Change-Id: Id1382b64aad4130e9a939c5e51301b75c6958fe5
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-18 00:27:22 +00:00
Flavio Santes 32f04293ca tests/tinycrypt/aes: Remove struct declaration inside function
This commit removes the declaration of a data type inside the tests
3 & 4. The new data type 'struct kat_table' is declared at the
beginning of the file.

Change-Id: I7662cd164a865fe0e70f984b9b494d96b4a72af9
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-18 00:27:21 +00:00
Flavio Santes da5dd09875 tinycrypt: Update CTR PRNG test case
This commit updates the TinyCrypt CTR PRNG test application.

See: https://github.com/01org/tinycrypt/
Commit: 601f6a26ab4505ac82a2fb13ae4757c2b8d3eba8

Change-Id: I9f5d92b9abbcf9608065992b05f114667a768c76
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-16 16:52:04 +00:00
Sergio Rodriguez 575adb6060 tests: crypto: Fix unchecked return value on CTR PRNG test case
This issue was reported by Coverity (CID 151952)

Change-Id: I59a20a3ccbe606ef634db98ac6cc6889a3973ec3
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-16 12:37:32 +00:00
Anas Nashif d622b09bc0 samples: tests: remove obsolete KERNEL_TYPE and kernel variables
Remove those from Makefiles and testcase.ini, we now support unified kernel
only and sanitycheck script now knows how to deal with this.

Change-Id: I853ebcadfa7b56a4de5737d95f2ba096babb2e13
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-04 15:47:25 -04:00
Anas Nashif 5e68ba972f tests: crypto: remove microkernel reference
Change-Id: Ia38de789108b60c08da659ecfc4aae578de9f698
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-04 13:47:18 +00:00
Inaky Perez-Gonzalez 52b519d471 tests/crypto/test_tcc_dh: increase timeouts for real HW
Some HW needs longet timeouts for this TC to complete succesfully.

Change-Id: If6cd4ad93b6e15293f1f8d8e606e159271f0e4d1
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-02 21:56:03 +00:00
Inaky Perez-Gonzalez a64ea3d62f tests/crypto/test_mbedtls: increase timeouts for HW
When running in real HW, testcases take more time to execute than the
default 60s. 200s seems to work for all HW types as of this commit
(FRDM k64f, Arduino Due, Arduino 101 / x86, EMSK 9d).

Change-Id: I663a67161bd7b4c349a483efb8e9cbf14c09421c
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-02 09:38:03 -07:00
Anas Nashif fcb54aa96b tests: crypto: convert all tests to unified kernel
Change-Id: Id7c1c6bbb0b04eb190cc44c1fbb557722871fc0f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-31 21:38:49 +00:00
Anas Nashif cc7b36cd70 test: test_hmac: cleanup excludes
Change-Id: Ib973339191a15b1dbb4fd5f3fa2fc5fe886521a3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-27 22:13:36 +00:00
Dmitriy Korovkin 6072e455f3 unified/tests: Adapt test_aes for unified kernel
Unified kernel invokes main() function in the init thread. This
eliminates the need for a separate thread for the test.

Change-Id: I4ff2e160213d152ca7c5d8422162f3464d935119
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-10-27 21:03:07 +00:00
Dmitriy Korovkin 81c94161f5 unified/tests: Adapt test_sha256 for unified kernel
Unified kernel invokes main() function in the init thread. This
eliminates the need for a separate thread for the test.

Change-Id: I4e6c4f212615d2135adf7971df32db1ad392c0e2
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-10-27 21:01:53 +00:00
Flavio Santes 36c09442d9 test/crypto: Fix RAM overflow error in ISSM
According to feedback received in ZEP-1130, decreasing the stack
size in the prj.mdef file solves the RAM overflow issue reported
by ISSM.

Jira: ZEP-1130

Change-Id: I761531e535a9e54ccd024b397d5d92d7666be817
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-10-27 19:56:15 +00:00
Anas Nashif 6d0a0ab337 tests: mbedtls: mark nios2 as slow
Change-Id: I95ac7c82ccdc6abb1cb7c345bea517ea48dceb8c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-24 21:17:16 +00:00
Anas Nashif bf5fdfbe43 tests: fix testcases for cortex-m0+ platforms
Change-Id: Idf6f5e38354aa5f1801ec0c0db63a4e19243918c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-22 16:54:19 -04:00
Anas Nashif b37dc99033 tests: sha256: filter by RAM size
Change-Id: Ie4e995006afc1281bee22e5b2d7f2a6a3b3bac28
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-22 16:54:19 -04:00
Genaro Saucedo Tejada 9021ead890 filter: Set special stack size for ecc_dsa debug
When the debug option is enabled ECC DSA test doesn't have enough stack
space so qemu fails. Adding double stack size for special case of qemu
and CONFIG_DEBUG.

Jira: ZEP-1066

Change-Id: Ib14d853de2b1c755a6171787845433648d61b75b
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-10-18 11:04:57 +00:00
Genaro Saucedo Tejada dbfc696437 filter: Exclude failing crypto test at debug build
Some of tests/crypto/test_ecc_dsa test are failing link step only
when debug is enabled, these filters prevent those tests from being
executed under such configuration.

Jira: ZEP-1063

Change-Id: I4b7376c49a401e21c413427918be549934ce03d5
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-10-18 11:04:49 +00:00
Flavio Santes 19d22dc389 tinycrypt: Add test case for the ECC DH algorithm
This commit adds the test-case for the ECC DH algorithm.

Origin: https://github.com/01org/tinycrypt/tree/v0.2.0

The code was refactored to eliminate function calls and checkpatch
errors. Furthermore, the PRNG was replaced by sys_rand32_init.
 Refactoring history is available at:

Repo:       https://gitlab.com/santes/tinycrypt/tree/refactoring
Commit:     f71fc46403e90be0c54a77150e0539756d8314e7

Jira: ZEP-614
Jira: ZEP-861

Change-Id: I884f26ef8e9ff8e79ed0858678c4f51a37796e02
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-09-20 12:54:21 +00:00
Flavio Santes 062489f873 tinycrypt: Add test case for the ECC DSA algorithm
This commit adds the test-case for the ECC DSA algorithm.

Origin: https://github.com/01org/tinycrypt/tree/v0.2.0

The code was refactored to eliminate function calls and checkpatch
errors. Furthermore, the PRNG was replaced by sys_rand32_init.
Refactoring history is available at:

Repo:	https://gitlab.com/santes/tinycrypt/tree/refactoring
Commit:	f71fc46403e90be0c54a77150e0539756d8314e7

Jira: ZEP-614
Jira: ZEP-862

Change-Id: Ief3c317f3d370a073f07307e53018991b03d9229
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-09-20 12:54:21 +00:00
Flavio Santes 5306a00190 tinycrypt: Rename current tests to avoid confusions with new algorithms
Rename test_ctr to test_ctr_mode to avoid confusions with any CTR-based
algorithm. For example, currently TinyCrypt v0.2.0 supports the
CTR PRNG algorithm.

Rename test_prng to test_hmac_prng to avoid confusions with the test
case for the CTR PRNG algorithm or any test-case related to PRNGs.

Rename test_cbc to test_cbc_mode. TinyCrypt test case for CBC mode is
"test_cbc_mode.c", so it makes sense to keep the same name for the
directory.

Furthermore, README files are also updated to reflect the previous
described changes.

Change-Id: If0af4dcffe8917a7c29608231d3954b73dff5e10
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-09-15 10:34:05 +00:00
Flavio Santes 0baadc030a tinycrypt: Solve style issues
This commit solves some indentation issues detected in the following
test-cases/files:

- test_cbc/src/test_cbc_mode.c
- test_ctr/src/test_ctr_mode.c
- test_prng/src/test_hmac_prng.c

Change-Id: I0f184ae4b510e4552a061523ea3e1216ae1f6f2a
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-09-15 10:34:05 +00:00
Flavio Santes 73b086caa7 tinycrypt: Add test case for the CTR PRNG algorithm
This commit adds the test case for the CTR PRNG algorithm.

Origin: https://github.com/01org/tinycrypt/tree/v0.2.0

The code was refactored to eliminate malloc and free function
calls and checkpatch errors. However, many warnings are still
present. Refactoring history is available at:

Repo:	https://gitlab.com/santes/tinycrypt/commits/refactoring
Commit:	5d0482c26c4ad69e7854dde58d15bb57a3e5f18f

Jira: ZEP-614
Jira: ZEP-860

Change-Id: I0620868d092941931762718c81fe13fc01f251b2
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-09-15 03:36:14 +00:00
Anas Nashif 8229904a00 checkpatch: fix ERROR:POINTER_LOCATION
Change-Id: I1daf382281f50c2fb1254d340dd499ae76513a5d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-08-29 08:47:05 -04:00
Andrew Boie 7853e0a1af tests: crypto: fix incorrect printk() usage
Change-Id: Iec8a3277952287e1a54d0ae67b56e88edc3068a9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-28 07:47:28 -04:00
Andrew Boie 6d2ab0ea11 test_cbc: fix indentation
Spaces were used instead of tabs. Fix up by using Lindent from
Linux kernel since we use same coding style.

Change-Id: Iece925ae40cad342fde1e33c240cb2ac23a15a9b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-28 07:47:28 -04:00
Andrew Boie 474a52f730 test_ctr: fix indentation
Spaces were used instead of tabs. Fix up by using Lindent from
Linux kernel since we use same coding style.

Change-Id: I7aa5c3f25a800fdaec6852e0d36daa07f1424f9a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-28 07:47:28 -04:00
Andrew Boie 9153996f90 test_hmac: fix indentation
Spaces were used instead of tabs. Fix up by using Lindent from
Linux kernel since we use same coding style.

Change-Id: I7294d1cef98031ba4ca1c202e0f19dbb7e504e16
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-28 07:47:28 -04:00
Andrew Boie 5aa94cdd68 test_sha256: fix indentation
Spaces were used instead of tabs. Fix up by using Lindent from
Linux kernel since we use same coding style.

Change-Id: I7ecb6dfd602ea4768d6a53e509f29b208d96c479
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-28 07:47:28 -04:00
Benjamin Walsh e1dad060c3 tests/crypto: rename MICROKERNEL entry from 'mainloop' to 'main'
Microkernels now support 'main' as a task entry point.

Change-Id: I39b07c191a98748191536ade6f87ec02da064bf1
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-08-27 10:49:02 +00:00
Andrew Boie d6fb8d3611 Revert "REVERTME exclude test_sha256 on Nios2"
The QEMU bug in the SDK has been fixed.
This reverts commit eb63710960.

Change-Id: Ic405c9df0f7aebb2a9d20180c7b0c04889669610
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-17 20:20:13 +00:00
Andrew Boie 7027231e9a test_mbedtls: exclude platforms with insufficient RAM/ROM
This will un-break the daily build.

Change-Id: I516ddab4a905d51fb1fd59f7fa009df3511c7076
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-28 21:22:19 +00:00
Sergio Rodriguez 950f45b532 samples/net : Adding mbedTLS self test routine
This contain the run of the self test for the ciphers, crypto
algorithms and utilities of mbedTLS.

Jira: ZEP-327
Jira: ZEP-340
Jira: ZEP-495

Origin: https://tls.mbed.org/download/start/mbedtls-2.3.0-apache.tgz

Change-Id: Ic1bb30b7ed691f17421510cd914ec5096e4e70ea
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2016-07-27 22:19:06 +00:00
Andrew Boie eb63710960 REVERTME exclude test_sha256 on Nios2
Daily build failing due to this test case timing out
execution after 3 hours. Locally this test takes about
a minute, the issues with CI are being looked into.

Change-Id: I27e40846dde25fc65281b4aea61d10b403c6512d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-21 16:31:31 +00:00
Kumar Gala 7dcbbc39e7 build: move from srctree to ZEPHYR_BASE for app include paths
$srctree for the application might not be set to be $ZEPHYR_BASE, use
$ZEPHYR_BASE instead to be more explicit in the build.

Change-Id: Iefa5ff59f246b584949329044f7a6531adc6ed62
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-06-30 14:36:39 +00:00
Inaky Perez-Gonzalez fcec9e37c0 testcases: sanity check TCs get more language for real HW
Add more specifications or qualify some to the sanity check test cases
for them to be ran in real hardware:

 - kernel types (micro vs nano)
 - platforms / arches to exclude / include
 - one that is removed (for the PCI sample) as it cannot be ran
   without extra information

Change-Id: Id14dc15eb89358c3656d2814ea41bb6fec051278
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-06-14 23:49:56 +00:00
Anas Nashif 7d76e9619b ext: move tinycrypt to ext/lib
Tinycrypt is maintained at github and thus should be treated as an
external library and hosted under ext/.

Change-Id: I4c4a3bcdacf01d4922919e5ea1f9dec21a19cd37
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-06-01 14:27:41 -04:00
Anas Nashif de8bc78a5e arc: support microkernel on ARC
Microkernel on ARC works fine, was missing some declarations in the
linker file.
Also enable testing of microkernel with ARC and disable tests where
ARC is not supported yet.

Jira: ZEP-396
Change-Id: I2ac7b8dc0bea22f5d2e24832d9e3afad8df9f580
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-25 22:14:18 -04:00
Anas Nashif f62d86c42b samples: get rid of obsolete usage of ARCH variable
Using ARCH variable to select different configurations for the different
architectures is misleading and conflicts with the variable ARCH being used by
the build system.  The variable is not needed, it is application specific and
an application can be built without the need to specify ARCH on the command
line.

This is yet another item specific to samples and test cases that
wrongfully being used and documented for every application.  We need to use
another variable and just make it clear it is specific to samples and how they
are written.  One possible solution is to have a script that gets the
architecture based on the board being used.  Attachments

Jira: ZEP-238
Change-Id: Ieccbc087a41858fb96fb361c0aaa04705e968a4e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:28 +00:00
Andrew Boie 3ea7892410 sanitycheck: allow for more expressive filtering in testcase.ini
The old 'config_whitelist' directive in testcase.ini has been removed.
We use the new expr_parser module to parse a 'filter' directive which
is a boolean expression. This gives a great deal more flexibility
in how tests can be filtered.

To keep the tree bisectable, use of config_whitelist in testcase.ini
converted to the new expression language.

Change-Id: I0617319818c5559c0f0569d2fa73d09b681cac51
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-04 22:57:39 +00:00
Maciek Borzecki 109b10b26e test_sha256: disable test for STM32F103RB SoC
Exclude STM32F103RB platform from the test. The SRAM is overflown by
>20kB, while the CPU itself has 20kB of SRAM.

Change-Id: Ic9aad6b88d517b62f4a18901cd698ba9a9defb40
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-04-01 13:12:57 +00:00
Anas Nashif 8290b4c795 move include directory for tests cases to tests/
Make the test case routines reside under tests.

Change-Id: Iea59a68e8b537954250d63923a88df267639e716
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 18:08:08 +00:00
Anas Nashif 7c35c6b524 tests: move crypto tests to tests/crypto
Put all tests under tests/crypto

Change-Id: Id64f0f39f7a7c6dba40161db3d8335febf545905
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 18:00:35 +00:00