1742 Commits

Author SHA1 Message Date
Michael Rash
7fb2f292bc [test suite] in valgrind mode, make tests fail whenever there are 'definitely' or 'indirectly' lost bytes in memory 2014-06-08 20:20:19 -04:00
Michael Rash
53a1e1bc00 [client] minor bug fix for condition under which fiu_* functions are called for fault injection 2014-06-08 20:19:03 -04:00
Michael Rash
82b05b9530 [libfko] fko_new() bug fix to not leak memory under fko_set_... error conditions
This commit changes how fko_new() deals with FKO context initialization
to not set ctx->initval back to zero (uninitialized) imediately after
calling each fko_set_... function and before checking the fko_set_... return
value.  The reason for this change is that fko_destroy() checks for
context initialization via ctx->initval before calling free() against
any heap allocated context member. So, if fko_set_... returns an error,
fko_destroy() (previous to this commit) would have no opportunity to
free such members.

This bug was found with fault injection testing provided by libfiu
together with valgrind. Specifically the following test suite command
exposes the problem (from the test/ directory):

./test-fwknop.pl --enable-complete --include "fault injection.*libfko"

In the resulting output/2.test file valgrind reports the following:

==27941== LEAK SUMMARY:
==27941==    definitely lost: 264 bytes in 1 blocks
==27941==    indirectly lost: 28 bytes in 3 blocks
==27941==      possibly lost: 0 bytes in 0 blocks
==27941==    still reachable: 1,099 bytes in 12 blocks
==27941==         suppressed: 0 bytes in 0 blocks

After this commit is applied, this changes to:

==7137== LEAK SUMMARY:
==7137==    definitely lost: 0 bytes in 0 blocks
==7137==    indirectly lost: 0 bytes in 0 blocks
==7137==      possibly lost: 0 bytes in 0 blocks
==7137==    still reachable: 1,099 bytes in 12 blocks
==7137==         suppressed: 0 bytes in 0 blocks

Note that 'definitely lost' in valgrind output means there is a real
memory leak that needs to be fixed whereas 'still reachable' is most
likely not a real problem according to:

http://valgrind.org/docs/manual/faq.html#faq.deflost
2014-06-06 21:28:28 -04:00
Michael Rash
dfeecf5c29 [test suite] additional fix for duplicate fault injection tags 2014-06-06 10:31:07 -04:00
Michael Rash
1b4d7f5b19 [test suite] minor fix for duplicate fault injection tags 2014-06-06 10:25:33 -04:00
Michael Rash
6d1d66fe03 add --fault-injection-tag support to the client/server/libfko
This is a significant commit to add the ability to leverage libfko fault
injections from both the fwknop client and server command lines via a
new option '--fault-injection-tag <tag name>'.  This option is used by
the test suite with the tests/fault_injection.pl tests.
2014-06-05 23:05:49 -04:00
Michael Rash
6a0af8ed8e [test suite] added coverage_diff.py
This commit adds support for diff'ing before and after gcov/lcov results
to see when new function/line coverage is added by the test suite.  Here
is an example of its output:

Sun Jun  1 22:28:00 2014 CMD: ./coverage_diff.py
[+] Coverage: /home/mbr/git/fwknop.git/server/config_init.c
[+] new 'fcns' coverage: usage()
[+] new 'lines' coverage: 1015
[+] new 'lines' coverage: 1017
[+] new 'lines' coverage: 1019
[+] new 'lines' coverage: 1059
[+] new 'lines' coverage: 979
[+] Coverage: /home/mbr/git/fwknop.git/server/fw_util_iptables.c
[+] new 'lines' coverage: 560
[+] new 'lines' coverage: 561
2014-06-01 22:30:54 -04:00
Michael Rash
040b7b10a0 [test suite] add shell escape for /usr/include/* wildcard on lcov command line 2014-05-26 23:15:09 -04:00
Michael Rash
2e150d47a7 restore trustdb.gpg files 2014-05-26 23:06:14 -04:00
Michael Rash
2697bd260c [test suite] fix LD_LIBRARY_PATH for fiu-run execution against fko-wrapper binaries 2014-05-26 22:53:44 -04:00
Michael Rash
ed58dcb635 Revert "add gcc '-pg' flag in --enable-profile-coverage mode"
This reverts commit bbe5626566d617317f2d25f5650f2299c95f2c9f because -pg
is needed for gprof, not gcov, and valgrind is incompatible with -pg.
2014-05-26 21:28:19 -04:00
Michael Rash
ddaf0134d6 use fiu.h instead of fiu-local.h 2014-05-26 15:54:12 -04:00
Michael Rash
e893ecad21 [test suite] added first test to run fwknop client underneath fiu-run for libc fault injection 2014-05-26 15:09:02 -04:00
Michael Rash
a1f1e4b328 [test suite] in --enable-fuzzing-interfaces mode create fko-wrapper/send_spa_payloads file if it does exist 2014-05-26 14:18:27 -04:00
Michael Rash
237602114f [test suite] minor fko_wrapper comment update 2014-05-26 08:40:26 -04:00
Michael Rash
15aff82980 client/server added libfiu header files in --enable-libfiu-support mode 2014-05-26 08:39:44 -04:00
Michael Rash
55ae7d5095 [test suite] auto-generate fko-wrapper/fuzz_spa_payload file with spa_fuzzing.py if necessary in --enable-complete/--enable-fuzzing-interfaces mode 2014-05-25 22:10:43 -04:00
Michael Rash
23e8dcfddd [test suite] added configure_max_coverage.sh for --enable-complete mode 2014-05-25 16:23:40 -04:00
Michael Rash
fa53cc62e1 [test suite] SPA packet fuzzer minor comment additions to clearly define SPA packet types 2014-05-25 15:50:09 -04:00
Michael Rash
d625a24a87 [test suite] added fko_new_with_data() call with SPA data that is too short 2014-05-25 15:08:31 -04:00
Michael Rash
00ea2ce0ef [test suite] added --enable-complete option for fuzzing, fault injection, and code coverage 2014-05-25 12:37:35 -04:00
Michael Rash
de03ed702e [test suite] added the ability to run fiu-run fault injection binary against fwknop 2014-05-24 17:55:57 -04:00
Michael Rash
597a3d3953 [libfko] added fault injections for remaining ...set...() functions called by fko_new() 2014-05-24 15:12:07 -04:00
Michael Rash
5f227cfa48 [libfko] added fault injections for fko_set_username() 2014-05-24 14:47:10 -04:00
Michael Rash
17f325eceb [libfko] added fault injections for fko_set_rand_value() 2014-05-24 14:01:49 -04:00
Michael Rash
35ad832392 [libfko] started on libfiu fault injection code 2014-05-24 10:14:28 -04:00
Michael Rash
2f9b92068d [test suite] added tests/rijndael_hmac_fuzzing.pl file 2014-05-24 09:32:58 -04:00
Michael Rash
23997b62aa [test suite] add hmac_fuzzing_access.conf file 2014-05-24 09:32:45 -04:00
Michael Rash
8d61a8cf7f [test suite] added tests/rijndael_hmac_fuzzing.pl file 2014-05-23 18:55:06 -04:00
Michael Rash
0a82c68451 [test suite] add hmac_fuzzing_access.conf file 2014-05-23 18:50:47 -04:00
Michael Rash
cf3f41821b [test suite] add fault injection tests 2014-05-22 08:36:11 -05:00
Michael Rash
a65fff7e7b [test suite] make fko_wrapper binary path absolute 2014-05-22 08:30:36 -05:00
Michael Rash
c5e8eee743 [test suite] make fko_wrapper binary path absolute 2014-05-22 08:29:06 -05:00
Michael Rash
a2f2777e9f [test suite] add fko_basic.c file to the FKO wrapper 2014-05-22 08:24:16 -05:00
Michael Rash
bbe5626566 add gcc '-pg' flag in --enable-profile-coverage mode 2014-05-22 08:19:45 -05:00
Michael Rash
8666788a16 [test suite] minor line counter addition for file_find_regex() 2014-05-21 09:12:20 -04:00
Michael Rash
02389932bc added --enable-libfiu-support to build fwknop with fault injection support 2014-05-21 08:27:31 -04:00
Michael Rash
84821438bd [test suite] started on support for libfiu fault injection tests 2014-05-20 21:20:10 -04:00
Michael Rash
55582c31f8 [test suite] expand libfko username coverage testing by adding undef LOGNAME env variable test 2014-05-10 23:16:32 -04:00
Michael Rash
d5e5961ca1 [test suite] stronger valgrind test requirements
This commit adds a couple of suppressions for known issues that valgrind
finds in libcap, and then makes a significant change to how the test
suite deals with any valgrind errors (in --enable-valgrind mode) that
are outside of these suppressions.  That is, any new valgrind errors
that are discovered will cause the test that triggers them to fail.
Previous to this commit, the final valgrind "flagged functions" test
attmpted to do this by comparing valgrind output across test runs. This
worked well enough for a while, but this latest commit enforces a
stricter stance for valgrind validation of the fwknop code base.
2014-05-09 21:13:48 -04:00
Michael Rash
7cb8ad9528 [fko-wrapper] add missing fko_destroy() call 2014-05-09 20:53:32 -04:00
Michael Rash
22ad9044cd [test suite] python fuzzer pkt_id counter minor bug fix 2014-05-09 20:51:37 -04:00
Michael Rash
3e0c983bbd [test suite] add lib path and valgrind string to server start/stop cycle tests 2014-05-09 07:57:46 -04:00
Michael Rash
2b5029a4ee [test suite] add SIGINT, SIGUSR1, and SIGUSR2 signals to restart cycle test for code coverage 2014-05-09 07:49:57 -04:00
Michael Rash
33234183df [test stuie] fko-wrapper PKT_ID generation + send fuzzing packets back through fko_new_with_data() cycle 2014-05-08 07:46:13 -04:00
Michael Rash
0c544f2690 [server] add --test mode to enable broader fuzzing coverage 2014-05-08 07:35:42 -04:00
Michael Rash
64a4642c47 [server] minor fix to remove unnecessary opts.status check 2014-05-08 07:28:48 -04:00
Michael Rash
7d1ad9a4fa add new test suite conf files 2014-05-08 07:26:18 -04:00
Michael Rash
16b3911091 [test suite] Rijndael HMAC fuzzing support and a few minor test additions 2014-05-08 07:25:47 -04:00
Michael Rash
02ed5f5ad4 [server] add --exit-parse-config option, man page updates (minor formatting change) 2014-05-04 09:17:27 -04:00