From 88c719f25fdeddbf6a6efd27bb86257c6d0b80eb Mon Sep 17 00:00:00 2001 From: Dmitriy Nikiforov Date: Thu, 17 Aug 2017 18:23:31 +0300 Subject: [PATCH] Make the location of fuzzing targets fixed Now all targets will be pushed to the /fuzzing directory by default. Also, fixed help message for 'run' command. Change-Id: I53e062df496628fef5bf8dd6ad1a256ce01ece3f --- infra/commands/publish.sh | 6 +++--- infra/commands/report.sh | 2 +- infra/commands/run.sh | 15 ++++++++------- infra/tizen_fuzz.sh | 1 + 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/infra/commands/publish.sh b/infra/commands/publish.sh index 6d387f3..7403cd3 100755 --- a/infra/commands/publish.sh +++ b/infra/commands/publish.sh @@ -6,7 +6,7 @@ function print_help { cat << EOF -Usage: ${EXEC} publish [OPTS] TARGET DESTINATION +Usage: ${EXEC} publish [OPTS] TARGET Pushes specified built target to device with all sanitized dependencies and prepares the device to run this target. @@ -58,7 +58,7 @@ while [[ ${1} = -* ]]; do esac done -if [[ $# -lt 2 ]]; then +if [[ $# -lt 1 ]]; then echo "Error: Missing arguments." print_help exit 1 @@ -75,7 +75,7 @@ fi ######################################################## target_name="${1}" -destination="${2}/${1}" +destination="${FUZZING_DIR}/${1}" # find specified target TARGET_DIR="${BUILD_ARTIFACTS_DIR}/${target_name}" diff --git a/infra/commands/report.sh b/infra/commands/report.sh index edab327..830a966 100755 --- a/infra/commands/report.sh +++ b/infra/commands/report.sh @@ -68,7 +68,7 @@ fi TARGET_NAME="${1}" TEST_NAME="${2}" -TARGET_DIR="${TARGET_NAME}/${TEST_NAME}.d" +TARGET_DIR="${FUZZING_DIR}/${TARGET_NAME}/${TEST_NAME}.d" DEST_DIR="${TIZEN_FUZZ_HOME}/reports/${TARGET_NAME}/${TEST_NAME}" prepare_device diff --git a/infra/commands/run.sh b/infra/commands/run.sh index 72ec7a1..20f88d3 100755 --- a/infra/commands/run.sh +++ b/infra/commands/run.sh @@ -6,9 +6,9 @@ function print_help { cat << EOF -Usage: ${EXEC} run [OPTS] TARGET_DIR TARGET +Usage: ${EXEC} run [OPTS] TARGET FUZZ_TEST -Runs target in the specified directory +Runs one fuzzing test of the specified target. Options: -h, --help Prints this message. @@ -95,12 +95,13 @@ fi # RUNNING TARGETS ######################################################## -target_dir="${1}/${2}.d" -target_name="${2}" -dict_dir="${1}/dicts" +TARGET_NAME="${1}" +TEST_NAME="${2}" +target_dir="${FUZZING_DIR}/${TARGET_NAME}/${TEST_NAME}.d" +dict_dir="${FUZZING_DIR}/${TARGET_NAME}/dicts" -options_file="${target_dir}/${target_name}.options" -target_bin="${target_dir}/${target_name}" +options_file="${target_dir}/${TEST_NAME}.options" +target_bin="${target_dir}/${TEST_NAME}" seed_corpus_dir="${target_dir}/seed_corpus" generated_corpus_dir="${target_dir}/generated_corpus" logs_dir="${target_dir}/logs" diff --git a/infra/tizen_fuzz.sh b/infra/tizen_fuzz.sh index 696ed7d..c7ccbb3 100755 --- a/infra/tizen_fuzz.sh +++ b/infra/tizen_fuzz.sh @@ -86,6 +86,7 @@ source "$(dirname ${0})/utils.sh" BUILD_ARTIFACTS_DIR="${TIZEN_FUZZ_HOME}/build" GBS_ROOT="${TIZEN_FUZZ_HOME}/GBS_ROOT" +FUZZING_DIR="/fuzzing" export_all -- 2.7.4