grin/core/fuzz
Simon B f9b87164e7 Idiomatic cargo toml (#862)
* Specify versions SemVer-style
 - slog and serde
* Comments for not update-able pre-1.0 crates:
 - urlencoded at "0.5" since 0.6+ lacks trait `plugin::Plugin<iron::Request<'_, '_>>`
* alpha-sort deps
* Specify versions SemVer-style
 - backtrace, bitflags, blake2-rfc, bodyparser, built, byteorder
 - chrono, clap, demonize, enum_primitive, env_logger
 - failure, failure_derive, futures
 - hyper, iron, itertools, lazy_static, libc
 - memmap, mount, net2, num_bigint, prettytable-rs
 - rand, regex, rocksdb, router, siphasher
 - term, time, tokio-core, tokio-retry, urlencoded, uuid, walkdir, zip
2018-03-25 17:44:27 +00:00
..
fuzz_targets Introduce fuzz tests for core (#844) 2018-03-22 16:53:47 +00:00
src Introduce fuzz tests for core (#844) 2018-03-22 16:53:47 +00:00
.gitignore Introduce fuzz tests for core (#844) 2018-03-22 16:53:47 +00:00
Cargo.toml Idiomatic cargo toml (#862) 2018-03-25 17:44:27 +00:00
README.md Introduce fuzz tests for core (#844) 2018-03-22 16:53:47 +00:00

Fuzz testing

Installation

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

Check fuzz/Cargo.toml for the full list of targets.