Commit graph

246 commits

Author SHA1 Message Date
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