blob: 2f3f2fd5f9eb551fabe979e488bb35e71b57c5f2 [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
asharifea33a562013-02-15 04:56:09 +000028 tests = "bvt"
asharif8c227da2013-02-15 04:35:52 +000029
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
asharifea33a562013-02-15 04:56:09 +000039 if args:
40 tests = " " + " ".join(args)
asharif8c227da2013-02-15 04:35:52 +000041 return RunRemoteTests(options.chromeos_root, options.remote,
42 options.board, tests)
43
44
45def RunRemoteTests(chromeos_root, remote, board, tests):
46 """Run the remote tests."""
47 command = (chromeos_root + "/src/scripts/run_remote_tests.sh" +
48 " --remote=" + remote +
49 " --board=" + board +
50 " " + tests)
51
asharif967d7002013-02-15 04:51:00 +000052 retval = command_executer.GetCommandExecuter().RunCommand(command)
asharif8c227da2013-02-15 04:35:52 +000053 return retval
54
55if __name__ == "__main__":
56 Main()