asharif | bb91850 | 2013-02-15 05:15:01 +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 can login to the chromeos machine using the test private key. |
| 8 | """ |
| 9 | |
| 10 | __author__ = "asharif@google.com (Ahmad Sharif)" |
| 11 | |
| 12 | import optparse |
| 13 | import os |
| 14 | import re |
| 15 | import sys |
| 16 | from utils import command_executer |
| 17 | from utils import utils |
| 18 | |
| 19 | |
| 20 | def Usage(parser, message): |
| 21 | print "ERROR: " + message |
| 22 | parser.print_help() |
| 23 | sys.exit(0) |
| 24 | |
| 25 | def Main(argv): |
| 26 | parser = optparse.OptionParser() |
| 27 | parser.add_option("-c", "--chromeos_root", dest="chromeos_root", |
| 28 | help="ChromeOS root checkout directory") |
| 29 | parser.add_option("-r", "--remote", dest="remote", |
| 30 | help="Remote chromeos device.") |
| 31 | options = parser.parse_args(argv)[0] |
| 32 | if options.chromeos_root is None: |
| 33 | Usage(parser, "chromeos_root must be given") |
| 34 | |
| 35 | if options.remote is None: |
| 36 | Usage(parser, "remote must be given") |
| 37 | |
| 38 | options.chromeos_root = os.path.expanduser(options.chromeos_root) |
| 39 | |
| 40 | command = "ls -lt /" |
| 41 | ce = command_executer.GetCommandExecuter() |
| 42 | ce.CrosRunCommand(command, |
| 43 | chromeos_root=options.chromeos_root, |
| 44 | machine=options.remote) |
| 45 | |
| 46 | version_dir = utils.GetRoot(sys.argv[0])[0] |
| 47 | ce.CopyFiles(version_dir, |
| 48 | "/tmp", |
| 49 | dest_machine=options.remote, |
| 50 | dest_cros=True, |
| 51 | chromeos_root=options.chromeos_root) |
| 52 | board = ce.CrosLearnBoard(options.chromeos_root, "172.18.117.239") |
| 53 | print board |
| 54 | |
| 55 | |
| 56 | if __name__ == "__main__": |
| 57 | Main(sys.argv) |