Esempio n. 1
0
def check_info(request, check_name):
    if not config._all_checks_loaded:
        print "Load all checks"
        config._initialize_data_structures()
        filelist = config.get_plugin_paths('/src/tests/fixtures/checks')
        config.load_checks(check_api.get_check_api_context, filelist)
        config._all_checks_loaded = True

    return config.check_info[check_name]
Esempio n. 2
0
    def load(self, file_names=None):
        """Load either all check plugins or the given file_names"""
        import cmk_base.config as config
        import cmk_base.check_api as check_api
        import cmk.utils.paths

        if file_names is None:
            config.load_all_checks(
                check_api.get_check_api_context)  # loads all checks
        else:
            config._initialize_data_structures()
            config.load_checks(check_api.get_check_api_context, [
                os.path.join(cmk.utils.paths.checks_dir, f) for f in file_names
            ])

        return self
Esempio n. 3
0
def test_load_checks():
    config._initialize_data_structures()
    assert config.check_info == {}
    config.load_all_checks(check_api.get_check_api_context)
    assert len(config.check_info) > 1000