| 1 |
#!/usr/bin/env python3 |
| 2 |
import glob |
| 3 |
import subprocess |
| 4 |
import os |
| 5 |
import re |
| 6 |
|
| 7 |
reportdir = "reports/" |
| 8 |
|
| 9 |
class bcolors: |
| 10 |
HEADER = '\033[95m' |
| 11 |
OKBLUE = '\033[94m' |
| 12 |
OKGREEN = '\033[92m' |
| 13 |
WARNING = '\033[93m' |
| 14 |
FAIL = '\033[91m' |
| 15 |
ENDC = '\033[0m' |
| 16 |
BOLD = '\033[1m' |
| 17 |
UNDERLINE = '\033[4m' |
| 18 |
|
| 19 |
|
| 20 |
print("Testing crashfiles") |
| 21 |
|
| 22 |
FNULL = open(os.devnull, "w") |
| 23 |
crashfiles = [] |
| 24 |
crashfiles.extend(glob.glob("*")) |
| 25 |
pattern = re.compile("^(leak-|timeout-|crash-)\w+$") |
| 26 |
|
| 27 |
filecounter = 1 |
| 28 |
|
| 29 |
FNULL = open(os.devnull, 'w') |
| 30 |
|
| 31 |
for filename in crashfiles: |
| 32 |
|
| 33 |
if not pattern.match(filename): |
| 34 |
continue |
| 35 |
|
| 36 |
fuzzer_retval = subprocess.call(["./check-input.sh", filename, "batchmode"], stdout=FNULL, stderr=subprocess.STDOUT) |
| 37 |
|
| 38 |
if fuzzer_retval == 0: |
| 39 |
print(bcolors.FAIL, "[", filecounter, "]", filename,"- not reproducable", bcolors.ENDC) |
| 40 |
else: |
| 41 |
print(bcolors.OKGREEN, "[", filecounter, "]", filename, "- reproducable", bcolors.ENDC) |
| 42 |
|
| 43 |
filecounter = filecounter + 1 |