def setUp(self):
        self.user = User.objects.create_user(username="******",password="******")
        self.user.save()
        self.client = Client()
        self.assertTrue(self.client.login(username="******",password="******"))
        self.service = Service(name="test service")
        self.service.save()
        self.checks = []
        
        simple_check = SimpleServiceCheck(endpoint="http://google.com",service=self.service)
        simple_check.save()
        compare_check = CompareServiceCheck(endpoint="http://google.com",
                                            field="",
                                            compared_value="test_value",
                                            service=self.service)
        compare_check.save()

        sensu_check = SensuServiceCheck(sensu_check_name="test_check",
                                        service=self.service)
        sensu_check.save()

        umpire_check = UmpireServiceCheck(umpire_metric="good_metric",
                                          service=self.service)
        umpire_check.save()

        self.checks.append(simple_check)
        self.checks.append(compare_check)
        self.checks.append(sensu_check)
        self.checks.append(umpire_check)
Example #2
0
    def setUp(self):
        self.user = User.objects.create_user(username="******",
                                             password="******")
        self.user.save()
        self.client = Client()
        self.assertTrue(self.client.login(username="******",
                                          password="******"))

        self.service = Service(name="test service")
        self.service.save()
        self.checks = []

        simple_check = SimpleServiceCheck(endpoint="http://google.com",
                                          service=self.service)
        simple_check.save()
        compare_check = CompareServiceCheck(endpoint="http://google.com",
                                            field="",
                                            compared_value="test_value",
                                            service=self.service)
        compare_check.save()

        sensu_check = SensuServiceCheck(sensu_check_name="test_check",
                                        service=self.service)
        sensu_check.save()

        umpire_check = UmpireServiceCheck(umpire_metric="good_metric",
                                          service=self.service)
        umpire_check.save()

        self.checks.append(simple_check)
        self.checks.append(compare_check)
        self.checks.append(sensu_check)
        self.checks.append(umpire_check)
    def setUp(self):
        super(UmpireServiceCheckTest,self).setUp()

        good_check = UmpireServiceCheck(umpire_metric="good_metric",
                                        umpire_min=0,
                                        umpire_max=1000,
                                        service=self.service)
        good_check.save()
        self.good_checks.append(good_check)

        bad_check = UmpireServiceCheck(umpire_metric="bad_metric",
                                            umpire_min=0,
                                            umpire_max=10,
                                            service=self.service)
        bad_check.save()
        self.bad_checks.append(bad_check)
Example #4
0
    def setUp(self):
        super(UmpireServiceCheckTest, self).setUp()

        good_check = UmpireServiceCheck(umpire_metric="good_metric",
                                        umpire_min=0,
                                        umpire_max=1000,
                                        service=self.service)
        good_check.save()
        self.good_checks.append(good_check)

        bad_check = UmpireServiceCheck(umpire_metric="bad_metric",
                                       umpire_min=0,
                                       umpire_max=10,
                                       service=self.service)
        bad_check.save()
        self.bad_checks.append(bad_check)