def test_legacy_plugin_configuration(self): """ testing legacy plugin configuration, old-style monitoring """ cfg = { 'core': {}, 'monitoring': { 'package': 'yandextank.plugins.Telegraf', 'enabled': True, 'config': os.path.join(PATH, 'old_mon.xml') } } core = TankCore(cfg, threading.Event(), TankInfo({})) telegraf_plugin = core.get_plugin_of_type(TelegrafPlugin) telegraf_plugin.configure() assert telegraf_plugin.detected_conf == 'monitoring'
def test_plugin_configuration(self): """ testing telegraf plugin configuration """ cfg = { 'core': {}, 'telegraf': { 'package': 'yandextank.plugins.Telegraf', 'enabled': True, 'config': os.path.join( get_test_path(), 'yandextank/plugins/Telegraf/tests/telegraf_mon.xml') } } core = TankCore(cfg, threading.Event(), TankInfo({})) telegraf_plugin = core.get_plugin_of_type(TelegrafPlugin) telegraf_plugin.configure() assert telegraf_plugin.detected_conf == 'telegraf'
def test_core_plugins_configure(config, expected): core = TankCore([config], threading.Event(), TankInfo({})) core.plugins_configure()
def test_core_load_plugins(config, expected): core = TankCore( [load_yaml(os.path.join(PATH, '../config'), '00-base.yaml'), config], threading.Event(), TankInfo({})) core.load_plugins() assert set(core.plugins.keys()) == expected