• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python3
2import glob
3import subprocess
4import os
5import re
6
7reportdir = "reports/"
8
9class 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
20print("Testing crashfiles")
21
22FNULL = open(os.devnull, "w")
23crashfiles = []
24crashfiles.extend(glob.glob("*"))
25pattern = re.compile("^(leak-|timeout-|crash-)\w+$")
26
27filecounter = 1
28
29FNULL = open(os.devnull, 'w')
30
31for 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
44