示例#1
0
def test_missing_requires(capsys, package):
    '''Tests SCL metapackage without scl-utils-build (B)Rs'''
    pkg = getTestedSpecPackage(package)
    SCLCheck.check.check_spec(pkg, pkg.name)
    out, err = capsys.readouterr()
    assert 'scl-metapackage-without-scl-utils-build-br' in out
    assert 'scl-build-without-requiring-scl-utils-build' in out
示例#2
0
def test_noruntime(capsys, package):
    '''Tests SCL metapackage without runtime subpackage'''
    pkg = getTestedSpecPackage(package)
    SCLCheck.check.check_spec(pkg, pkg.name)
    out, err = capsys.readouterr()
    assert 'no-runtime-in-scl-metapackage' in out
    assert 'scl-main-metapackage-contains-files' in out
示例#3
0
def test_alien_subpackage(capsys, package):
    '''Tests SCL metapackage with extra subpackage'''
    pkg = getTestedSpecPackage(package)
    SCLCheck.check.check_spec(pkg, pkg.name)
    out, err = capsys.readouterr()
    assert 'weird-subpackage-in-scl-metapackage' in out
    assert 'hehe' in out
示例#4
0
def test_name_with_prefix_without_condition(capsys, package):
    '''
    Tests SCL spec with prefixed name without condition in scl_prefix macro
    '''
    pkg = getTestedSpecPackage(package)
    SCLCheck.check.check_spec(pkg, pkg.name)
    out, err = capsys.readouterr()
    assert 'scl-prefix-without-condition' in out
示例#5
0
def test_badfiles(capsys, package):
    '''Tests SCL metapackage %files section checks'''
    pkg = getTestedSpecPackage(package)
    SCLCheck.check.check_spec(pkg, pkg.name)
    out, err = capsys.readouterr()
    assert 'scl-main-metapackage-contains-files' in out
    assert 'scl-runtime-package-without-%scl_files' in out
    assert 'scl-build-package-without-rpm-macros' in out
示例#6
0
def test_n_supbackage_without_prefix(capsys, package):
    '''
    Tests SCL spec where a subpackage uses -n and doesn't start with
    SCL prefix
    '''
    pkg = getTestedSpecPackage(package)
    SCLCheck.check.check_spec(pkg, pkg.name)
    out, err = capsys.readouterr()
    assert 'subpackage-with-n-without-scl-prefix' in out
示例#7
0
def test_main_package_without_scl_require(capsys, package):
    '''
    Tests SCL spec where the main package doesn't require anything
    from collection
    '''
    pkg = getTestedSpecPackage(package)
    SCLCheck.check.check_spec(pkg, pkg.name)
    out, err = capsys.readouterr()
    assert 'doesnt-require-scl-runtime-or-other-scl-package' in out
示例#8
0
def test_distribution_tags(capsys, package):
    pkg = getTestedSpecPackage(os.path.join('spec', package))
    SpecCheck.check.check_spec(pkg, pkg.name)
    out, err = capsys.readouterr()
    assert 'patch-not-applied Patch3' in out
    assert not re.search(r'patch-not-applied Patch\b', out)
    assert not re.search('patch-not-applied Patch[0124567]', out)
    assert 'libdir-macro-in-noarch-package' not in out
    assert len(re.findall("macro-in-comment", out)) == 1
    assert 'unversioned-explicit-provides unversioned-provides' in out
    assert 'unversioned-explicit-provides versioned-provides' not in out
    assert 'unversioned-explicit-provides /' not in out
    assert 'unversioned-explicit-obsoletes unversioned-obsoletes' in out
    assert 'unversioned-explicit-obsoletes versioned-obsoletes' not in out
    assert 'unversioned-explicit-obsoletes /' not in out
    assert 'setup-not-quiet' in out
示例#9
0
def test_setup_without_n(capsys, package):
    '''Tests SCL spec where setup doesn't use -n option'''
    pkg = getTestedSpecPackage(package)
    SCLCheck.check.check_spec(pkg, pkg.name)
    out, err = capsys.readouterr()
    assert 'scl-setup-without-n' in out
示例#10
0
def test_nonscl_spec_silent(capsys, package):
    '''SCL check on non-SCL spec has to be silent'''
    pkg = getTestedSpecPackage('spec/SpecCheck')
    SCLCheck.check.check_spec(pkg, pkg.name)
    out, err = capsys.readouterr()
    assert not out
示例#11
0
def test_no_pkg_name(capsys, package):
    '''Tests SCL spec without pkg_name definition'''
    pkg = getTestedSpecPackage(package)
    SCLCheck.check.check_spec(pkg, pkg.name)
    out, err = capsys.readouterr()
    assert 'missing-pkg_name-definition' in out
示例#12
0
def test_conflicts_without_prefix(capsys, package):
    '''Tests SCL spec with nonprefixed conflicts'''
    pkg = getTestedSpecPackage(package)
    SCLCheck.check.check_spec(pkg, pkg.name)
    out, err = capsys.readouterr()
    assert 'obsoletes-or-conflicts-without-scl-prefix' in out
示例#13
0
def test_nobuild(capsys, package):
    '''Tests SCL metapackage without build subpackage'''
    pkg = getTestedSpecPackage(package)
    SCLCheck.check.check_spec(pkg, pkg.name)
    out, err = capsys.readouterr()
    assert 'no-build-in-scl-metapackage' in out
示例#14
0
def test_undeclared(capsys, package):
    '''Tests SCL specs without %scl definition or %scl_package calls'''
    pkg = getTestedSpecPackage(package)
    SCLCheck.check.check_spec(pkg, pkg.name)
    out, err = capsys.readouterr()
    assert 'undeclared-scl' in out
示例#15
0
def test_correct_spec(capsys, package):
    '''Tests probably correct nodejs.spec and nodejs010.spec'''
    pkg = getTestedSpecPackage(package)
    SCLCheck.check.check_spec(pkg, pkg.name)
    out, err = capsys.readouterr()
    assert not out
示例#16
0
def test_noarch(capsys, package):
    '''Tests noarch SCL metapackages (not) containing %{_libdir}'''
    pkg = getTestedSpecPackage(package)
    SCLCheck.check.check_spec(pkg, pkg.name)
    out, err = capsys.readouterr()
    assert 'noarch-scl-metapackage-with-libdir' in out
示例#17
0
def test_provides_without_prefix(capsys, package):
    '''Tests SCL spec with nonprefixed provides'''
    pkg = getTestedSpecPackage(package)
    SCLCheck.check.check_spec(pkg, pkg.name)
    out, err = capsys.readouterr()
    assert 'provides-without-scl-prefix' in out
示例#18
0
def test_patch_not_applied(capsys, package):
    pkg = getTestedSpecPackage(os.path.join('spec', package))
    SpecCheck.check.check_spec(pkg, pkg.name)
    out, err = capsys.readouterr()
    assert 'patch-not-applied' not in out
示例#19
0
def test_nosclinstall(capsys, package):
    '''Tests SCL metapackage that doesn't call %scl_install'''
    pkg = getTestedSpecPackage(package)
    SCLCheck.check.check_spec(pkg, pkg.name)
    out, err = capsys.readouterr()
    assert 'scl-metapackage-without-%scl_install' in out