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