Skip to content

alexanderwiederin/qa-assets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

QA Assets for rust-bitcoinkernel

This repository contains test assets for the rust-bitcoinkernel project.

Overview

This repository provides fuzz corpus data used for regression testing of rust-bitcoinkernel's fuzz targets. The corpus contains edge cases and interesting inputs discovered through fuzzing that help catch bugs and regressions.

Usage

Testing Locally

To verify corpus files work with your local rust-bitcoinkernel:

# Clone this repository
git clone https://github.com/alexanderwiederin/qa-assets.git

cd <path-to-rust-bitcoinkernel>

# Test all corpus files for a target
cargo fuzz run block_roundtrip <path-to-qa-assets>/fuzz_corpora/block_roundtrip -- -runs=0

# Test a specific corpus file
cargo fuzz run block_roundtrip <path-to-qa-assets>/fuzz_corpora/block_roundtrip/<hash>

CI Integration

These corpus files are automatically tested in rust-bitcoinkernel's CI on every PR to catch regressions.

Adding New Corpus Inputs

Option 1: From Local Fuzzing

  1. Run fuzzer locally to discover new inputs:
   cd <path-to-rust-bitcoinkernel>

   # Seed with existing corpus and fuzz for new inputs
   cargo fuzz run <target> <path-to-qa-assets>/fuzz_corpora/<target> -- -max_total_time=3600
  1. Minimize new inputs to reduce size:
   cargo fuzz cmin <target> <path-to-qa-assets>/fuzz_corpora/<target>
  1. Checkout a new branch and push commit:
   cd <path-to-qa-assets>
   git checkout -b update-corpus
   git add fuzz_corpora/<target>/
   git commit -m "chore(fuzz): expand corpus with new coverage"
   git push origin update-corpus

Option 2: From Crash Reports

If a fuzzer finds a crash (either locally or in CI):

  1. Download the crash input from CI artifacts or local fuzz/artifacts/
  2. Fix the bug in rust-bitcoinkernel
  3. Add crash input to corpus as a regression test:
  • If found locally: Copy from fuzzer artifacts
   cp <path-to-rust-bitcoinkernel>/fuzz/artifacts/<target>/crash-<id> <path-to-qa-assets>/fuzz_corpora/<target>/crash-<id>
  • If downloaded from CI: Copy from your downloads folder
   cp ~/Downloads/crash-<id> <path-to-qa-assets>/fuzz_corpora/<target>/crash-<id>
  1. Commit and push the regression test:
   cd <path-to-qa-assets>
   git checkout -b add-regression-test
   git add fuzz_corpora/<target>/crash-<id>
   git commit -m "chore(fuzz): add regression test for <target> crash

   Adds crash input that triggered [brief description of the bug].
   Fixed in rust-bitcoinkernel commit <commit-hash>."
   git push origin add-regression-test

Attribution

Some test assets in this repository are derived from or include data from bitcoin-core/qa-assets, which is part of the Bitcoin Core project and follows the MIT license.

License

This repository is licensed under the MIT License. See the LICENSE file for details.

Test assets are provided for testing purposes only.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •