Beispiel #1
0
def cleanup_cmk():
    yield

    if testlib.is_running_as_site_user():
        return

    import cmk.utils.paths

    if "pytest_cmk_" not in cmk.utils.paths.tmp_dir:
        return

    try:
        shutil.rmtree(cmk.utils.paths.tmp_dir)
    except OSError as exc:
        if exc.errno != errno.ENOENT:
            raise  # re-raise exception
Beispiel #2
0
def verify_site():
    if not testlib.is_running_as_site_user():
        raise RuntimeError("Please run tests as site user.")