Mike Frysinger | d03e6b5 | 2019-08-03 12:49:01 -0400 | [diff] [blame] | 1 | #!/usr/bin/python2 |
J. Richard Barnette | d42a091 | 2014-11-18 17:03:53 -0800 | [diff] [blame] | 2 | # Simple utility to trigger a Verify job on a bunch of hosts. |
| 3 | # |
| 4 | # CAVEAT: no error checking; if any argument isn't a valid |
| 5 | # host, it will be silently ignored. If there are no command |
| 6 | # line arguments, silently succeed. |
| 7 | |
| 8 | import sys |
| 9 | |
| 10 | import common |
| 11 | |
| 12 | from autotest_lib.server import frontend |
| 13 | |
Richard Barnette | 73e74b0 | 2017-08-10 15:16:49 -0700 | [diff] [blame] | 14 | # For simplicity, we want to do nothing if there are no hosts named |
| 15 | # on the command line. That makes it easy to do stuff like this: |
| 16 | # dut-status -b $BOARD -p bvt -n | xargs reverify_hosts |
| 17 | # |
| 18 | # By doing nothing, we get more useful behavior if all the DUTs selected |
| 19 | # by `dut-status` are actually working. |
| 20 | # |
| 21 | # Note that we have to specifically test for an empty host list: I |
| 22 | # _think_ (but I don't know) that the AFE calls operate on all the |
J. Richard Barnette | d42a091 | 2014-11-18 17:03:53 -0800 | [diff] [blame] | 23 | # hosts if there are no arguments given. I do know for certain that |
| 24 | # with hostnames=[], the call takes longer than I was willing to |
| 25 | # wait. |
J. Richard Barnette | d42a091 | 2014-11-18 17:03:53 -0800 | [diff] [blame] | 26 | |
| 27 | if len(sys.argv) >= 2: |
| 28 | frontend.AFE().reverify_hosts(hostnames=sys.argv[1:]) |