summaryrefslogtreecommitdiffstats
path: root/regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_getput_fuzz.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2018-10-17 23:28:05 +0000
committerdjm <djm@openbsd.org>2018-10-17 23:28:05 +0000
commita76a1e9943ca8d959db56e9b6ea82ce594d3162f (patch)
treeff765847c4bdaa6035ac1466b64ccb3c82dc43a5 /regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_getput_fuzz.c
parentOnly the scheduler time statistics should be affected by spinning. (diff)
downloadwireguard-openbsd-a76a1e9943ca8d959db56e9b6ea82ce594d3162f.tar.xz
wireguard-openbsd-a76a1e9943ca8d959db56e9b6ea82ce594d3162f.zip
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.
Diffstat (limited to 'regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_getput_fuzz.c')
-rw-r--r--regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_getput_fuzz.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_getput_fuzz.c b/regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_getput_fuzz.c
index a382ee154e1..94f666dd22e 100644
--- a/regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_getput_fuzz.c
+++ b/regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_getput_fuzz.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: test_sshbuf_getput_fuzz.c,v 1.2 2014/05/02 02:54:00 djm Exp $ */
+/* $OpenBSD: test_sshbuf_getput_fuzz.c,v 1.3 2018/10/17 23:28:05 djm Exp $ */
/*
* Regress test for sshbuf.h buffer API
*
@@ -105,11 +105,15 @@ sshbuf_getput_fuzz_tests(void)
0x55, 0x0f, 0x69, 0xd8, 0x0e, 0xc2, 0x3c, 0xd4,
};
struct fuzz *fuzz;
+ u_int fuzzers = FUZZ_1_BIT_FLIP | FUZZ_2_BIT_FLIP |
+ FUZZ_1_BYTE_FLIP | FUZZ_2_BYTE_FLIP |
+ FUZZ_TRUNCATE_START | FUZZ_TRUNCATE_END;
+
+ if (test_is_fast())
+ fuzzers &= ~(FUZZ_2_BYTE_FLIP|FUZZ_2_BIT_FLIP);
TEST_START("fuzz blob parsing");
- fuzz = fuzz_begin(FUZZ_1_BIT_FLIP | FUZZ_2_BIT_FLIP |
- FUZZ_1_BYTE_FLIP | FUZZ_2_BYTE_FLIP |
- FUZZ_TRUNCATE_START | FUZZ_TRUNCATE_END, blob, sizeof(blob));
+ fuzz = fuzz_begin(fuzzers, blob, sizeof(blob));
TEST_ONERROR(onerror, fuzz);
for(; !fuzz_done(fuzz); fuzz_next(fuzz))
attempt_parse_blob(blob, sizeof(blob));