From 669bccf55fa9d8e2b1e9ed77b2b5a07bc31ab786 Mon Sep 17 00:00:00 2001 From: agroce Date: Sun, 21 Apr 2019 23:39:26 -0700 Subject: [PATCH] fix whichTest, add input length control --- bin/deepstate/eclipser.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/deepstate/eclipser.py b/bin/deepstate/eclipser.py index ffda900..d2ab75a 100644 --- a/bin/deepstate/eclipser.py +++ b/bin/deepstate/eclipser.py @@ -35,6 +35,10 @@ def main(): "--timeout", type=int, help="How long to fuzz using Eclipser.", default=3600) + parser.add_argument( + "--maxInputSize", type=int, help="Maximum input size.", + default=8192) + parser.add_argument( "--which_test", type=str, help="Which test to run (equivalent to --input_which_test).", default=None) @@ -53,9 +57,11 @@ def main(): cmd = ["dotnet", eclipser, "fuzz"] cmd += ["-p", deepstate, "-v", "1"] cmd += [str(args.timeout), "-o", out + ".eclipser.run", "--src", "file"] - deepargs = "--input_test_file eclipser.input --abort_on_fail --input_which_test " + whichTest + deepargs = "--input_test_file eclipser.input --abort_on_fail" + if whichTest is not None: + deepargs += " --input_which_test " + whichTest cmd += ["--initarg", deepargs] - cmd += ["--fixfilepath", "eclipser.input", "--maxfilelen", "8192"] + cmd += ["--fixfilepath", "eclipser.input", "--maxfilelen", str(args.maxInputSize)] subprocess.call(cmd) decodeCmd = ["dotnet", eclipser, "decode"]