Esempio n. 1
0
def installed_conarydb(func):
    # mark the context as installed_conarydb
    testhelp.context('installed_conarydb')(func)

    def run(*args, **kwargs):
        if os.path.exists('/var/lib/conarydb/conarydb'):
            return func(*args, **kwargs)
        else:
            raise testhelp.SkipTestException('Test requires system conary database')

    run.func_name = func.func_name
    run._contexts = func._contexts

    return run
Esempio n. 2
0
def installed_conarydb(func):
    # mark the context as installed_conarydb
    testhelp.context('installed_conarydb')(func)

    def run(*args, **kwargs):
        if os.path.exists('/var/lib/conarydb/conarydb'):
            return func(*args, **kwargs)
        else:
            raise testhelp.SkipTestException(
                'Test requires system conary database')

    run.func_name = func.func_name
    run._contexts = func._contexts

    return run
Esempio n. 3
0
def rpm(func):
    # mark the context as rpm
    testhelp.context('rpm')(func)

    def run(*args, **kwargs):
        try:
            __import__('rpm')
            requireChroot()
        except ImportError:
            raise testhelp.SkipTestException('RPM module not present')
        except ChrootError:
            raise testhelp.SkipTestException('"sudo setcap cap_sys_chroot=ep /usr/bin/python" to run RPM module tests')
        else:
            return func(*args, **kwargs)

    run.func_name = func.func_name
    run._contexts = func._contexts

    return run
Esempio n. 4
0
def rpm(func):
    # mark the context as rpm
    testhelp.context('rpm')(func)

    def run(*args, **kwargs):
        try:
            __import__('rpm')
            requireChroot()
        except ImportError:
            raise testhelp.SkipTestException('RPM module not present')
        except ChrootError:
            raise testhelp.SkipTestException(
                '"sudo setcap cap_sys_chroot=ep /usr/bin/python" to run RPM module tests'
            )
        else:
            return func(*args, **kwargs)

    run.func_name = func.func_name
    run._contexts = func._contexts

    return run