Example #1
0
    for this program.
    """
    def configure_logging(self, results_dir=None, verbose=False):
        super(LoggingConfig, self).configure_logging(use_console=True,
                                                     verbose=verbose)


def _retrieve_dummy(job_path):
    '''
    Dummy function for retrieving host and logs
    '''
    pass


site_retrieve_logs = utils.import_site_function(
    __file__, "autotest.tko.site_retrieve_logs", "site_retrieve_logs",
    _retrieve_dummy)

site_find_repository_host = utils.import_site_function(
    __file__, "autotest.tko.site_retrieve_logs", "site_find_repository_host",
    _retrieve_dummy)


def find_repository_host(job_path):
    '''
    Find the machine holding the given logs and return a URL to the logs

    :param job_path: when this was a CGI script, this value came from the
                    'job' variable, which was usually composed of '/results/' +
                    a path such as '1-autotest' or '1-autotest/status.log'
    :type job_path: str
Example #2
0
def srpm_kernel_vendor(job, rpm_package, subdir):
    d = distro.detect()
    if d.name == "sles":
        return srpm_kernel_suse(job, rpm_package, subdir)
    else:
        return srpm_kernel(job, rpm_package, subdir)


# just make the preprocessor a nop
def _preprocess_path_dummy(path):
    return path.strip()


# pull in some optional site-specific path pre-processing
preprocess_path = utils.import_site_function(__file__,
                                             "autotest.client.site_kernel", "preprocess_path",
                                             _preprocess_path_dummy)


def auto_kernel(job, path, subdir, tmp_dir, build_dir, leave=False):
    """
    Create a kernel object, dynamically selecting the appropriate class to use
    based on the path provided.
    """
    kernel_paths = [preprocess_path(path)]
    if kernel_paths[0].endswith('.list'):
        # Fetch the list of packages to install
        kernel_list = os.path.join(tmp_dir, 'kernel.list')
        utils.get_file(kernel_paths[0], kernel_list)
        kernel_paths = [p.strip() for p in open(kernel_list).readlines()]
Example #3
0
def rpm_kernel_vendor(job, rpm_package, subdir):
    vendor = utils.get_os_vendor()
    if vendor == "SUSE":
        return rpm_kernel_suse(job, rpm_package, subdir)
    else:
        return rpm_kernel(job, rpm_package, subdir)


# just make the preprocessor a nop
def _preprocess_path_dummy(path):
    return path.strip()


# pull in some optional site-specific path pre-processing
preprocess_path = utils.import_site_function(__file__,
                                             "autotest.client.site_kernel", "preprocess_path",
                                             _preprocess_path_dummy)


def auto_kernel(job, path, subdir, tmp_dir, build_dir, leave=False):
    """
    Create a kernel object, dynamically selecting the appropriate class to use
    based on the path provided.
    """
    kernel_paths = [preprocess_path(path)]
    if kernel_paths[0].endswith('.list'):
        # Fetch the list of packages to install
        kernel_list = os.path.join(tmp_dir, 'kernel.list')
        utils.get_file(kernel_paths[0], kernel_list)
        kernel_paths = [p.strip() for p in open(kernel_list).readlines()]
Example #4
0
    """

    def configure_logging(self, results_dir=None, verbose=False):
        super(LoggingConfig, self).configure_logging(use_console=True,
                                                     verbose=verbose)


def _retrieve_dummy(job_path):
    '''
    Dummy function for retrieving host and logs
    '''
    pass


site_retrieve_logs = utils.import_site_function(__file__,
                                                "autotest.tko.site_retrieve_logs", "site_retrieve_logs",
                                                _retrieve_dummy)


site_find_repository_host = utils.import_site_function(__file__,
                                                       "autotest.tko.site_retrieve_logs", "site_find_repository_host",
                                                       _retrieve_dummy)


def find_repository_host(job_path):
    '''
    Find the machine holding the given logs and return a URL to the logs

    :param job_path: when this was a CGI script, this value came from the
                    'job' variable, which was usually composed of '/results/' +
                    a path such as '1-autotest' or '1-autotest/status.log'