예제 #1
0
파일: test.py 프로젝트: rstgroup/nagctl
	def test_acknowledgeProblem_host(self):
		"""acknowledgeProblem: generate commands to acknowledge host problem"""

		nagctl.conf["host"] = "database"
		commands = nagctl.acknowledgeProblem(["acknowledge", "problem", "comment"], "host")

		expected = ["ACKNOWLEDGE_HOST_PROBLEM;database;1;0;0;nagctl;comment"]
		self.assertEqual(commands, expected)
예제 #2
0
파일: test.py 프로젝트: rstgroup/nagctl
	def test_acknowledgeProblem_none(self):
		"""acknowledgeProblem: do not generate any commands"""

		nagctl.conf["host"] = "worker0"
		nagctl.conf["service"] = "queue1"
		commands = nagctl.acknowledgeProblem(["acknowledge", "problem", "comment"], "all")

		expected = []
		self.assertEqual(commands, expected)
예제 #3
0
파일: test.py 프로젝트: sasg/nagctl
    def test_acknowledgeProblem_host(self):
        """acknowledgeProblem: generate commands to acknowledge host problem"""

        nagctl.conf["host"] = "database"
        commands = nagctl.acknowledgeProblem(
            ["acknowledge", "problem", "comment"], "host")

        expected = ["ACKNOWLEDGE_HOST_PROBLEM;database;1;0;0;nagctl;comment"]
        self.assertEqual(commands, expected)
예제 #4
0
파일: test.py 프로젝트: rstgroup/nagctl
	def test_acknowledgeProblem_service(self):
		"""acknowledgeProblem: generate commands to acknowledge service problem"""

		import re

		nagctl.conf["service"] = "load"
		commands = nagctl.acknowledgeProblem(["acknowledge", "problem", "comment"], "service")

		expected = ["ACKNOWLEDGE_SVC_PROBLEM;worker0;load;1;0;0;nagctl;comment", "ACKNOWLEDGE_SVC_PROBLEM;worker1;load;1;0;0;nagctl;comment", "ACKNOWLEDGE_SVC_PROBLEM;database;load;1;0;0;nagctl;comment"]
		self.assertEqual(commands, expected)
예제 #5
0
파일: test.py 프로젝트: sasg/nagctl
    def test_acknowledgeProblem_none(self):
        """acknowledgeProblem: do not generate any commands"""

        nagctl.conf["host"] = "worker0"
        nagctl.conf["service"] = "queue1"
        commands = nagctl.acknowledgeProblem(
            ["acknowledge", "problem", "comment"], "all")

        expected = []
        self.assertEqual(commands, expected)
예제 #6
0
파일: test.py 프로젝트: rstgroup/nagctl
	def test_acknowledgeProblem_all(self):
		"""acknowledgeProblem: generate commands to acknowledge host and service problem"""

		import re

		nagctl.conf["host"] = "database"
		nagctl.conf["service"] = "load"
		commands = nagctl.acknowledgeProblem(["acknowledge", "problem", "comment"], "all")

		expected = ["ACKNOWLEDGE_HOST_PROBLEM;database;1;0;0;nagctl;comment", "ACKNOWLEDGE_SVC_PROBLEM;database;load;1;0;0;nagctl;comment"]
		self.assertEqual(commands, expected)
예제 #7
0
파일: test.py 프로젝트: sasg/nagctl
    def test_acknowledgeProblem_all(self):
        """acknowledgeProblem: generate commands to acknowledge host and service problem"""

        import re

        nagctl.conf["host"] = "database"
        nagctl.conf["service"] = "load"
        commands = nagctl.acknowledgeProblem(
            ["acknowledge", "problem", "comment"], "all")

        expected = [
            "ACKNOWLEDGE_HOST_PROBLEM;database;1;0;0;nagctl;comment",
            "ACKNOWLEDGE_SVC_PROBLEM;database;load;1;0;0;nagctl;comment"
        ]
        self.assertEqual(commands, expected)
예제 #8
0
파일: test.py 프로젝트: sasg/nagctl
    def test_acknowledgeProblem_service(self):
        """acknowledgeProblem: generate commands to acknowledge service problem"""

        import re

        nagctl.conf["service"] = "load"
        commands = nagctl.acknowledgeProblem(
            ["acknowledge", "problem", "comment"], "service")

        expected = [
            "ACKNOWLEDGE_SVC_PROBLEM;worker0;load;1;0;0;nagctl;comment",
            "ACKNOWLEDGE_SVC_PROBLEM;worker1;load;1;0;0;nagctl;comment",
            "ACKNOWLEDGE_SVC_PROBLEM;database;load;1;0;0;nagctl;comment"
        ]
        self.assertEqual(commands, expected)