| OLD | NEW |
| 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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 This method effectively pre-generates the dev server cache for all tests. | 705 This method effectively pre-generates the dev server cache for all tests. |
| 706 | 706 |
| 707 Args: | 707 Args: |
| 708 parser: parser from main. | 708 parser: parser from main. |
| 709 options: options from parsed parser. | 709 options: options from parsed parser. |
| 710 Returns: | 710 Returns: |
| 711 Array of output from generating updates. | 711 Array of output from generating updates. |
| 712 """ | 712 """ |
| 713 def _GenerateVMUpdate(target, src): | 713 def _GenerateVMUpdate(target, src): |
| 714 """Generates an update using the devserver.""" | 714 """Generates an update using the devserver.""" |
| 715 RunCommand(['./start_devserver', | 715 RunCommand(['sudo', |
| 716 './start_devserver', |
| 716 '--pregenerate_update', | 717 '--pregenerate_update', |
| 717 '--exit', | 718 '--exit', |
| 718 '--image=%s' % target, | 719 '--image=%s' % target, |
| 719 '--src_image=%s' % src, | 720 '--src_image=%s' % src, |
| 720 '--for_vm' | 721 '--for_vm' |
| 721 ]) | 722 ], enter_chroot=True) |
| 722 | 723 |
| 723 # Get the list of deltas by mocking out update method in test class. | 724 # Get the list of deltas by mocking out update method in test class. |
| 724 GenerateVirtualAUDeltasTest.ProcessOptions(parser, options) | 725 GenerateVirtualAUDeltasTest.ProcessOptions(parser, options) |
| 725 test_loader = unittest.TestLoader() | 726 test_loader = unittest.TestLoader() |
| 726 test_loader.testMethodPrefix = options.test_prefix | 727 test_loader.testMethodPrefix = options.test_prefix |
| 727 test_suite = test_loader.loadTestsFromTestCase(GenerateVirtualAUDeltasTest) | 728 test_suite = test_loader.loadTestsFromTestCase(GenerateVirtualAUDeltasTest) |
| 728 test_result = unittest.TextTestRunner(verbosity=0).run(test_suite) | 729 test_result = unittest.TextTestRunner(verbosity=0).run(test_suite) |
| 729 | 730 |
| 730 Info('The following delta updates are required.') | 731 Info('The following delta updates are required.') |
| 731 jobs = [] | 732 jobs = [] |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 test_loader = unittest.TestLoader() | 790 test_loader = unittest.TestLoader() |
| 790 test_loader.testMethodPrefix = options.test_prefix | 791 test_loader.testMethodPrefix = options.test_prefix |
| 791 test_suite = test_loader.loadTestsFromTestCase(test_class) | 792 test_suite = test_loader.loadTestsFromTestCase(test_class) |
| 792 test_result = unittest.TextTestRunner(verbosity=2).run(test_suite) | 793 test_result = unittest.TextTestRunner(verbosity=2).run(test_suite) |
| 793 if not test_result.wasSuccessful(): | 794 if not test_result.wasSuccessful(): |
| 794 Die('Test harness was not successful.') | 795 Die('Test harness was not successful.') |
| 795 | 796 |
| 796 | 797 |
| 797 if __name__ == '__main__': | 798 if __name__ == '__main__': |
| 798 main() | 799 main() |
| OLD | NEW |