def run(self):
self._setup()<EOL>failure_handler = FailureHandler(self.master_config.mapping.get("<STR_LIT>"))<EOL>naarad_obj = Naarad()<EOL>for config in self.configs:<EOL><INDENT>config.mapping.iterkeys()<EOL>self._reset_tests()<EOL>if not failure_handler.get_abort_status():<EOL><INDENT>config.result = constants.SKIPPED<EOL>config.message += error_messages.CONFIG_ABORT<EOL>self._skip_all_tests()<EOL>logger.debug("<STR_LIT>" + config.name + "<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>runtime.set_active_config(config)<EOL>setup_fail = False<EOL>if not self.master_config.mapping.get("<STR_LIT>", False):<EOL><INDENT>try:<EOL><INDENT>naarad_config_file = self.dynamic_config_module.naarad_config()<EOL><DEDENT>except TypeError: <EOL><INDENT>naarad_config_file = self.dynamic_config_module.naarad_config(config.mapping)<EOL><DEDENT>config.naarad_id = naarad_obj.signal_start(naarad_config_file)<EOL><DEDENT>config.start_time = time.time()<EOL>logger.info("<STR_LIT>" + config.name)<EOL>try:<EOL><INDENT>if hasattr(self.deployment_module, '<STR_LIT>'):<EOL><INDENT>self.deployment_module.setup_suite()<EOL><DEDENT><DEDENT>except BaseException:<EOL><INDENT>config.result = constants.SKIPPED<EOL>config.message += error_messages.SETUP_SUITE_FAILED + traceback.format_exc()<EOL>self._skip_all_tests()<EOL>setup_fail = True<EOL>failure_handler.notify_failure()<EOL>logger.error("<STR_LIT>".format(config.name, traceback.format_exc()))<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>logger.debug("<STR_LIT>" + config.name)<EOL>self._execute_run(config, naarad_obj)<EOL>logger.debug("<STR_LIT>" + config.name)<EOL><DEDENT>finally:<EOL><INDENT>try:<EOL><INDENT>if hasattr(self.deployment_module, '<STR_LIT>'):<EOL><INDENT>self.deployment_module.teardown_suite()<EOL><DEDENT>if not setup_fail:<EOL><INDENT>failure_handler.notify_success()<EOL><DEDENT><DEDENT>except BaseException:<EOL><INDENT>config.message += error_messages.TEARDOWN_SUITE_FAILED + traceback.format_exc()<EOL>if not setup_fail:<EOL><INDENT>failure_handler.notify_failure()<EOL><DEDENT>logger.error("<STR_LIT>".format(config.name, traceback.format_exc()))<EOL><DEDENT><DEDENT><DEDENT>finally:<EOL><INDENT>for deployer in runtime.get_deployers():<EOL><INDENT>deployer.kill_all_process()<EOL><DEDENT><DEDENT>config.end_time = time.time()<EOL>logger.info("<STR_LIT>".format(config.name))<EOL><DEDENT>tests = [test for test in self.tests if not isinstance(test, list)] +[individual_test for test in self.tests if isinstance(test, list) for individual_test in test]<EOL>runtime.get_collector().collect(config, tests)<EOL>self._log_results(tests)<EOL><DEDENT>self.reporter.data_source.end_time = time.time()<EOL>self.reporter.generate()<EOL>if self.master_config.mapping.get("<STR_LIT>", False) and not  self.master_config.mapping.get("<STR_LIT>", False):<EOL><INDENT>self._display_results()<EOL><DEDENT>
This is the main executable function that will run the test