| OLD | NEW |
| 1 import atexit, datetime, os, tempfile, unittest | 1 import atexit, datetime, os, tempfile, unittest |
| 2 import common | 2 import common |
| 3 from autotest_lib.frontend import setup_test_environment | 3 from autotest_lib.frontend import setup_test_environment |
| 4 from autotest_lib.frontend import thread_local | 4 from autotest_lib.frontend import thread_local |
| 5 from autotest_lib.frontend.afe import models, model_attributes | 5 from autotest_lib.frontend.afe import models, model_attributes |
| 6 from autotest_lib.client.common_lib import global_config | 6 from autotest_lib.client.common_lib import global_config |
| 7 from autotest_lib.client.common_lib.test_utils import mock | 7 from autotest_lib.client.common_lib.test_utils import mock |
| 8 | 8 |
| 9 class FrontendTestMixin(object): | 9 class FrontendTestMixin(object): |
| 10 def _fill_in_test_data(self): | 10 def _fill_in_test_data(self): |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 self.hosts[hostnum].labels.add(self.label5) # an atomic group lavel | 61 self.hosts[hostnum].labels.add(self.label5) # an atomic group lavel |
| 62 self.hosts[hostnum].labels.add(self.label6) # a normal label | 62 self.hosts[hostnum].labels.add(self.label6) # a normal label |
| 63 self.hosts[hostnum].labels.add(self.label7) | 63 self.hosts[hostnum].labels.add(self.label7) |
| 64 | 64 |
| 65 | 65 |
| 66 def _frontend_common_setup(self, fill_data=True): | 66 def _frontend_common_setup(self, fill_data=True): |
| 67 self.god = mock.mock_god(ut=self) | 67 self.god = mock.mock_god(ut=self) |
| 68 setup_test_environment.set_up() | 68 setup_test_environment.set_up() |
| 69 global_config.global_config.override_config_value( | 69 global_config.global_config.override_config_value( |
| 70 'AUTOTEST_WEB', 'parameterized_jobs', 'False') | 70 'AUTOTEST_WEB', 'parameterized_jobs', 'False') |
| 71 global_config.global_config.override_config_value( |
| 72 'SERVER', 'rpc_logging', 'False') |
| 73 |
| 71 if fill_data: | 74 if fill_data: |
| 72 self._fill_in_test_data() | 75 self._fill_in_test_data() |
| 73 | 76 |
| 74 | 77 |
| 75 def _frontend_common_teardown(self): | 78 def _frontend_common_teardown(self): |
| 76 setup_test_environment.tear_down() | 79 setup_test_environment.tear_down() |
| 77 thread_local.set_user(None) | 80 thread_local.set_user(None) |
| 78 self.god.unstub_all() | 81 self.god.unstub_all() |
| 79 | 82 |
| 80 | 83 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 def _create_job_simple(self, hosts, use_metahost=False, | 146 def _create_job_simple(self, hosts, use_metahost=False, |
| 144 priority=0, active=False, drone_set=None): | 147 priority=0, active=False, drone_set=None): |
| 145 """An alternative interface to _create_job""" | 148 """An alternative interface to _create_job""" |
| 146 args = {'hosts' : [], 'metahosts' : []} | 149 args = {'hosts' : [], 'metahosts' : []} |
| 147 if use_metahost: | 150 if use_metahost: |
| 148 args['metahosts'] = hosts | 151 args['metahosts'] = hosts |
| 149 else: | 152 else: |
| 150 args['hosts'] = hosts | 153 args['hosts'] = hosts |
| 151 return self._create_job(priority=priority, active=active, | 154 return self._create_job(priority=priority, active=active, |
| 152 drone_set=drone_set, **args) | 155 drone_set=drone_set, **args) |
| OLD | NEW |