diff --git a/.github/buildomat/jobs/deploy.sh b/.github/buildomat/jobs/deploy.sh index dca5d84e39e..fcf63dd0ab5 100644 --- a/.github/buildomat/jobs/deploy.sh +++ b/.github/buildomat/jobs/deploy.sh @@ -17,6 +17,43 @@ set -o errexit set -o pipefail set -o xtrace +# +# If we fail, try to collect some debugging information +# +_exit_trap() { + local status=$? + [[ $status -eq 0 ]] && exit 0 + + set +o errexit + set -o xtrace + banner evidence + zoneadm list -civ + pfexec dladm show-phys -m + pfexec dladm show-link + pfexec dladm show-vnic + pfexec ipadm + pfexec netstat -rncva + pfexec netstat -anu + pfexec arp -an + pfexec zfs list + pfexec zpool list + pfexec fmdump -eVp + pfexec ptree -z global + pfexec svcs -xv + for z in $(zoneadm list -n); do + banner "${z/oxz_/}" + pfexec svcs -xv -z "$z" + pfexec ptree -z "$z" + pfexec zlogin "$z" ipadm + pfexec zlogin "$z" netstat -rncva + pfexec zlogin "$z" netstat -anu + pfexec zlogin "$z" arp -an + done + + exit $status +} +trap _exit_trap EXIT + # # XXX work around 14537 (UFS should not allow directories to be unlinked) which # is probably not yet fixed in xde branch? Once the xde branch merges from @@ -104,46 +141,17 @@ start=$SECONDS while :; do if (( SECONDS - start > 60 )); then printf 'FAILURE: NEXUS DID NOT BECOME AVAILABLE\n' >&2 - break + exit 1 fi - # - # XXX This is an extremely basic test, which should be replaced with - # something more complete. - # if curl --fail-with-body -i http://192.168.1.20/spoof_login; then printf 'ok; nexus became available!\n' - exit 0 + break fi sleep 1 done # -# Try to collect some debugging information: +# XXX add tests here! # -set +o errexit -set -o xtrace -banner evidence -zoneadm list -civ -pfexec dladm show-phys -m -pfexec dladm show-link -pfexec dladm show-vnic -pfexec ipadm -pfexec netstat -rncva -pfexec netstat -anu -pfexec arp -an -pfexec zfs list -pfexec zpool list -pfexec fmdump -eVp -pfexec ptree -z global -pfexec svcs -xv -for z in $(zoneadm list -n); do - banner "${z/oxz_/}" - pfexec svcs -xv -z "$z" - pfexec ptree -z "$z" - pfexec zlogin "$z" ipadm - pfexec zlogin "$z" netstat -rncva - pfexec zlogin "$z" netstat -anu - pfexec zlogin "$z" arp -an -done