Esempio n. 1
0
 def testAlertGeneratorCouchDbSizePollerNoAlert(self):
     self.config.AlertGenerator.couchDbSizePoller.soft = 5
     self.config.AlertGenerator.couchDbSizePoller.critical = 10
     self.config.AlertGenerator.couchDbSizePoller.pollInterval = 0.2
     ti = utils.TestInput() # see attributes comments at the class
     ti.pollerClass = CouchDbSizePoller
     ti.config = self.config.AlertGenerator.couchDbSizePoller
     ti.thresholdToTest = self.config.AlertGenerator.couchDbSizePoller.soft - 3
     ti.expected = 0
     ti.thresholdDiff = 2
     ti.testCase = self
     utils.doGenericValueBasedPolling(ti)
Esempio n. 2
0
 def testAlertGeneratorCouchDbSizePollerNoAlert(self):
     self.config.AlertGenerator.couchDbSizePoller.couchURL = os.getenv("COUCHURL", None)
     self.config.AlertGenerator.couchDbSizePoller.soft = 5
     self.config.AlertGenerator.couchDbSizePoller.critical = 10
     self.config.AlertGenerator.couchDbSizePoller.pollInterval = 0.2
     ti = utils.TestInput() # see attributes comments at the class
     ti.pollerClass = CouchDbSizePoller
     ti.config = self.config.AlertGenerator.couchDbSizePoller
     ti.thresholdToTest = self.config.AlertGenerator.couchDbSizePoller.soft - 3
     ti.expected = 0
     ti.thresholdDiff = 2
     ti.testCase = self
     utils.doGenericValueBasedPolling(ti)
Esempio n. 3
0
 def testAlertGeneratorMySQLDbSizePollerCriticalThreshold(self):
     self.config.AlertGenerator.mysqlDbSizePoller.soft = 5
     self.config.AlertGenerator.mysqlDbSizePoller.critical = 10
     self.config.AlertGenerator.mysqlDbSizePoller.pollInterval = 0.2
     ti = utils.TestInput()  # see attributes comments at the class
     ti.pollerClass = MySQLDbSizePoller
     ti.config = self.config.AlertGenerator.mysqlDbSizePoller
     ti.thresholdToTest = self.config.AlertGenerator.mysqlDbSizePoller.critical
     ti.level = self.config.AlertProcessor.critical.level
     ti.expected = 1
     ti.thresholdDiff = 1
     ti.testCase = self
     utils.doGenericValueBasedPolling(ti)
Esempio n. 4
0
 def testAlertGeneratorMySQLDbSizePollerCriticalThreshold(self):
     self.config.AlertGenerator.mysqlDbSizePoller.soft = 5
     self.config.AlertGenerator.mysqlDbSizePoller.critical = 10
     self.config.AlertGenerator.mysqlDbSizePoller.pollInterval = 0.2
     ti = utils.TestInput() # see attributes comments at the class
     ti.pollerClass = MySQLDbSizePoller
     ti.config = self.config.AlertGenerator.mysqlDbSizePoller
     ti.thresholdToTest = self.config.AlertGenerator.mysqlDbSizePoller.critical
     ti.level = self.config.AlertProcessor.critical.level
     ti.expected = 1
     ti.thresholdDiff = 1
     ti.testCase = self
     utils.doGenericValueBasedPolling(ti)
Esempio n. 5
0
 def testAlertGeneratorCouchErrorsPollerNoAlert(self):
     self.config.AlertGenerator.couchErrorsPoller.soft = 100
     self.config.AlertGenerator.couchErrorsPoller.critical = 200
     # shall expect corresponding number of generated alerts for each observable value
     self.config.AlertGenerator.couchErrorsPoller.observables = (5, 6, 7)        
     self.config.AlertGenerator.couchErrorsPoller.pollInterval = 0.2
     ti = utils.TestInput() # see attributes comments at the class
     ti.pollerClass = CouchErrorsPoller
     ti.config = self.config.AlertGenerator.couchErrorsPoller
     ti.thresholdToTest = self.config.AlertGenerator.couchErrorsPoller.soft - 30
     ti.expected = 0
     ti.thresholdDiff = 20
     ti.testCase = self
     utils.doGenericValueBasedPolling(ti)
Esempio n. 6
0
 def testAlertGeneratorCouchDbSizePollerSoftThreshold(self):
     self.config.AlertGenerator.couchDbSizePoller.couchURL = os.getenv("COUCHURL", None)
     self.config.AlertGenerator.couchDbSizePoller.soft = 5
     self.config.AlertGenerator.couchDbSizePoller.critical = 10
     self.config.AlertGenerator.couchDbSizePoller.pollInterval = 0.2
     ti = utils.TestInput() # see attributes comments at the class
     ti.pollerClass = CouchDbSizePoller
     ti.config = self.config.AlertGenerator.couchDbSizePoller
     ti.thresholdToTest = self.config.AlertGenerator.couchDbSizePoller.soft
     ti.level = self.config.AlertProcessor.soft.level
     ti.expected = 1
     ti.thresholdDiff = 4
     ti.testCase = self
     utils.doGenericValueBasedPolling(ti)
Esempio n. 7
0
 def testAlertGeneratorMySQLDbSizePollerNoAlert(self):
     self.config.AlertGenerator.mysqlDbSizePoller.soft = 5
     self.config.AlertGenerator.mysqlDbSizePoller.critical = 10
     self.config.AlertGenerator.mysqlDbSizePoller.pollInterval = 0.2
     ti = utils.TestInput()  # see attributes comments at the class
     ti.pollerClass = MySQLDbSizePoller
     ti.config = self.config.AlertGenerator.mysqlDbSizePoller
     # lower the threshold so that the alert is never generated
     ti.thresholdToTest = self.config.AlertGenerator.mysqlDbSizePoller.soft - 3
     ti.level = 0
     ti.expected = 0
     ti.thresholdDiff = 2
     ti.testCase = self
     utils.doGenericValueBasedPolling(ti)
Esempio n. 8
0
 def testAlertGeneratorMySQLDbSizePollerNoAlert(self):
     self.config.AlertGenerator.mysqlDbSizePoller.soft = 5
     self.config.AlertGenerator.mysqlDbSizePoller.critical = 10
     self.config.AlertGenerator.mysqlDbSizePoller.pollInterval = 0.2
     ti = utils.TestInput() # see attributes comments at the class
     ti.pollerClass = MySQLDbSizePoller
     ti.config = self.config.AlertGenerator.mysqlDbSizePoller
     # lower the threshold so that the alert is never generated
     ti.thresholdToTest = self.config.AlertGenerator.mysqlDbSizePoller.soft - 3
     ti.level = 0
     ti.expected = 0
     ti.thresholdDiff = 2
     ti.testCase = self
     utils.doGenericValueBasedPolling(ti)
Esempio n. 9
0
 def testAlertGeneratorCouchErrorsPollerNoAlert(self):
     self.config.AlertGenerator.couchErrorsPoller.couchURL = os.getenv("COUCHURL", None)
     self.config.AlertGenerator.couchErrorsPoller.soft = 100
     self.config.AlertGenerator.couchErrorsPoller.critical = 200
     # shall expect corresponding number of generated alerts for each observable value
     self.config.AlertGenerator.couchErrorsPoller.observables = (5, 6, 7)
     self.config.AlertGenerator.couchErrorsPoller.pollInterval = 0.2
     ti = utils.TestInput() # see attributes comments at the class
     ti.pollerClass = CouchErrorsPoller
     ti.config = self.config.AlertGenerator.couchErrorsPoller
     ti.thresholdToTest = self.config.AlertGenerator.couchErrorsPoller.soft - 30
     ti.expected = 0
     ti.thresholdDiff = 20
     ti.testCase = self
     utils.doGenericValueBasedPolling(ti)
Esempio n. 10
0
 def testAlertGeneratorCouchErrorsPollerCriticalThreshold(self):
     self.config.AlertGenerator.couchErrorsPoller.couchURL = os.getenv("COUCHURL", None)
     self.config.AlertGenerator.couchErrorsPoller.soft = 100
     self.config.AlertGenerator.couchErrorsPoller.critical = 200
     # shall expect corresponding number of generated alerts for each observable value
     self.config.AlertGenerator.couchErrorsPoller.observables = (5, 6, 7)
     self.config.AlertGenerator.couchErrorsPoller.pollInterval = 0.2
     ti = utils.TestInput() # see attributes comments at the class
     ti.pollerClass = CouchErrorsPoller
     ti.config = self.config.AlertGenerator.couchErrorsPoller
     ti.thresholdToTest = self.config.AlertGenerator.couchErrorsPoller.critical
     ti.level = self.config.AlertProcessor.critical.level
     ti.expected = len(self.config.AlertGenerator.couchErrorsPoller.observables)
     ti.thresholdDiff = 50
     ti.testCase = self
     utils.doGenericValueBasedPolling(ti)