diff --git a/passmark/passmark_run b/passmark/passmark_run index 88a3f7e..318f4c9 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() @@ -174,6 +174,29 @@ produce_report() echo Checksum: Not applicable for summary file >> $summary_file } +attempt_tools_generic() +{ + method="$1" + if [[ ! -d "$TOOLS_BIN" ]]; then + $method ${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." 101 + fi + fi +} + install_tools() { pushd $curdir > /dev/null @@ -208,12 +231,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_generic "wget" + attempt_tools_generic "curl -L -O " + attempt_tools_git if [ $show_usage -eq 1 ]; then usage $1 @@ -228,7 +249,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 @@ -242,7 +263,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 @@ -261,14 +282,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 @@ -303,12 +324,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)