Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Side by Side Diff: au_test_harness/dev_server_wrapper.py

Issue 6736023: Install test scripts into chroot. (Closed) Base URL: http://git.chromium.org/git/crostestutils.git@master
Patch Set: Remove vm scripts from makefile Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « au_test_harness/cros_au_test_harness.py ('k') | au_test_harness/public_key_manager.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. 1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Module containing methods and classes to interact with a devserver instance. 5 """Module containing methods and classes to interact with a devserver instance.
6 """ 6 """
7 7
8 import os 8 import os
9 import threading 9 import threading
10 10
(...skipping 18 matching lines...) Expand all
29 # Kill previous running instance of devserver if it exists. 29 # Kill previous running instance of devserver if it exists.
30 cros_lib.RunCommand(['sudo', 'pkill', '-f', 'devserver.py'], error_ok=True, 30 cros_lib.RunCommand(['sudo', 'pkill', '-f', 'devserver.py'], error_ok=True,
31 print_cmd=False) 31 print_cmd=False)
32 cros_lib.RunCommand(['sudo', 32 cros_lib.RunCommand(['sudo',
33 'start_devserver', 33 'start_devserver',
34 '--archive_dir=./static', 34 '--archive_dir=./static',
35 '--client_prefix=ChromeOSUpdateEngine', 35 '--client_prefix=ChromeOSUpdateEngine',
36 '--production', 36 '--production',
37 ], enter_chroot=True, print_cmd=False, 37 ], enter_chroot=True, print_cmd=False,
38 log_to_file=os.path.join(self.test_root, 38 log_to_file=os.path.join(self.test_root,
39 'dev_server.log')) 39 'dev_server.log'),
40 cwd=cros_lib.GetCrosUtilsPath())
40 41
41 def Stop(self): 42 def Stop(self):
42 """Kills the devserver instance.""" 43 """Kills the devserver instance."""
43 cros_lib.RunCommand(['sudo', 'pkill', '-f', 'devserver.py'], error_ok=True, 44 cros_lib.RunCommand(['sudo', 'pkill', '-f', 'devserver.py'], error_ok=True,
44 print_cmd=False) 45 print_cmd=False)
45 46
46 @classmethod 47 @classmethod
47 def GetDevServerURL(cls, port, sub_dir): 48 def GetDevServerURL(cls, port, sub_dir):
48 """Returns the dev server url for a given port and sub directory.""" 49 """Returns the dev server url for a given port and sub directory."""
49 ip_addr = cros_lib.GetIPAddress() 50 ip_addr = cros_lib.GetIPAddress()
50 if not port: port = 8080 51 if not port: port = 8080
51 url = 'http://%(ip)s:%(port)s/%(dir)s' % {'ip': ip_addr, 52 url = 'http://%(ip)s:%(port)s/%(dir)s' % {'ip': ip_addr,
52 'port': str(port), 53 'port': str(port),
53 'dir': sub_dir} 54 'dir': sub_dir}
54 return url 55 return url
OLDNEW
« no previous file with comments | « au_test_harness/cros_au_test_harness.py ('k') | au_test_harness/public_key_manager.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698