-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop resolving benchmark binary location
This is a back-port of commit ba6a2b7 (PR #2860) from `main`. Both `pbench-fio` and `pbench-uperf`: * No longer allow for the benchmark binary to be overriden by an environment variable -- this was an out-dated way for the unit tests to mock the respective benchmark behavior * No longer resolve and check that the benchmark binary is executable There was an ordering problem with the old `benchmark_bin` variable initial value and where it is used in the rest of the script (both for `pbench-fio` and `pbench-uperf`). The existence check was not always performed locally (no clients or servers specified which are local), but the commands run remotely required `benchmark_bin` to be set during creation of the commands for remote execution. By only checking for the existence of the benchmark binary when performing the version check, and allowing the shell to resolve the location of the benchmark binary at run time, we avoid the interdependency altogether. Mock commands for `fio` and `uperf` are provided on the `PATH` for tests. For the CLI tests, those mocks are removed so that we can verify that help and usage text is emitted before the checks for the particular command existence (which is shown by the failing `test-CL`). We also add failing tests for `uperf` and `fio` behaviors: * `pbench-fio` * `test-22` -- missing `fio` command * `test-50` -- `fio -V` reports a bad version * `pbench-uperf` * `test-02` -- missing `uperf` command * `test-51` -- `uperf -V` reports a bad version The existence check of the `fio` and `uperf` benchmark commands now occurs after any help requests or command usage errors. This fixes issue #2841 [1]. Finally, we correct the way `pbench-uperf` checked the status of the `uperf` command execution of the benchmark by making sure the `local` declaration is performed before the assigment, so that the return code check is not overridden by the "status" of the `local` declaration. This fixes issue #2842 [2]. [1] #2841 [2] #2842
- Loading branch information
Showing
57 changed files
with
644 additions
and
435 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mock-cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mock-cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
echo "$0 $*" >> $_testlog | ||
|
||
# Mock fio command behaviors. | ||
if [[ "${1%%=*}" == "--client" ]]; then | ||
client_file=${1##*=} | ||
for line in $(< ${client_file}); do | ||
ip_name="${line%%,*}" | ||
client="${ip_name#*:}" | ||
if [[ "${client%%.*}" == "hist" ]]; then | ||
# When we are mocking out a benchmark command for pbench-fio, | ||
# for each client which begins with "hist" create an empty | ||
# fio latency histogram log file so that the invocation of | ||
# our latency visualizations can be exercised. | ||
touch ./fio_clat_hist.empty.log.${client} | ||
fi | ||
done | ||
elif [[ "${1}" == "--version" ]]; then | ||
echo "fio-${_BM_FIO_VER:-3.42}" | ||
exit 0 | ||
fi | ||
|
||
exit ${_BM_FIO_STS:-0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mock-cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mock-cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
echo "$0 $*" >> $_testlog | ||
|
||
# Mock uperf command behaviors. | ||
if [[ "${1}" == "-V" ]]; then | ||
echo "Uperf Version ${_BM_UPERF_VER:-1.0.42}" | ||
echo "... garbage to be ignored ..." | ||
exit 0 | ||
fi | ||
|
||
exit ${_BM_UPERF_STS:-0} |
Oops, something went wrong.