blob: 54a144f467218fdaac7a6d3451345aef25444963 [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
asharif8c227da2013-02-15 04:35:52 +000017
18def 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
44def 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
asharif967d7002013-02-15 04:51:00 +000051 retval = command_executer.GetCommandExecuter().RunCommand(command)
asharif8c227da2013-02-15 04:35:52 +000052 return retval
53
54if __name__ == "__main__":
55 Main()