Skip to content

Commit 001ff23

Browse files
committed
Consistent use of = as equality operator in tests
Also fix some quoting in these tests.
1 parent 907af6b commit 001ff23

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

agent/bench-scripts/pbench-fio

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ function fio_usage() {
141141

142142
function fio_process_options() {
143143
opts=$(getopt -q -o jic:t:b:s:d:r: --longoptions "help,max-stddev:,max-failures:,samples:,direct:,sync:,install,remote-only,clients:,client-file:,iodepth:,ioengine:,config:,jobs-per-dev:,job-mode:,rate-iops:,ramptime:,runtime:,test-types:,block-sizes:,file-size:,targets:,tool-group:,postprocess-only:,run-dir:,directory:,numjobs:,job-file:" -n "getopt.sh" -- "$@");
144+
144145
if [ $? -ne 0 ]; then
145146
printf "\t${benchmark}: you specified an invalid option\n\n"
146147
fio_usage
@@ -366,7 +367,7 @@ function fio_process_options() {
366367
;;
367368
esac
368369
done
369-
if [ $postprocess_only == "n" ]; then
370+
if [ "$postprocess_only" = "n" ]; then
370371
benchmark_run_dir="$pbench_run/${benchmark}_${config}_$date"
371372
else
372373
if [ -z "$run_dir" ]; then
@@ -382,7 +383,7 @@ function fio_process_options() {
382383

383384
# Ensure the right version of the benchmark is installed
384385
function fio_install() {
385-
if [ "$postprocess_only" == "n" ]; then
386+
if [ "$postprocess_only" = "n" ]; then
386387
if check_install_rpm $benchmark_rpm $ver; then
387388
debug_log "[$script_name]$benchmark_rpm $ver is installed"
388389
else
@@ -403,7 +404,7 @@ function fio_install() {
403404

404405
# install python-pandas on the controller: fiologparser_hist.py needs it
405406
function pandas_install() {
406-
if [ "$postprocess_only" == "n" ]; then
407+
if [ "$postprocess_only" = "n" ]; then
407408
if check_install_rpm python-pandas; then
408409
debug_log "[$script_name]python-pandas is installed"
409410
else
@@ -420,7 +421,7 @@ function print_iteration {
420421
printf "\n%28s" "$1" >>$benchmark_summary_txt_file
421422
printf "\n%s" "$1" >>$benchmark_summary_csv_file
422423
hists=`cat $iteration_dir/reference-result/fio.job 2>/dev/null | grep "^log_hist_msec"`
423-
if [ $1 == "iteration" ]; then
424+
if [ "$1" = "iteration" ]; then
424425
# this is just a label, so no links here
425426
if [ ! -z "$hist_interval" ]; then
426427
printf "\n%28s %s %s %s" "iteration" "summary" "hist-results" "tools">>$benchmark_summary_html_file
@@ -461,7 +462,7 @@ function fio_device_check() {
461462
local dev=""
462463
local client=""
463464
local rc=0
464-
if [ "$postprocess_only" == "n" ]; then
465+
if [ "$postprocess_only" = "n" ]; then
465466
debug_log "fio_device_check() $devs $clients"
466467
for dev in `echo $devs | sed -e s/,/" "/g`; do
467468
if echo $dev | grep -q "^/dev/"; then
@@ -643,7 +644,7 @@ function fio_run_benchmark() {
643644
echo "Restarting iteration $iteration ($count of $total_iterations)"
644645
log "Restarting iteration $iteration ($count of $total_iterations)"
645646
fi
646-
if [ "$postprocess_only" == "n" ]; then
647+
if [ "$postprocess_only" = "n" ]; then
647648
mkdir -p $iteration_dir
648649
else
649650
if [ ! -e $iteration_dir ]; then
@@ -678,7 +679,7 @@ function fio_run_benchmark() {
678679
fi
679680
benchmark_results_dir="$iteration_dir/sample$sample"
680681
benchmark_tools_dir="$benchmark_results_dir/tools-$tool_group"
681-
if [ "$postprocess_only" == "n" ]; then
682+
if [ "$postprocess_only" = "n" ]; then
682683
mkdir -p $benchmark_results_dir
683684
fio_job_file="$benchmark_results_dir/fio.job"
684685
fio_create_jobfile "$test_type" "$ioengine" "$block_size" "$iodepth" "$direct" "$sync" "$runtime" "$ramptime" "$file_size" "$rate_iops" "$dev" "$fio_job_file"
@@ -776,11 +777,11 @@ function fio_run_benchmark() {
776777
else
777778
# delete the tool data [and respose time log for rr tests] from the other samples to save space
778779
# this option is off by default
779-
if [ "$keep_failed_tool_data" == "n" ]; then
780+
if [ "$keep_failed_tool_data" = "n" ]; then
780781
/bin/rm -rf $iteration_dir/$sample_dir/tools-* $iteration_dir/$sample_dir/response-times.txt
781782
fi
782783
# since non reference-result sample data is rarely referenced, tar it up to reduce the number of files used
783-
if [ "$tar_nonref_data" == "y" ]; then
784+
if [ "$tar_nonref_data" = "y" ]; then
784785
pushd "$iteration_dir" >/dev/null; tar --create --xz --force-local --file=$sample_dir.tar.xz $sample_dir && /bin/rm -rf $sample_dir; popd >/dev/null
785786
fi
786787
fi
@@ -873,7 +874,7 @@ fio_install
873874
if [ "$remote_only" = "n" ] ;then
874875
pandas_install
875876
fi
876-
if [ "$install_only" == "y" ]; then
877+
if [ "$install_only" = "y" ]; then
877878
exit 0
878879
fi
879880

0 commit comments

Comments
 (0)