mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-05 05:02:06 +02:00
tests: Add corpora suppression (FUZZERS_MISSING_CORPORA) for fuzzers missing in https://github.com/bitcoin-core/qa-assets/tree/master/fuzz_seed_corpus
This commit is contained in:
@ -12,6 +12,28 @@ import sys
|
|||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
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",
|
||||||
|
"block_file_info_deserialize",
|
||||||
|
"block_filter_deserialize",
|
||||||
|
"block_header_and_short_txids_deserialize",
|
||||||
|
"fee_rate_deserialize",
|
||||||
|
"flat_file_pos_deserialize",
|
||||||
|
"key_origin_info_deserialize",
|
||||||
|
"merkle_block_deserialize",
|
||||||
|
"mutable_transaction_deserialize",
|
||||||
|
"out_point_deserialize",
|
||||||
|
"partial_merkle_tree_deserialize",
|
||||||
|
"partially_signed_transaction_deserialize",
|
||||||
|
"prefilled_transaction_deserialize",
|
||||||
|
"psbt_input_deserialize",
|
||||||
|
"psbt_output_deserialize",
|
||||||
|
"pub_key_deserialize",
|
||||||
|
"script_deserialize",
|
||||||
|
"sub_net_deserialize",
|
||||||
|
"tx_in_deserialize",
|
||||||
|
]
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||||
@ -100,10 +122,14 @@ def main():
|
|||||||
|
|
||||||
def run_once(*, corpus, test_list, build_dir, export_coverage):
|
def run_once(*, corpus, test_list, build_dir, export_coverage):
|
||||||
for t in test_list:
|
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)
|
||||||
args = [
|
args = [
|
||||||
os.path.join(build_dir, 'src', 'test', 'fuzz', t),
|
os.path.join(build_dir, 'src', 'test', 'fuzz', t),
|
||||||
'-runs=1',
|
'-runs=1',
|
||||||
os.path.join(corpus, t),
|
'-detect_leaks=0',
|
||||||
|
corpus_path,
|
||||||
]
|
]
|
||||||
logging.debug('Run {} with args {}'.format(t, args))
|
logging.debug('Run {} with args {}'.format(t, args))
|
||||||
result = subprocess.run(args, stderr=subprocess.PIPE, universal_newlines=True)
|
result = subprocess.run(args, stderr=subprocess.PIPE, universal_newlines=True)
|
||||||
|
Reference in New Issue
Block a user