blob: 0c3e1b058021f917257980118aa1f833f62ca556 [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
15from utils import utils
16
17# Common initializations
18(rootdir, basename) = utils.GetRoot(sys.argv[0])
19utils.InitLogger(rootdir, basename)
20
21
22def 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
48def 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
58if __name__ == "__main__":
59 Main()