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

Side by Side Diff: bin/cros_au_test_harness.py

Issue 6384012: Fix sudo again. (Closed) Base URL: http://git.chromium.org/git/crosutils.git@master
Patch Set: Created 9 years, 10 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """This module runs a suite of Auto Update tests. 7 """This module runs a suite of Auto Update tests.
8 8
9 The tests can be run on either a virtual machine or actual device depending 9 The tests can be run on either a virtual machine or actual device depending
10 on parameters given. Specific tests can be run by invoking --test_prefix. 10 on parameters given. Specific tests can be run by invoking --test_prefix.
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 """A Simple wrapper around a devserver instance.""" 725 """A Simple wrapper around a devserver instance."""
726 726
727 def __init__(self): 727 def __init__(self):
728 self.proc = None 728 self.proc = None
729 threading.Thread.__init__(self) 729 threading.Thread.__init__(self)
730 730
731 def run(self): 731 def run(self):
732 # Kill previous running instance of devserver if it exists. 732 # Kill previous running instance of devserver if it exists.
733 RunCommand(['sudo', 'pkill', '-f', 'devserver.py', ], error_ok=True, 733 RunCommand(['sudo', 'pkill', '-f', 'devserver.py', ], error_ok=True,
734 print_cmd=False) 734 print_cmd=False)
735 self.proc = subprocess.Popen(['./start_devserver', 735 self.proc = subprocess.Popen(['sudo',
736 './start_devserver',
736 '--archive_dir=./static', 737 '--archive_dir=./static',
737 '--client_prefix=ChromeOSUpdateEngine', 738 '--client_prefix=ChromeOSUpdateEngine',
738 '--production', 739 '--production',
739 ]) 740 ])
740 self.proc.communicate() 741 self.proc.communicate()
741 742
742 def Stop(self): 743 def Stop(self):
743 """Kills the devserver instance.""" 744 """Kills the devserver instance."""
744 self.proc.kill() 745 self.proc.kill()
745 746
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 else: 946 else:
946 dev_server_cache = None 947 dev_server_cache = None
947 test_suite = _PrepareTestSuite(parser, options, test_class) 948 test_suite = _PrepareTestSuite(parser, options, test_class)
948 test_result = unittest.TextTestRunner(verbosity=2).run(test_suite) 949 test_result = unittest.TextTestRunner(verbosity=2).run(test_suite)
949 if not test_result.wasSuccessful(): 950 if not test_result.wasSuccessful():
950 Die('Test harness was not successful.') 951 Die('Test harness was not successful.')
951 952
952 953
953 if __name__ == '__main__': 954 if __name__ == '__main__':
954 main() 955 main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698