Skip to content

Commit

Permalink
[snmp] collect warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
truthbk committed Jan 11, 2016
1 parent fcd775a commit 4bb335f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/checks/integration/test_snmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,13 @@ def test_invalid_metric(self):
'instances': [self.generate_instance_config(self.INVALID_METRICS)]
}
self.run_check(config)
self.service_checks = self.wait_for_async('get_service_checks', 'service_checks', 1)
self.warnings = self.wait_for_async('get_warnings', 'warnings', 1)

self.assertWarning("Fail to collect metrics: No symbol IF-MIB::noIdeaWhatIAmDoingHere at",
self.assertWarning("Fail to collect metrics: No symbol IF-MIB::noIdeaWhatIAmDoingHere",
count=1, exact_match=False)

self.service_checks = self.wait_for_async('get_service_checks', 'service_checks', 1)

# # Test service check
self.assertServiceCheck("snmp.can_check", status=AgentCheck.CRITICAL,
tags=self.CHECK_TAGS, count=1)
Expand All @@ -311,11 +313,13 @@ def test_network_failure(self):
'instances': [instance]
}
self.run_check(config)
self.service_checks = self.wait_for_async('get_service_checks', 'service_checks', 1)
self.warnings = self.wait_for_async('get_warnings', 'warnings', 1)

self.assertWarning("No SNMP response received before timeout for instance localhost", count=1)

# Test service check
self.service_checks = self.wait_for_async('get_service_checks', 'service_checks', 1)
self.assertServiceCheck("snmp.can_check", status=AgentCheck.CRITICAL,
tags=self.CHECK_TAGS, count=1)

self.coverage_report()

0 comments on commit 4bb335f

Please sign in to comment.