blob: aafbafd4bcafa297189912646ad98eb610f35b21 [file] [log] [blame]
J. Richard Barnetted24b2fd2015-01-12 17:42:37 -08001#!/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
20cd $(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
25GET_HOSTS='
Xuhui Pengd0631de2017-09-18 20:58:27 +000026 /pool:(suites|bvt|cq|continuous|cts|arc-presubmit|crosperf|performance)/ {
J. Richard Barnetted24b2fd2015-01-12 17:42:37 -080027 print $1
28 }
29'
30HOSTS=( $(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
37NEED_VERIFY='
38 /OK/ || /NO/ { next }
39 /^chromeos/ {
40 print $1
41 }
42'
J. Richard Barnetteb4034342015-02-20 09:37:44 -080043VERIFY=( $(site_utils/dut_status.py -d 19 "${HOSTS[@]}" | awk "$NEED_VERIFY") )
J. Richard Barnetted24b2fd2015-01-12 17:42:37 -080044
45# Reverify the unknown hosts.
46contrib/reverify_hosts "${VERIFY[@]}"