aboutsummaryrefslogtreecommitdiff
path: root/remote_test.py
diff options
context:
space:
mode:
authorLuis Lozano <llozano@chromium.org>2013-03-15 14:44:13 -0700
committerChromeBot <chrome-bot@google.com>2013-03-15 15:51:37 -0700
commitf81680c018729fd4499e1e200d04b48c4b90127c (patch)
tree940608da8374604b82edfdb2d7df55d065f05d4c /remote_test.py
parent2296ee0b914aba5bba07becab4ff68884ce9b8a5 (diff)
downloadtoolchain-utils-f81680c018729fd4499e1e200d04b48c4b90127c.tar.gz
Cleaned up directory after copy of tools from perforce directory
Got rid of stale copies of some tools like "crosperf" and moved all files under v14 directory (that came from perforce) into the top directory. BUG=None TEST=None Change-Id: I408d17a36ceb00e74db71403d2351fd466a14f8e Reviewed-on: https://gerrit-int.chromium.org/33887 Tested-by: Luis Lozano <llozano@chromium.org> Reviewed-by: Yunlian Jiang <yunlian@google.com> Commit-Queue: Luis Lozano <llozano@chromium.org>
Diffstat (limited to 'remote_test.py')
-rwxr-xr-xremote_test.py93
1 files changed, 93 insertions, 0 deletions
diff --git a/remote_test.py b/remote_test.py
new file mode 100755
index 00000000..2ef27f9d
--- /dev/null
+++ b/remote_test.py
@@ -0,0 +1,93 @@
+#!/usr/bin/python2.6
+#
+# Copyright 2010 Google Inc. All Rights Reserved.
+
+"""Script to wrap run_remote_tests.sh script.
+
+This script can login to the chromeos machine using the test private key.
+"""
+
+__author__ = "asharif@google.com (Ahmad Sharif)"
+
+import optparse
+import os
+import re
+import sys
+
+from utils import command_executer
+from utils import misc
+
+
+def Usage(parser, message):
+ print "ERROR: " + message
+ parser.print_help()
+ sys.exit(0)
+
+def Main(argv):
+ parser = optparse.OptionParser()
+ parser.add_option("-c", "--chromeos_root", dest="chromeos_root",
+ help="ChromeOS root checkout directory")
+ parser.add_option("-r", "--remote", dest="remote",
+ help="Remote chromeos device.")
+ options = parser.parse_args(argv)[0]
+ if options.chromeos_root is None:
+ Usage(parser, "chromeos_root must be given")
+
+ if options.remote is None:
+ Usage(parser, "remote must be given")
+
+ options.chromeos_root = os.path.expanduser(options.chromeos_root)
+
+ command = "ls -lt /"
+ ce = command_executer.GetCommandExecuter()
+ ce.CrosRunCommand(command,
+ chromeos_root=options.chromeos_root,
+ machine=options.remote)
+
+ version_dir_path, script_name = misc.GetRoot(sys.argv[0])
+ version_dir = misc.GetRoot(version_dir_path)[1]
+
+ # Tests to copy directories and files to the chromeos box.
+ ce.CopyFiles(version_dir_path,
+ "/tmp/" + version_dir,
+ dest_machine=options.remote,
+ dest_cros=True,
+ chromeos_root=options.chromeos_root)
+ ce.CopyFiles(version_dir_path,
+ "/tmp/" + version_dir + "1",
+ dest_machine=options.remote,
+ dest_cros=True,
+ chromeos_root=options.chromeos_root)
+ ce.CopyFiles(sys.argv[0],
+ "/tmp/" + script_name,
+ recursive=False,
+ dest_machine=options.remote,
+ dest_cros=True,
+ chromeos_root=options.chromeos_root)
+ ce.CopyFiles(sys.argv[0],
+ "/tmp/" + script_name + "1",
+ recursive=False,
+ dest_machine=options.remote,
+ dest_cros=True,
+ chromeos_root=options.chromeos_root)
+
+ # Test to copy directories and files from the chromeos box.
+ ce.CopyFiles("/tmp/" + script_name,
+ "/tmp/hello",
+ recursive=False,
+ src_machine=options.remote,
+ src_cros=True,
+ chromeos_root=options.chromeos_root)
+ ce.CopyFiles("/tmp/" + script_name,
+ "/tmp/" + script_name,
+ recursive=False,
+ src_machine=options.remote,
+ src_cros=True,
+ chromeos_root=options.chromeos_root)
+ board = ce.CrosLearnBoard(options.chromeos_root, options.remote)
+ print board
+ return 0
+
+
+if __name__ == "__main__":
+ Main(sys.argv)