aboutsummaryrefslogtreecommitdiff
path: root/test/fuzz/test_runner.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/fuzz/test_runner.py')
-rwxr-xr-xtest/fuzz/test_runner.py57
1 files changed, 16 insertions, 41 deletions
diff --git a/test/fuzz/test_runner.py b/test/fuzz/test_runner.py
index 1a74c67503..520a2b5a95 100755
--- a/test/fuzz/test_runner.py
+++ b/test/fuzz/test_runner.py
@@ -12,44 +12,6 @@ import sys
import subprocess
import logging
-# Fuzzers known to lack a seed corpus in https://github.com/bitcoin-core/qa-assets/tree/master/fuzz_seed_corpus
-FUZZERS_MISSING_CORPORA = [
- "addr_info_deserialize",
- "asmap",
- "base_encode_decode",
- "block",
- "block_file_info_deserialize",
- "block_filter_deserialize",
- "block_header_and_short_txids_deserialize",
- "bloom_filter",
- "decode_tx",
- "fee_rate_deserialize",
- "flat_file_pos_deserialize",
- "hex",
- "integer",
- "key_origin_info_deserialize",
- "merkle_block_deserialize",
- "out_point_deserialize",
- "p2p_transport_deserializer",
- "parse_hd_keypath",
- "parse_numbers",
- "parse_script",
- "parse_univalue",
- "partial_merkle_tree_deserialize",
- "partially_signed_transaction_deserialize",
- "prefilled_transaction_deserialize",
- "psbt_input_deserialize",
- "psbt_output_deserialize",
- "pub_key_deserialize",
- "rolling_bloom_filter",
- "script_deserialize",
- "strprintf",
- "sub_net_deserialize",
- "tx_in",
- "tx_in_deserialize",
- "tx_out",
-]
-
def main():
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
@@ -128,13 +90,27 @@ def main():
logging.info("{} of {} detected fuzz target(s) selected: {}".format(len(test_list_selection), len(test_list_all), " ".join(test_list_selection)))
+ test_list_seedless = []
+ for t in test_list_selection:
+ corpus_path = os.path.join(args.seed_dir, t)
+ if not os.path.exists(corpus_path) or len(os.listdir(corpus_path)) == 0:
+ test_list_seedless.append(t)
+ test_list_seedless.sort()
+ if test_list_seedless:
+ logging.info(
+ "Fuzzing harnesses lacking a seed corpus: {}".format(
+ " ".join(test_list_seedless)
+ )
+ )
+ logging.info("Please consider adding a fuzz seed corpus at https://github.com/bitcoin-core/qa-assets")
+
try:
help_output = subprocess.run(
args=[
os.path.join(config["environment"]["BUILDDIR"], 'src', 'test', 'fuzz', test_list_selection[0]),
'-help=1',
],
- timeout=10,
+ timeout=20,
check=True,
stderr=subprocess.PIPE,
universal_newlines=True,
@@ -158,8 +134,7 @@ def main():
def run_once(*, corpus, test_list, build_dir, export_coverage, use_valgrind):
for t in test_list:
corpus_path = os.path.join(corpus, t)
- if t in FUZZERS_MISSING_CORPORA:
- os.makedirs(corpus_path, exist_ok=True)
+ os.makedirs(corpus_path, exist_ok=True)
args = [
os.path.join(build_dir, 'src', 'test', 'fuzz', t),
'-runs=1',