Exemplo n.º 1
0
    def setUp(self):
        log.info('MainTest#setUp: start')

        # NOTE: I don't understand what weird pythonic bullshit
        # neccessitates this, but it is needed for using timeout
        # decorator
        self.__name__ = 'MainTest'

        # setup collector instance with enough options to be
        # able to successfully instantiate
        try:
            self.collector

        except:
            log.info('MainTest#setup: exception')
            self.collector = collector({
                '__role': 'master',
                'transport': 'zeromq',
                'sock_dir': '/tmp',
                'pki_dir': '/etc/salt/pki',
                'metrics': {
                    'update_interval': self.UPDATE_INTERVAL,
                    'saved_path': '/tmp/salt_metrics.json',
                    'persistence': True,
                    'decorator': 'prometheus'
                }
            })
Exemplo n.º 2
0
    def setUp(self):
        log.info("MainTest#setUp: start")

        # NOTE: I don't understand what weird pythonic bullshit
        # neccessitates this, but it is needed for using timeout
        # decorator
        self.__name__ = "MainTest"

        # setup collector instance with enough options to be
        # able to successfully instantiate
        try:
            self.collector

        except:
            log.info("MainTest#setup: exception")
            self.collector = collector(
                {
                    "__role": "master",
                    "transport": "zeromq",
                    "sock_dir": "/tmp",
                    "pki_dir": "/etc/salt/pki",
                    "metrics": {
                        "update_interval": self.UPDATE_INTERVAL,
                        "saved_path": "/tmp/salt_metrics.json",
                        "persistence": True,
                        "decorator": "prometheus",
                    },
                }
            )
Exemplo n.º 3
0
 def test_run(self):
     log.info('MainTest#test_run: start')
     self.collector.run()
Exemplo n.º 4
0
 def test_collector(self):
     '''Ensure collector is correct instance type
 '''
     log.info('MainTest#test_collector: start')
     self.assertEqual(type(self.collector),
                      saltmetrics.collectors.DecoratedMetricsCollector)
Exemplo n.º 5
0
 def test_run(self):
     log.info("MainTest#test_run: start")
     self.collector.run()
Exemplo n.º 6
0
 def test_collector(self):
     """Ensure collector is correct instance type
 """
     log.info("MainTest#test_collector: start")
     self.assertEqual(type(self.collector), saltmetrics.collectors.DecoratedMetricsCollector)