From d602987879d14aa9ecd916eb97de8c09fa5b1eca Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 12 Dec 2024 18:11:36 +0100 Subject: [PATCH] update the script --- .../list_test_runner_machines | 80 ++++++++++++++----- 1 file changed, 61 insertions(+), 19 deletions(-) diff --git a/Scripts/developer_scripts/list_test_runner_machines b/Scripts/developer_scripts/list_test_runner_machines index 0f7b13d251c..a644a58aa77 100755 --- a/Scripts/developer_scripts/list_test_runner_machines +++ b/Scripts/developer_scripts/list_test_runner_machines @@ -9,12 +9,6 @@ lrineau@rubens HEREDOC ) -cat </dev/null || { - echo 'sed is required' +help() { + cat </dev/null || { + error_out 'sed is required' +} + + if [[ $1 == --table ]] && ! command -v pandoc >/dev/null; then - echo 'pandoc is required for the option --table' - exit 1 + error_out 'pandoc is required for the option --table' fi if [[ $1 == --column ]] && ! command -v column >/dev/null; then - echo 'column is required for the option --column' - exit 1 + error_out 'column is required for the option --column' fi if [[ $1 == --bat ]] && ! command -v bat >/dev/null; then - echo 'bat is required for the option --bat' - exit 1 + error_out 'bat is required for the option --bat' fi set_pretty_csv_to_md_table() { @@ -177,21 +193,47 @@ case "$1" in set_pretty_csv_to_bat elif command -v column >/dev/null; then set_pretty_csv_to_column + elif command -v pandoc >/dev/null; then + set_pretty_csv_to_md_table else set_pretty_csv_to_cat fi ;; *) - echo "Unknown option $1" - exit 1 + error_out "Unknown option $1" ;; esac +ERROR_MACHINES="" +for machine in $TEST_MACHINES; do + USER=${machine%@*} + HOST=${machine#*@} + ssh "$HOST" test -f /home/$USER/.config/CGAL/test_cgal_docker_images || { + ERROR_MACHINES="$ERROR_MACHINES $machine" + } +done +if [ -n "$ERROR_MACHINES" ]; then + for machine in $ERROR_MACHINES; do + USER=${machine%@*} + HOST=${machine#*@} + printf 'ERROR: cannot read file `/home/%s/.config/CGAL/test_cgal_docker_images` on ssh host `%s`\n' $USER $HOST + done + exit 1 +fi +cat <