report = self._insights()
self.assertFalse(report["health"]["history"]["checks"])
- def test_insights_health(self):
- """The insights module reports health checks"""
- self._add_crash(1, True) # add invalid crash data
- timeout = 10
- while timeout > 0:
- time.sleep(1)
- timeout -= 1
- # should observe a health check because it can't read the invalid
- # crash data created at the beginning of this test
- report = self._insights()
- if "MGR_INSIGHTS_WARNING" in report["health"]["current"]["checks"]:
- self._clear_crashes()
- return
- self._clear_crashes()
- self.fail("Insights module did not set health check")
- pass
-
def test_schema(self):
"""TODO: assert conformance to a full schema specification?"""
report = self._insights()
self.assertFalse(report["errors"])
log.warning("{}".format(json.dumps(report["crashes"], indent=2)))
- # handling of comm. error with crash module
- self._add_crash(1, True)
- report = self._insights()
- self.assertFalse(report["crashes"]["summary"])
- self.assertTrue(report["errors"])
-
self._clear_crashes()