How to use rpmlint - 10 common examples

To help you get started, we’ve selected a few rpmlint examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rpm-software-management / rpmlint / test / test_helpers.py View on Github external
def test_bytetostr():
    """
    Test bytetostr function
    """
    list_items = (
        b'\xc5\xbe\xc3\xad\xc5\xbeala',
        'texty',
    )
    item = b'p\xc5\x99\xc3\xad\xc5\xa1ern\xc4\x9b \xc5\xbelu\xc5\xa5ou\xc4\x8dk\xc3\xbd k\xc5\xaf\xc5\x88'

    result = helpers.byte_to_string(item)
    assert isinstance(result, str)
    assert result == 'příšerně žluťoučký kůň'

    result = helpers.byte_to_string(list_items)
    assert isinstance(result, list)
    assert result[0] == 'žížala'
github rpm-software-management / rpmlint / test / test_helpers.py View on Github external
def test_warnprint(capsys):
    """
    Check we print stuff to stderr
    """
    message = 'I am writing to stderr'
    helpers.print_warning(message)
    out, err = capsys.readouterr()
    assert message not in out
    assert message in err
github rpm-software-management / rpmlint / test / Testing.py View on Github external
def get_tested_spec_package(name):
    filename = Path(name).name + '.spec'
    pkg_path = list(get_tested_path(name).parent.glob(filename))[0]
    return FakePkg(pkg_path)
github rpm-software-management / rpmlint / test / test_readelf_parser.py View on Github external
def test_lto_archive_text(binariescheck):
    output, test = binariescheck
    test.run_elf_checks(FakePkg('fake'), get_full_path('stripped-lto.a'), 'x.a')
    out = output.print_results(output.results)
    assert 'E: lto-no-text-in-archive' in out
    assert 'E: static-library-without-debuginfo' in out
github rpm-software-management / rpmlint / test / test_ldd_parser.py View on Github external
def test_unused_dependency_in_package_for_executable(binariescheck):
    output, test = binariescheck
    test.run_elf_checks(FakePkg('fake'), get_full_path('appletviewer'), '/usr/bin/appletviewer')
    assert not test.readelf_parser.parsing_failed_reason()
    assert not test.ldd_parser.parsing_failed_reason
    out = output.print_results(output.results)
    assert 'W: unused-direct-shlib-dependency ' in out
github rpm-software-management / rpmlint / test / test_readelf_parser.py View on Github external
def test_lto_archive_preinit_array(binariescheck):
    output, test = binariescheck
    test.run_elf_checks(FakePkg('fake'), get_full_path('libclang_rt.asan-preinit-x86_64.a'), 'x.a')
    assert 'E: lto-no-text-in-archive' not in output.print_results(output.results)
github rpm-software-management / rpmlint / test / test_readelf_parser.py View on Github external
def test_stripped_archive(binariescheck):
    output, test = binariescheck
    test.run_elf_checks(FakePkg('fake'), get_full_path('stripped-archive.a'), 'x.a')
    out = output.print_results(output.results)
    assert 'E: static-library-without-symtab' in out
github rpm-software-management / rpmlint / test / test_readelf_parser.py View on Github external
def test_lto_archive_text_function_sections(binariescheck):
    output, test = binariescheck
    test.run_elf_checks(FakePkg('fake'), get_full_path('function-sections.a'), 'x.a')
    assert 'E: lto-no-text-in-archive' not in output.print_results(output.results)
github rpm-software-management / rpmlint / test / test_readelf_parser.py View on Github external
def test_executable_stack(binariescheck):
    output, test = binariescheck
    test.run_elf_checks(FakePkg('fake'), get_full_path('executable-stack'), 'a.out')
    assert 'E: executable-stack' in output.results[0]
github rpm-software-management / rpmlint / test / test_build_date.py View on Github external
def builddatecheck():
    CONFIG.info = True
    output = Filter(CONFIG)
    test = BuildDateCheck(CONFIG, output)
    return output, test