diff options
author | djm@openbsd.org <djm@openbsd.org> | 2018-10-17 23:28:05 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2018-11-22 16:14:31 +1100 |
commit | 35d0e5fefc419bddcbe09d7fc163d8cd3417125b (patch) | |
tree | c47dbf67447dddd82deb0539ce01b574f09a3819 /regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c | |
parent | c1941293d9422a14dda372b4c21895e72aa7a063 (diff) |
upstream: add some knobs:
UNITTEST_FAST?= no # Skip slow tests (e.g. less intensive fuzzing).
UNITTEST_SLOW?= no # Include slower tests (e.g. more intensive fuzzing).
UNITTEST_VERBOSE?= no # Verbose test output (inc. per-test names).
useful if you want to run the tests as a smoke test to exercise the
functionality without waiting for all the fuzzers to run.
OpenBSD-Regress-ID: e04d82ebec86068198cd903acf1c67563c57315e
Diffstat (limited to 'regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c')
-rw-r--r-- | regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c b/regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c index c6b5c29d1..7c7cb2bfd 100644 --- a/regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c +++ b/regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: test_sshbuf_getput_fuzz.c,v 1.2 2014/05/02 02:54:00 djm Exp $ */ | 1 | /* $OpenBSD: test_sshbuf_getput_fuzz.c,v 1.3 2018/10/17 23:28:05 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Regress test for sshbuf.h buffer API | 3 | * Regress test for sshbuf.h buffer API |
4 | * | 4 | * |
@@ -115,11 +115,15 @@ sshbuf_getput_fuzz_tests(void) | |||
115 | 0x55, 0x0f, 0x69, 0xd8, 0x0e, 0xc2, 0x3c, 0xd4, | 115 | 0x55, 0x0f, 0x69, 0xd8, 0x0e, 0xc2, 0x3c, 0xd4, |
116 | }; | 116 | }; |
117 | struct fuzz *fuzz; | 117 | struct fuzz *fuzz; |
118 | u_int fuzzers = FUZZ_1_BIT_FLIP | FUZZ_2_BIT_FLIP | | ||
119 | FUZZ_1_BYTE_FLIP | FUZZ_2_BYTE_FLIP | | ||
120 | FUZZ_TRUNCATE_START | FUZZ_TRUNCATE_END; | ||
121 | |||
122 | if (test_is_fast()) | ||
123 | fuzzers &= ~(FUZZ_2_BYTE_FLIP|FUZZ_2_BIT_FLIP); | ||
118 | 124 | ||
119 | TEST_START("fuzz blob parsing"); | 125 | TEST_START("fuzz blob parsing"); |
120 | fuzz = fuzz_begin(FUZZ_1_BIT_FLIP | FUZZ_2_BIT_FLIP | | 126 | fuzz = fuzz_begin(fuzzers, blob, sizeof(blob)); |
121 | FUZZ_1_BYTE_FLIP | FUZZ_2_BYTE_FLIP | | ||
122 | FUZZ_TRUNCATE_START | FUZZ_TRUNCATE_END, blob, sizeof(blob)); | ||
123 | TEST_ONERROR(onerror, fuzz); | 127 | TEST_ONERROR(onerror, fuzz); |
124 | for(; !fuzz_done(fuzz); fuzz_next(fuzz)) | 128 | for(; !fuzz_done(fuzz); fuzz_next(fuzz)) |
125 | attempt_parse_blob(blob, sizeof(blob)); | 129 | attempt_parse_blob(blob, sizeof(blob)); |