jwilk / python-afl

American Fuzzy Lop fork server and instrumentation for pure-Python code
https://jwilk.net/software/python-afl
MIT License
350 stars 33 forks source link

modify to allow better TSTL fuzzing #8

Closed agroce closed 6 years ago

agroce commented 6 years ago

TSTL (https://github.com/agroce/tstl) is a property-based (unit) test generation tool that uses python-afl to allow afl to generate TSTL tests, which makes it possible to use afl to generate tests for complex properties, perform differential testing, and check well-defined execution determinism properties.

This change would allow an environment variable (PYTHON_AFL_TSTL) to be set causing the instrumentation to ignore code in the Python file sut.py, which contains the TSTL test harness, not actual code-under-test. Sometimes it can be useful to include the harness code in the instrumentation, but usually not.

agroce commented 6 years ago

Any idea why the Travis is failing now? It's clearly pycodestyle, but running locally, the things it gripes about don't seem to be in my changes?

agroce commented 6 years ago

In particular, it seems to not like:

cont = persistent_allowed and (
    max is None or
    persistent_counter < max
)
jwilk commented 6 years ago

Yeah, pycodestyle is being silly. Don't worry about it. I'll fix it later.

jwilk commented 6 years ago

pycodestyle is being silly.

This should be fixed in 5f15846a81e87597e5601f39e3ed5e9d0c7f1fd8.

agroce commented 6 years ago

Checked in with fix for missing ], and all checks pass.

agroce commented 6 years ago

Change made, including bonus points.

jwilk commented 6 years ago

I fixed weird line wrapping in README and squashed everything as 750259668ae70a1b9921cda3b096c972eaa0c679. Feel free to add yourself as a copyright holder at the top of afl.pyx

jwilk commented 6 years ago

I've just released python-afl 0.7, which includes these changes.