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 |
raymes | 01959ae | 2013-02-15 04:50:07 +0000 | [diff] [blame] | 15 | from utils import command_executer |
asharif | 8c227da | 2013-02-15 04:35:52 +0000 | [diff] [blame] | 16 | |
asharif | 8c227da | 2013-02-15 04:35:52 +0000 | [diff] [blame] | 17 | |
| 18 | def Main(): |
| 19 | """The main function.""" |
| 20 | parser = optparse.OptionParser() |
| 21 | parser.add_option("-c", "--chromeos_root", dest="chromeos_root", |
| 22 | help="ChromeOS root checkout directory.") |
| 23 | parser.add_option("-r", "--remote", dest="remote", |
| 24 | help="The IP address of the remote ChromeOS machine.") |
| 25 | parser.add_option("-b", "--board", dest="board", |
| 26 | help="The board of the target.") |
| 27 | |
| 28 | tests = "BuildVerify" |
| 29 | |
| 30 | (options, args) = parser.parse_args() |
| 31 | |
| 32 | if options.board is None or options.remote is None: |
| 33 | parser.print_help() |
| 34 | sys.exit() |
| 35 | |
| 36 | if options.chromeos_root is None: |
| 37 | options.chromeos_root = "../.." |
| 38 | |
| 39 | tests += " " + " ".join(args) |
| 40 | return RunRemoteTests(options.chromeos_root, options.remote, |
| 41 | options.board, tests) |
| 42 | |
| 43 | |
| 44 | def RunRemoteTests(chromeos_root, remote, board, tests): |
| 45 | """Run the remote tests.""" |
| 46 | command = (chromeos_root + "/src/scripts/run_remote_tests.sh" + |
| 47 | " --remote=" + remote + |
| 48 | " --board=" + board + |
| 49 | " " + tests) |
| 50 | |
asharif | 967d700 | 2013-02-15 04:51:00 +0000 | [diff] [blame] | 51 | retval = command_executer.GetCommandExecuter().RunCommand(command) |
asharif | 8c227da | 2013-02-15 04:35:52 +0000 | [diff] [blame] | 52 | return retval |
| 53 | |
| 54 | if __name__ == "__main__": |
| 55 | Main() |