asharif | 8c227da | 2013-02-15 04:35:52 +0000 | [diff] [blame^] | 1 | #!/usr/bin/python2.6 |
| 2 | # |
| 3 | # Copyright 2010 Google Inc. All Rights Reserved. |
| 4 | |
| 5 | """Script to wrap run_remote_tests.sh script. |
| 6 | |
| 7 | This script calls run_remote_tests.sh with standard tests. |
| 8 | """ |
| 9 | |
| 10 | __author__ = "asharif@google.com (Ahmad Sharif)" |
| 11 | |
| 12 | import optparse |
| 13 | import os |
| 14 | import sys |
| 15 | from utils import utils |
| 16 | |
| 17 | # Common initializations |
| 18 | (rootdir, basename) = utils.GetRoot(sys.argv[0]) |
| 19 | utils.InitLogger(rootdir, basename) |
| 20 | |
| 21 | |
| 22 | def Main(): |
| 23 | """The main function.""" |
| 24 | parser = optparse.OptionParser() |
| 25 | parser.add_option("-c", "--chromeos_root", dest="chromeos_root", |
| 26 | help="ChromeOS root checkout directory.") |
| 27 | parser.add_option("-r", "--remote", dest="remote", |
| 28 | help="The IP address of the remote ChromeOS machine.") |
| 29 | parser.add_option("-b", "--board", dest="board", |
| 30 | help="The board of the target.") |
| 31 | |
| 32 | tests = "BuildVerify" |
| 33 | |
| 34 | (options, args) = parser.parse_args() |
| 35 | |
| 36 | if options.board is None or options.remote is None: |
| 37 | parser.print_help() |
| 38 | sys.exit() |
| 39 | |
| 40 | if options.chromeos_root is None: |
| 41 | options.chromeos_root = "../.." |
| 42 | |
| 43 | tests += " " + " ".join(args) |
| 44 | return RunRemoteTests(options.chromeos_root, options.remote, |
| 45 | options.board, tests) |
| 46 | |
| 47 | |
| 48 | def RunRemoteTests(chromeos_root, remote, board, tests): |
| 49 | """Run the remote tests.""" |
| 50 | command = (chromeos_root + "/src/scripts/run_remote_tests.sh" + |
| 51 | " --remote=" + remote + |
| 52 | " --board=" + board + |
| 53 | " " + tests) |
| 54 | |
| 55 | retval = utils.RunCommand(command) |
| 56 | return retval |
| 57 | |
| 58 | if __name__ == "__main__": |
| 59 | Main() |