add exe and script path check (#11621)

Summary:
Add path existence check in the script to avoid script running even when db_bench executable does not exist or relative path is not right.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/11621

Reviewed By: jowlyzhang

Differential Revision: D47552590

Pulled By: ajkr

fbshipit-source-id: f09ea069f69e067212b249a22ad755b76bc6063a
oxigraph-main
zhutao 1 year ago committed by Facebook GitHub Bot
parent 98d0f6ec08
commit aeda36e925
  1. 6
      tools/benchmark.sh
  2. 6
      tools/run_blob_bench.sh

@ -6,6 +6,7 @@
EXIT_INVALID_ARGS=1 EXIT_INVALID_ARGS=1
EXIT_NOT_COMPACTION_TEST=2 EXIT_NOT_COMPACTION_TEST=2
EXIT_UNKNOWN_JOB=3 EXIT_UNKNOWN_JOB=3
EXIT_INVALID_PATH=4
# Size Constants # Size Constants
K=1024 K=1024
@ -114,6 +115,11 @@ fi
job_id=${JOB_ID} job_id=${JOB_ID}
if [ ! -x ./db_bench ]; then
echo "./db_bench not found. Please make sure it exists in the current directory."
exit $EXIT_INVALID_PATH
fi
# Make it easier to run only the compaction test. Getting valid data requires # Make it easier to run only the compaction test. Getting valid data requires
# a number of iterations and having an ability to run the test separately from # a number of iterations and having an ability to run the test separately from
# rest of the benchmarks helps. # rest of the benchmarks helps.

@ -19,6 +19,7 @@
# Exit Codes # Exit Codes
EXIT_INVALID_ARGS=1 EXIT_INVALID_ARGS=1
EXIT_INVALID_PATH=2
# Size constants # Size constants
K=1024 K=1024
@ -74,6 +75,11 @@ if [ $# -ge 1 ]; then
fi fi
fi fi
if [ ! -f tools/benchmark.sh ]; then
echo "tools/benchmark.sh not found"
exit $EXIT_INVALID_PATH
fi
# shellcheck disable=SC2153 # shellcheck disable=SC2153
if [ -z "$DB_DIR" ]; then if [ -z "$DB_DIR" ]; then
echo "DB_DIR is not defined" echo "DB_DIR is not defined"

Loading…
Cancel
Save