mbedtls/tests
Gilles Peskine 8064bf3adf New timing unit tests
New set of unit tests for the timing module, instead of just running
the selftest function.

The selftest function sometimes fails on a heavily loaded
machine (such as a typical continuous integration system). Because of
the all-in-one nature of the test and because the exact load pattern
can be hard to reproduce, it is difficult to diagnose failures of CI
runs with selftest. The new tests are more separated and I strove to
point out potential failure modes in comments.

* mbedtls_timing_hardclock: not tested. This function gives so few
  guarantees that there isn't much to test, and it is hard to test
  reliably because clock cycles don't easily relate to time in any
  remotely portable way. This function isn't used in the library
  anyway, it's only there for benchmark programs.
* mbedtls_timing_get_timer: tested by setting a timer and verifying
  that it reaches its target, and by verifying that a timer started
  later than another always has a smaller elapsed time.
* mbedtls_set_alarm: tested by setting an alarm, busy-waiting for it
  and measuring the elapsed time with a timer.
* mbedtls_timing_set_delay, mbedtls_timing_get_delay: tested by
  setting a delay object and watching it go through its two delay
  values, using a timer to check that the delays are passed at the
  expected time.

The tests pass under light to moderate load, but some of them can be
defeated with sufficiently heavy load. This is unavoidable since the
test process to be effectively suspended for any length of time,
making us think that a timer has gone on for too long.
2017-12-20 21:57:48 +01:00
..
data_files Improve Readme for long test certificate chains 2017-07-26 13:49:38 +01:00
git-scripts Move the git scripts to correct path 2017-07-27 21:44:34 +01:00
scripts Allow comments in test data files 2017-09-29 15:45:12 +02:00
suites New timing unit tests 2017-12-20 21:57:48 +01:00
.gitignore Move some ignore patterns to subdirectories 2015-01-28 15:33:23 +00:00
CMakeLists.txt Remove need for elevated command line in Windows 2017-02-15 09:08:26 +00:00
compat.sh Allow SHA-1 in test scripts 2017-06-06 18:44:14 +02:00
Descriptions.txt Add selftest program to the list of tests 2014-04-04 16:33:01 +02:00
Makefile Clean up of formatting, and potential integer overflow fix 2016-10-13 13:51:13 +01:00
ssl-opt.sh Fix the check for max CA intermediates in ssl-opt.sh 2017-07-28 16:43:33 +01:00