helper.py run should use .options file

It is very unfortunate, but we have to copy the file. I'll think
how it is possible to restructure our images to avoid duplication.

Issue #19
This commit is contained in:
Mike Aizatsky 2016-11-02 16:06:02 -07:00
parent e1a2d3c14c
commit 8e2aa92c9c
3 changed files with 33 additions and 1 deletions

View File

@ -17,7 +17,7 @@
FROM ossfuzz/base FROM ossfuzz/base
MAINTAINER mike.aizatsky@gmail.com MAINTAINER mike.aizatsky@gmail.com
RUN apt-get install -y gdb RUN apt-get install -y gdb
COPY llvm-symbolizer /usr/local/bin COPY llvm-symbolizer run_fuzzer /usr/local/bin/
ENV ASAN_OPTIONS="symbolize=1:detect_leaks=0" ENV ASAN_OPTIONS="symbolize=1:detect_leaks=0"
# set up /out dir # set up /out dir

View File

@ -0,0 +1,31 @@
#!/bin/bash -eu
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################
# Fuzzer runner.
FUZZER=$1
shift
CMD_LINE="$FUZZER $@"
OPTIONS_FILE="${FUZZER}.options"
if [ -f $OPTIONS_FILE ]; then
OPTIONS_ARGS=$(grep "=" $OPTIONS_FILE | sed 's/\(\w*\)\W*=\W*\(.*\)/-\1=\2 /g' | tr '\n' ' ')
CMD_LINE="$CMD_LINE $OPTIONS_ARGS"
fi
echo $CMD_LINE
bash -c "$CMD_LINE"

View File

@ -166,6 +166,7 @@ def run_fuzzer(run_args):
'docker', 'run', '-i', 'docker', 'run', '-i',
'-v', '%s:/out' % os.path.join(BUILD_DIR, 'out'), '-v', '%s:/out' % os.path.join(BUILD_DIR, 'out'),
'-t', 'ossfuzz/libfuzzer-runner', '-t', 'ossfuzz/libfuzzer-runner',
'run_fuzzer',
'/out/%s/%s' %(args.target_name, args.fuzzer_name) '/out/%s/%s' %(args.target_name, args.fuzzer_name)
] + args.fuzzer_args ] + args.fuzzer_args