myjob.record("END ABORT", None, None, str(instance)) assert myjob._record_indent == 0 myjob.complete(1) else: sys.exit(1) except Exception, e: # NOTE: job._run_step_fn and job.step_engine will turn things into # a JobError for us. If we get here, its likely an autotest bug. msg = str(e) + "\n" + traceback.format_exc() logging.critical("JOB ERROR (autotest bug?): " + msg) if myjob: myjob.record("END ABORT", None, None, msg) assert myjob._record_indent == 0 myjob.complete(1) else: sys.exit(1) # If we get here, then we assume the job is complete and good. myjob.record("END GOOD", None, None) assert myjob._record_indent == 0 myjob.complete(0) site_job = utils.import_site_class(__file__, "autotest.client.site_job", "site_job", base_client_job) class job(site_job): pass
def check_mount_point(self, part_name, mount_point): """ :param part_name: A partition name such as 'sda3' or similar. :param mount_point: A mount point such as '/usr/local' or an empty string if no mount point is known. :return: The expected mount point for part_name or a false value (None or '') if the client should not mount this partition. """ return mount_point def use_partition(self, part_name): """ :param part_name: A partition name such as 'sda3' or similar. :return: bool, should we use this partition for testing? """ return True SiteFsdevManager = utils.import_site_class( __file__, "autotest.client.site_fsdev", "SiteFsdevManager", BaseFsdevManager) # Wrap whatever SiteFsdevManager class we've found above in a class class FsdevManager(SiteFsdevManager): pass
def flush(self): sys.stdout.flush() def flush_all_buffers(self): if self.leftover: self._process_line(self.leftover) self.leftover = "" self._process_logs() self.flush() def close(self): self.flush_all_buffers() SiteAutotest = client_utils.import_site_class( __file__, "autotest.server.site_autotest", "SiteAutotest", BaseAutotest) _SiteRun = client_utils.import_site_class( __file__, "autotest.server.site_autotest", "_SiteRun", _BaseRun) class Autotest(SiteAutotest): pass class _Run(_SiteRun): pass
assert myjob._record_indent == 0 myjob.complete(1) else: sys.exit(1) except Exception as e: # NOTE: job._run_step_fn and job.step_engine will turn things into # a JobError for us. If we get here, its likely an autotest bug. msg = str(e) + '\n' + traceback.format_exc() logging.critical("JOB ERROR (autotest bug?): " + msg) if myjob: myjob.record('END ABORT', None, None, msg) assert myjob._record_indent == 0 myjob.complete(1) else: sys.exit(1) # If we get here, then we assume the job is complete and good. myjob.record('END GOOD', None, None) assert myjob._record_indent == 0 myjob.complete(0) site_job = utils.import_site_class( __file__, "autotest.client.site_job", "site_job", base_client_job) class job(site_job): pass
def check_mount_point(self, part_name, mount_point): """ :param part_name: A partition name such as 'sda3' or similar. :param mount_point: A mount point such as '/usr/local' or an empty string if no mount point is known. :return: The expected mount point for part_name or a false value (None or '') if the client should not mount this partition. """ return mount_point def use_partition(self, part_name): """ :param part_name: A partition name such as 'sda3' or similar. :return: bool, should we use this partition for testing? """ return True SiteFsdevManager = utils.import_site_class(__file__, "autotest.client.site_fsdev", "SiteFsdevManager", BaseFsdevManager) # Wrap whatever SiteFsdevManager class we've found above in a class class FsdevManager(SiteFsdevManager): pass