J. Richard Barnette | d24b2fd | 2015-01-12 17:42:37 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Force a verify job for any host that hasn't seen activity in |
| 4 | # the past day. |
| 5 | # |
| 6 | # Various scripts/cron jobs look for DUTs that aren't working. To |
| 7 | # be conservative, those scripts assume that a DUT that hasn't run |
| 8 | # any jobs within a reasonable time interval isn't working, since |
| 9 | # some of the ways a DUT may be unavailable manifest as inactivity. |
| 10 | # |
| 11 | # In some cases, we'd like to be more certain as to a DUT's status. |
| 12 | # This script goes through the entire AFE hosts table, and |
| 13 | # identifies unlocked hosts that would otherwise be flagged as "not |
| 14 | # working due to lack of activity", and forces a Verify job. |
| 15 | # |
| 16 | # Locked hosts are skipped because they can't run jobs, and because |
| 17 | # we want them to show up as suspicious anyway. |
| 18 | |
| 19 | |
| 20 | cd $(dirname $0)/.. |
| 21 | |
| 22 | # Gather all the hosts under supervision of the SKC fire team. |
| 23 | # Basically, that's any host in the suites, bvt, cq, or pfq pool. |
| 24 | |
| 25 | GET_HOSTS=' |
Xuhui Peng | d0631de | 2017-09-18 20:58:27 +0000 | [diff] [blame^] | 26 | /pool:(suites|bvt|cq|continuous|cts|arc-presubmit|crosperf|performance)/ { |
J. Richard Barnette | d24b2fd | 2015-01-12 17:42:37 -0800 | [diff] [blame] | 27 | print $1 |
| 28 | } |
| 29 | ' |
| 30 | HOSTS=( $(cli/atest host list --unlocked | awk "$GET_HOSTS") ) |
| 31 | |
| 32 | |
| 33 | # Go through the gathered hosts, and use dut_status to find the |
| 34 | # ones with unknown state (anything without a positive "OK" or |
| 35 | # "NO" diagnosis). |
| 36 | |
| 37 | NEED_VERIFY=' |
| 38 | /OK/ || /NO/ { next } |
| 39 | /^chromeos/ { |
| 40 | print $1 |
| 41 | } |
| 42 | ' |
J. Richard Barnette | b403434 | 2015-02-20 09:37:44 -0800 | [diff] [blame] | 43 | VERIFY=( $(site_utils/dut_status.py -d 19 "${HOSTS[@]}" | awk "$NEED_VERIFY") ) |
J. Richard Barnette | d24b2fd | 2015-01-12 17:42:37 -0800 | [diff] [blame] | 44 | |
| 45 | # Reverify the unknown hosts. |
| 46 | contrib/reverify_hosts "${VERIFY[@]}" |