From bc983836f6996464107a34694b758c837936a95c Mon Sep 17 00:00:00 2001 From: David Valin Date: Fri, 13 Mar 2026 11:37:56 -0400 Subject: [PATCH 1/3] Update how we load test tools --- passmark/passmark_run | 44 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/passmark/passmark_run b/passmark/passmark_run index 88a3f7e..202c685 100755 --- a/passmark/passmark_run +++ b/passmark/passmark_run @@ -174,6 +174,40 @@ produce_report() echo Checksum: Not applicable for summary file >> $summary_file } +attempt_tools_wget() +{ + if [[ ! -d "$TOOLS_BIN" ]]; then + wget ${tools_git}/archive/refs/heads/main.zip + if [[ $? -eq 0 ]]; then + unzip -q main.zip + mv test_tools-wrappers-main ${TOOLS_BIN} + rm main.zip + fi + fi +} + +attempt_tools_curl() +{ + if [[ ! -d "$TOOLS_BIN" ]]; then + curl -L -O ${tools_git}/archive/refs/heads/main.zip + if [[ $? -eq 0 ]]; then + unzip -q main.zip + mv test_tools-wrappers-main ${TOOLS_BIN} + rm main.zip + fi + fi +} + +attempt_tools_git() +{ + if [[ ! -d "$TOOLS_BIN" ]]; then + git clone $tools_git "$TOOLS_BIN" + if [ $? -ne 0 ]; then + exit_out "Error: pulling git $tools_git failed." 1 + fi + fi +} + install_tools() { pushd $curdir > /dev/null @@ -208,12 +242,10 @@ install_tools() # TOOLS_BIN=${HOME}/test_tools export TOOLS_BIN - if [ ! -d "${TOOLS_BIN}" ]; then - git clone $tools_git ${TOOLS_BIN} - if [ $? -ne 0 ]; then - exit_out "pulling git $tools_git failed." 1 - fi - fi + + attempt_tools_wget + attempt_tools_curl + attempt_tools_git if [ $show_usage -eq 1 ]; then usage $1 From 84e4569e6801e78af50da0f4ca632cf14abd485c Mon Sep 17 00:00:00 2001 From: David Valin Date: Fri, 13 Mar 2026 12:24:41 -0400 Subject: [PATCH 2/3] Use more specific return codes. --- passmark/passmark_run | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/passmark/passmark_run b/passmark/passmark_run index 202c685..6d7c95b 100755 --- a/passmark/passmark_run +++ b/passmark/passmark_run @@ -111,7 +111,7 @@ usage() echo " --cpu_add n: add n cpus each iteration until hit max cpus" echo " --powers_2: starting from 1 cpu, keep doubling the cpus until max cpus" source ${TOOLS_BIN}/general_setup --usage - exit 1 + exit $E_USAGE } produce_report() @@ -203,7 +203,7 @@ attempt_tools_git() if [[ ! -d "$TOOLS_BIN" ]]; then git clone $tools_git "$TOOLS_BIN" if [ $? -ne 0 ]; then - exit_out "Error: pulling git $tools_git failed." 1 + exit_out "Error: pulling git $tools_git failed." 101 fi fi } @@ -260,7 +260,7 @@ run_passmark() if [[ $arch == "aarch64" ]]; then unzip /$to_home_root/$to_user/uploads/pt_linux_arm64.zip if [ $? -ne 0 ]; then - exit_out "pt_linux_arm64.zip failed" 1 + exit_out "pt_linux_arm64.zip failed" $E_GENERAL fi # # Ubuntu check @@ -274,7 +274,7 @@ run_passmark() else unzip /$to_home_root/$to_user/uploads/pt_linux_x64.zip if [ $? -ne 0 ]; then - exit_out "pt_linux_x64.zip failed" 1 + exit_out "pt_linux_x64.zip failed" $E_GENERAL fi fi fi @@ -293,14 +293,14 @@ run_passmark() # # Give up. # - exit_out "/usr/lib64/libncurses.so.6 not present" 1 + exit_out "/usr/lib64/libncurses.so.6 not present" $E_GENERAL fi if [[ -f "libncurses.so.6" ]]; then ln -s libncurses.so.6 libncurses.so.5 else lib=`find . -print | grep 'libncurses.so.6$'` if [[ $? -ne 0 ]]; then - exit_out "libncurses.so.6 not present" 1 + exit_out "libncurses.so.6 not present" $E_GENERAL fi fi fi @@ -335,12 +335,12 @@ run_passmark() if [[ $arch == "aarch64" ]]; then ./pt_linux_arm64 -r 3 >> ${test_name}_${iter}.out if [ $? -ne 0 ]; then - exit_out "Execution of ./pt_linux_arm64 failed" 1 + exit_out "Execution of ./pt_linux_arm64 failed" $E_GENERAL fi else ./pt_linux_x64 -r 3 >> ${test_name}_${iter}.out if [ $? -ne 0 ]; then - exit_out "Execution of ./pt_linux_x64 failed" 1 + exit_out "Execution of ./pt_linux_x64 failed" $E_GENERAL fi fi end_time=$(retrieve_time_stamp) From 1d54ec9811a4608e4a580542f4c0ad684c5dc972 Mon Sep 17 00:00:00 2001 From: David Valin Date: Wed, 25 Mar 2026 05:13:28 -0400 Subject: [PATCH 3/3] Update from code review --- passmark/passmark_run | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/passmark/passmark_run b/passmark/passmark_run index 6d7c95b..318f4c9 100755 --- a/passmark/passmark_run +++ b/passmark/passmark_run @@ -174,22 +174,11 @@ produce_report() echo Checksum: Not applicable for summary file >> $summary_file } -attempt_tools_wget() +attempt_tools_generic() { + method="$1" if [[ ! -d "$TOOLS_BIN" ]]; then - wget ${tools_git}/archive/refs/heads/main.zip - if [[ $? -eq 0 ]]; then - unzip -q main.zip - mv test_tools-wrappers-main ${TOOLS_BIN} - rm main.zip - fi - fi -} - -attempt_tools_curl() -{ - if [[ ! -d "$TOOLS_BIN" ]]; then - curl -L -O ${tools_git}/archive/refs/heads/main.zip + $method ${tools_git}/archive/refs/heads/main.zip if [[ $? -eq 0 ]]; then unzip -q main.zip mv test_tools-wrappers-main ${TOOLS_BIN} @@ -243,8 +232,8 @@ install_tools() TOOLS_BIN=${HOME}/test_tools export TOOLS_BIN - attempt_tools_wget - attempt_tools_curl + attempt_tools_generic "wget" + attempt_tools_generic "curl -L -O " attempt_tools_git if [ $show_usage -eq 1 ]; then