test: add a basic example of some coverage-guided fuzzing test

This commit is contained in:
mich 2019-11-26 15:50:56 +01:00
parent d49c415405
commit 7c1e437d46
1 changed files with 24 additions and 0 deletions

24
test/fuzz/fuzz_asn1rt.py Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env python3
from pycrate_asn1dir import TCAP_MAPv2v3
#
from pycrate_core import utils
from pycrate_core import charpy
from pycrate_asn1rt import err
#
from pythonfuzz.main import PythonFuzz
@PythonFuzz
def fuzz(buf):
buf = bytes(buf)
try:
M = TCAP_MAPv2v3.TCAP_MAP_Messages.TCAP_MAP_Message
M.from_ber(buf)
#r = M.to_asn1()
except utils.PycrateErr:
pass
if __name__ == '__main__':
fuzz()