Example #1
0
    def testAlertGeneratorCouchErrorsPollerBasic(self):
        try:
            poller = CouchErrorsPoller(self.config.AlertGenerator.couchErrorsPoller, self.generator)
        except Exception as ex:
            self.fail("Exception, reason: %s" % ex)

        # even a single values to observe shall be turned into particular iterables
        obs = self.config.AlertGenerator.couchErrorsPoller.observables
        self.config.AlertGenerator.couchErrorsPoller.observables = 400
        try:
            poller = CouchErrorsPoller(self.config.AlertGenerator.couchErrorsPoller, self.generator)
        except Exception as ex:
            self.fail("Exception, reason: %s" % ex)
        #self.assertTrue(isinstance(obs, (types.ListType, types.TupleType)))
        self.assertTrue(isinstance(self.config.AlertGenerator.couchErrorsPoller.observables,
                                   (types.ListType, types.TupleType)))

        # test return value on non-sense HTTP status code
        res = poller.sample("40000")
        self.assertFalse(res)
        # test definitely existing value
        res = poller.sample("200")
        # on a freshly started couch, this status code may not exist in the
        # stats table, so despite correct and meaningful HTTP status code, the
        # query may still return None, hence don't assume any particular response
        #self.assertTrue(isinstance(res, types.IntType))
        poller.check()
Example #2
0
 def testAlertGeneratorCouchErrorsPollerBasic(self):
     try:
         poller = CouchErrorsPoller(
             self.config.AlertGenerator.couchErrorsPoller, self.generator)
     except Exception, ex:
         self.fail("Exception, reason: %s" % ex)
Example #3
0
     ti.thresholdDiff = 10
     ti.testCase = self
     utils.doGenericPeriodAndProcessPolling(ti)
     
     
 def testAlertGeneratorCouchErrorsPollerBasic(self):
     try:
         poller = CouchErrorsPoller(self.config.AlertGenerator.couchErrorsPoller, self.generator)
     except Exception, ex:
         self.fail("Exception, reason: %s" % ex)
     
     # even a single values to observe shall be turned into particular iterables
     obs = self.config.AlertGenerator.couchErrorsPoller.observables
     self.config.AlertGenerator.couchErrorsPoller.observables = 400    
     try:
         poller = CouchErrorsPoller(self.config.AlertGenerator.couchErrorsPoller, self.generator)
     except Exception, ex:
         self.fail("Exception, reason: %s" % ex)
     #self.assertTrue(isinstance(obs, (types.ListType, types.TupleType)))
     self.assertTrue(isinstance(self.config.AlertGenerator.couchErrorsPoller.observables,
                                (types.ListType, types.TupleType)))
     
     # test return value on non-sense HTTP status code
     res = poller.sample("40000")
     self.assertFalse(res)
     # test definitely existing value
     res = poller.sample("200")
     # on a freshly started couch, this status code may not exist in the
     # stats table, so despite correct and meaningful HTTP status code, the
     # query may still return None, hence don't assume any particular response
     #self.assertTrue(isinstance(res, types.IntType))
Example #4
0
        ti.thresholdDiff = 10
        ti.testCase = self
        utils.doGenericPeriodAndProcessPolling(ti)

    def testAlertGeneratorCouchErrorsPollerBasic(self):
        try:
            poller = CouchErrorsPoller(
                self.config.AlertGenerator.couchErrorsPoller, self.generator)
        except Exception, ex:
            self.fail("Exception, reason: %s" % ex)

        # even a single values to observe shall be turned into particular iterables
        obs = self.config.AlertGenerator.couchErrorsPoller.observables
        self.config.AlertGenerator.couchErrorsPoller.observables = 400
        try:
            poller = CouchErrorsPoller(
                self.config.AlertGenerator.couchErrorsPoller, self.generator)
        except Exception, ex:
            self.fail("Exception, reason: %s" % ex)
        #self.assertTrue(isinstance(obs, (types.ListType, types.TupleType)))
        self.assertTrue(
            isinstance(
                self.config.AlertGenerator.couchErrorsPoller.observables,
                (types.ListType, types.TupleType)))

        # test return value on non-sense HTTP status code
        res = poller.sample("40000")
        self.assertFalse(res)
        # test definitely existing value
        res = poller.sample("200")
        # on a freshly started couch, this status code may not exist in the
        # stats table, so despite correct and meaningful HTTP status code, the