summaryrefslogtreecommitdiffstats
path: root/regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_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_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_fuzz.c')
-rw-r--r--regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_fuzz.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_fuzz.c b/regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_fuzz.c
index a014b048cf1..b14340702b6 100644
--- a/regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_fuzz.c
+++ b/regress/usr.bin/ssh/unittests/sshbuf/test_sshbuf_fuzz.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: test_sshbuf_fuzz.c,v 1.1 2014/04/30 05:32:00 djm Exp $ */
+/* $OpenBSD: test_sshbuf_fuzz.c,v 1.2 2018/10/17 23:28:05 djm Exp $ */
/*
* Regress test for sshbuf.h buffer API
*
@@ -26,10 +26,15 @@ sshbuf_fuzz_tests(void)
{
struct sshbuf *p1;
u_char *dp;
- size_t sz, sz2, i;
+ size_t sz, sz2, i, ntests = NUM_FUZZ_TESTS;
u_int32_t r;
int ret;
+ if (test_is_fast())
+ ntests >>= 2;
+ if (test_is_slow())
+ ntests <<= 2;
+
/* NB. uses sshbuf internals */
TEST_START("fuzz alloc/dealloc");
p1 = sshbuf_new();