AFLplusplus / AFLplusplus/LibAFL
Improvements to testing framework
- Lenguaje dominante
- Rust
- Estrellas
- 2.6k
- Forks
- 481
- Merge medio
- 2 d 30 min
- PR fusionados (30 d)
- 16
Descripción
Recently @mkravchik merged a PR aimed at adding e2e-testing capabilities to the library in order to allow for easy testing of e.g. frida ASAN.
After using his solution a bit, and making a few improvements (see changes in PR #1607), here are some ideas to improve upon it even more.
1. Currently all the ASAN tests run as one 'cargo test' testcase. This has the following cons:
- If a single test fails, the remainder of the tests do not run
- There is no nice 'cargo test' UI showing pass/fails for each test.
- It's impossible to run a single test from the list
2. Currently to write a test, one needs to add a function to `test_harness.cc`, and then add the test name and expectation to the list in `lib.rs`. This is a bit clunky. Ideally we'd be able to both specify the C/C++ function to be tested and the expectations, easily from within the `lib.rs` and have machinery to produce a shared-object/dll/dylib for the test automatically.
3. Currently we only support simple expectations. Specifically: was there an ASAN error, and what type was it. For true unit testing, we would want to be able to specify complex expectations, includng things like checking that the backtrace is correct, the registers captured are correct etc.
4. Currently all test-cases are in a shared-object/dll. This is not strictly necessary. It might be signifcantly easier to use a static library and link the test-cases into the library.
5. Currently we use the `fuzz_one` method to execute our test case. While this is sufficient for the ASAN tests, it will not be enough for e.g. cmplog testing. We should introduce a `fuzz_until_solution` method.
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.