コード例 #1
0
ファイル: System_t.py プロジェクト: AndrewLevin/WMCore
 def _doPeriodPoller(self, thresholdToTest, level, config,
                     pollerClass, expected = 0):
     ti = utils.TestInput() # see attributes comments at the class
     ti.pollerClass = pollerClass
     ti.config = config
     ti.thresholdToTest = thresholdToTest
     ti.level = level
     ti.expected = expected
     ti.thresholdDiff = 10
     ti.testCase = self
     utils.doGenericPeriodAndProcessPolling(ti)
コード例 #2
0
 def testMySQLCPUPollerCriticalThreshold(self):
     self.config.AlertGenerator.mysqlCPUPoller.soft = 70
     self.config.AlertGenerator.mysqlCPUPoller.critical = 80
     self.config.AlertGenerator.mysqlCPUPoller.pollInterval = 0.2
     self.config.AlertGenerator.mysqlCPUPoller.period = 1
     ti = utils.TestInput()  # see attributes comments at the class
     ti.pollerClass = MySQLCPUPoller
     ti.config = self.config.AlertGenerator.mysqlCPUPoller
     ti.thresholdToTest = self.config.AlertGenerator.mysqlCPUPoller.critical
     ti.level = self.config.AlertProcessor.critical.level
     ti.expected = 1
     ti.thresholdDiff = 10
     ti.testCase = self
     utils.doGenericPeriodAndProcessPolling(ti)
コード例 #3
0
 def testMySQLCPUPollerCriticalThreshold(self):
     self.config.AlertGenerator.mysqlCPUPoller.soft = 70
     self.config.AlertGenerator.mysqlCPUPoller.critical = 80
     self.config.AlertGenerator.mysqlCPUPoller.pollInterval = 0.2
     self.config.AlertGenerator.mysqlCPUPoller.period = 1
     ti = utils.TestInput() # see attributes comments at the class
     ti.pollerClass = MySQLCPUPoller
     ti.config = self.config.AlertGenerator.mysqlCPUPoller
     ti.thresholdToTest = self.config.AlertGenerator.mysqlCPUPoller.critical
     ti.level = self.config.AlertProcessor.critical.level
     ti.expected = 1
     ti.thresholdDiff = 10
     ti.testCase = self
     utils.doGenericPeriodAndProcessPolling(ti)
コード例 #4
0
 def testAlertGeneratorCouchMemoryPollerCriticalThreshold(self):
     self.config.AlertGenerator.couchMemPoller.couchURL = os.getenv("COUCHURL", None)
     self.config.AlertGenerator.couchMemPoller.soft = 70
     self.config.AlertGenerator.couchMemPoller.critical = 80
     self.config.AlertGenerator.couchMemPoller.pollInterval = 0.2
     self.config.AlertGenerator.couchMemPoller.period = 1
     ti = utils.TestInput() # see attributes comments at the class
     ti.pollerClass = CouchMemoryPoller
     ti.config = self.config.AlertGenerator.couchMemPoller
     ti.thresholdToTest = self.config.AlertGenerator.couchMemPoller.critical
     ti.level = self.config.AlertProcessor.critical.level
     ti.expected = 1
     ti.thresholdDiff = 10
     ti.testCase = self
     utils.doGenericPeriodAndProcessPolling(ti)
コード例 #5
0
 def testMySQLMemoryPollerNoAlert(self):
     self.config.AlertGenerator.mysqlMemPoller.soft = 70
     self.config.AlertGenerator.mysqlMemPoller.critical = 80
     self.config.AlertGenerator.mysqlMemPoller.pollInterval = 0.2
     self.config.AlertGenerator.mysqlMemPoller.period = 1
     ti = utils.TestInput()  # see attributes comments at the class
     ti.pollerClass = MySQLMemoryPoller
     ti.config = self.config.AlertGenerator.mysqlMemPoller
     # lower the threshold so that the alert is never generated
     ti.thresholdToTest = self.config.AlertGenerator.mysqlMemPoller.soft - 20
     ti.level = 0
     ti.expected = 0
     ti.thresholdDiff = 10
     ti.testCase = self
     utils.doGenericPeriodAndProcessPolling(ti)
コード例 #6
0
ファイル: System_t.py プロジェクト: lucacopa/WMCore
 def _doPeriodPoller(self,
                     thresholdToTest,
                     level,
                     config,
                     pollerClass,
                     expected=0):
     ti = utils.TestInput()  # see attributes comments at the class
     ti.pollerClass = pollerClass
     ti.config = config
     ti.thresholdToTest = thresholdToTest
     ti.level = level
     ti.expected = expected
     ti.thresholdDiff = 10
     ti.testCase = self
     utils.doGenericPeriodAndProcessPolling(ti)
コード例 #7
0
 def testMySQLMemoryPollerNoAlert(self):
     self.config.AlertGenerator.mysqlMemPoller.soft = 70
     self.config.AlertGenerator.mysqlMemPoller.critical = 80
     self.config.AlertGenerator.mysqlMemPoller.pollInterval = 0.2
     self.config.AlertGenerator.mysqlMemPoller.period = 1
     ti = utils.TestInput() # see attributes comments at the class
     ti.pollerClass = MySQLMemoryPoller
     ti.config = self.config.AlertGenerator.mysqlMemPoller
     # lower the threshold so that the alert is never generated
     ti.thresholdToTest = self.config.AlertGenerator.mysqlMemPoller.soft - 20
     ti.level = 0
     ti.expected = 0
     ti.thresholdDiff = 10
     ti.testCase = self
     utils.doGenericPeriodAndProcessPolling(ti)
コード例 #8
0
 def testAlertGeneratorCouchCPUPollerNoAlert(self):
     self.config.AlertGenerator.couchCPUPoller.couchURL = os.getenv("COUCHURL", None)
     self.config.AlertGenerator.couchCPUPoller.soft = 70
     self.config.AlertGenerator.couchCPUPoller.critical = 80
     self.config.AlertGenerator.couchCPUPoller.pollInterval = 0.2
     self.config.AlertGenerator.couchCPUPoller.period = 1
     ti = utils.TestInput() # see attributes comments at the class
     ti.pollerClass = CouchCPUPoller
     ti.config = self.config.AlertGenerator.couchCPUPoller
     # lower the threshold so that the alert is never generated
     ti.thresholdToTest = self.config.AlertGenerator.couchCPUPoller.soft - 20
     ti.level = 0
     ti.expected = 0
     ti.thresholdDiff = 10
     ti.testCase = self
     utils.doGenericPeriodAndProcessPolling(ti)