Skip to content

Commit

Permalink
add some error checks in run-script
Browse files Browse the repository at this point in the history
  • Loading branch information
gargnitingoogle committed Oct 3, 2024
1 parent 818f122 commit 4aa055a
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions perfmetrics/scripts/testing_on_gke/examples/run-gke-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ else
fi

if test -n "${gcsfuse_src_dir}"; then
test -d "${gcsfuse_src_dir}"
if ! test -d "${gcsfuse_src_dir}"; then
echo "gcsfuse_src_dir \"${gcsfuse_src_dir}\" does not exist"
exitWithFailure
fi
export gcsfuse_src_dir="$(realpath "${gcsfuse_src_dir}")"
else
export gcsfuse_src_dir="${src_dir}"/gcsfuse
Expand All @@ -216,7 +219,10 @@ fi
export gke_testing_dir="${gcsfuse_src_dir}"/perfmetrics/scripts/testing_on_gke

if test -n "${csi_src_dir}"; then
test -d "${csi_src_dir}"
if ! test -d "${csi_src_dir}"; then
echo "csi_src_dir \"${csi_src_dir}\" does not exist"
exitWithFailure
fi
export csi_src_dir="$(realpath "${csi_src_dir}")"
else
export csi_src_dir="${src_dir}"/gcs-fuse-csi-driver
Expand All @@ -235,14 +241,20 @@ if [[ ${pod_timeout_in_seconds} -le ${pod_wait_time_in_seconds} ]]; then
fi

if test -n "${workload_config}"; then
test -f "${workload_config}"
if ! test -f "${workload_config}"; then
echo "workload_config \"${workload_config}\" does not exist"
exitWithFailure
fi
export workload_config="$(realpath "${workload_config}")"
else
export workload_config="${gke_testing_dir}"/examples/workloads.json
fi

if test -n "${output_dir}"; then
test -d "${output_dir}"
if ! test -d "${output_dir}"; then
echo "output_dir \"${output_dir}\" does not exist"
exitWithFailure
fi
export output_dir="$(realpath "${output_dir}")"
else
export output_dir="${gke_testing_dir}"/examples
Expand Down

0 comments on commit 4aa055a

Please sign in to comment.