Exemple #1
0
 def test_plugin_configuration(self):
     """ testing telegraf plugin configuration """
     core = TankCore()
     telegraf_plugin = TelegrafPlugin(core)
     core.set_option('telegraf', 'config', 'yandextank/plugins/Telegraf/tests/telegraf_mon.xml')
     telegraf_plugin.configure()
     assert telegraf_plugin.detected_conf == 'telegraf'
Exemple #2
0
 def test_legacy_plugin_configuration(self):
     """ testing legacy plugin configuration, old-style monitoring """
     core = TankCore()
     telegraf_plugin = TelegrafPlugin(core)
     core.set_option('monitoring', 'config', 'yandextank/plugins/Telegraf/tests/old_mon.xml')
     telegraf_plugin.configure()
     assert telegraf_plugin.detected_conf == 'monitoring'
Exemple #3
0
 def test_plugin_configuration(self):
     """ testing telegraf plugin configuration """
     cfg = {
         'core': {},
         'telegraf': {
             'package': 'yandextank.plugins.Telegraf',
             'enabled': True,
             'config': 'yandextank/plugins/Telegraf/tests/telegraf_mon.xml'
         }
     }
     core = TankCore(cfg, threading.Event())
     telegraf_plugin = core.get_plugin_of_type(TelegrafPlugin)
     telegraf_plugin.configure()
     assert telegraf_plugin.detected_conf == 'telegraf'
Exemple #4
0
 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'
Exemple #5
0
 def test_legacy_plugin_configuration(self):
     """ testing legacy plugin configuration, old-style monitoring """
     cfg = {
         'core': {},
         'monitoring': {
             'package': 'yandextank.plugins.Telegraf',
             'enabled': True,
             'config': 'yandextank/plugins/Telegraf/tests/old_mon.xml'
         }
     }
     core = TankCore(cfg)
     telegraf_plugin = core.get_plugin_of_type(TelegrafPlugin)
     telegraf_plugin.configure()
     assert telegraf_plugin.detected_conf == 'monitoring'
Exemple #6
0
 def test_both_plugin_configuration(self):
     """ both type of plugin configuration should throw a ValueError """
     core = TankCore()
     telegraf_plugin = TelegrafPlugin(core)
     core.set_option('monitoring', 'config', 'yandextank/plugins/Telegraf/tests/old_mon.xml')
     core.set_option('telegraf', 'config', 'yandextank/plugins/Telegraf/tests/telegraf_mon.xml')
     try:
         telegraf_plugin.configure()
     except ValueError:
         pass