diff options
author | Erich Eckner <git@eckner.net> | 2019-05-24 15:01:07 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-05-24 15:01:07 +0200 |
commit | d1bd081fed69a8db0c95e8e8016e9ecaf251e48f (patch) | |
tree | dfc346c41b90e97eb75a5b23538cfc76a77838d8 /bin/sanity-check | |
parent | 423d088191e509adb7164c4dc48aac764fe158b5 (diff) | |
download | builder-d1bd081fed69a8db0c95e8e8016e9ecaf251e48f.tar.xz |
bin/sanity-check: add some verbosity, an rsync and an sftp check to "master-mirror-availability" test
Diffstat (limited to 'bin/sanity-check')
-rwxr-xr-x | bin/sanity-check | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/bin/sanity-check b/bin/sanity-check index df273fa..e93a157 100755 --- a/bin/sanity-check +++ b/bin/sanity-check @@ -137,6 +137,10 @@ while [ $# -gt 0 ]; do master-mirror-availability) + [ ${silence} -gt 0 ] || \ + printf 'checking if master mirror can be reached ...' | \ + tee -a "${tmp_dir}/messages" >&2 + for host in $( printf '%s\n' \ "${master_mirror_sftp_command}" \ @@ -150,7 +154,7 @@ while [ $# -gt 0 ]; do ); do if ! ping -c1 "${host}" >/dev/null 2>&1; then if [ ${silence} -le 1 ]; then - printf '\nThe master mirror %s cannot be reached.\n' \ + printf '\nThe master mirror %s cannot be pinged.\n' \ "${host}" | \ tee -a "${tmp_dir}/messages" >&2 fi @@ -160,6 +164,32 @@ while [ $# -gt 0 ]; do fi done + if ! ${master_mirror_rsync_command} ${master_mirror_rsync_directory} >/dev/null 2>&1; then + if [ ${silence} -le 1 ]; then + printf '\nThe master mirror %s cannot be reached via rsync.\n' \ + "${host}" | \ + tee -a "${tmp_dir}/messages" >&2 + fi + i_am_insane + # if the master mirror cannot be reached, further tests do not make any sense + set -- + fi + + if ! ${master_mirror_sftp_command} </dev/null >/dev/null 2>&1; then + if [ ${silence} -le 1 ]; then + printf '\nThe master mirror %s cannot be reached via sftp.\n' \ + "${host}" | \ + tee -a "${tmp_dir}/messages" >&2 + fi + i_am_insane + # if the master mirror cannot be reached, further tests do not make any sense + set -- + fi + + [ ${silence} -gt 0 ] || \ + echo ' passed.' | \ + tee -a "${tmp_dir}/messages" >&2 + ;; git-repositories) |