grin/core/fuzz
Yeastplume b8c8840cec
Refactor wallet commands (#2067)
* start wallet command refactoring

* another re-structuring attempt

* rustfmt

* begin splitting up wallet commands

* rustfmt

* clean up wallet arg checking

* rustfmt

* macro for arg parsing

* rustfmt

* factor out init commands

* rustfmt

* move recover to new format

* rustfmt

* add listen command to new format

* rustfmt

* Finish moving commands to new format

* rustfmt

* rustfmt

* propogate errors more cleanly

* rustfmt

* error handling cleanup
2018-12-06 12:04:02 +00:00
..
fuzz_targets rustfmt 2018-06-22 09:44:38 +01:00
src Refactor wallet commands (#2067) 2018-12-06 12:04:02 +00:00
.gitignore Introduce fuzz tests for core (#844) 2018-03-22 16:53:47 +00:00
Cargo.toml Update fuzz in core crate 2018-08-09 11:37:11 +02:00
README.md Update fuzz in core crate 2018-08-09 11:37:11 +02:00

Fuzz testing

Installation

You have to use Rust nightly at the moment. Cargo-fuzz (https://github.com/rust-fuzz/cargo-fuzz) has been used. To install it:

cargo install cargo-fuzz

Pattern generation for corpus

This step is optional, libFuzz will generate random patterns to populate corpus (in folder corpus). However we can genearete more meaningful pattern e.g. use serialized form of a real block or transaction. To generate them:

cd fuzz

cargo run --bin  gen-corpus

Run tests

Fuzz test is basically infinite test, run it for some period of time then stop if no failures are found. To run the tests make sure youre in folder core otherwise you may get some misleading errors, then run one of the following tests:

cargo fuzz run tx_read

cargo fuzz run block_read

cargo fuzz run compact_block_read

Run

cargo fuzz list

or check fuzz/Cargo.toml for the full list of targets.