def test_export_service_confitem(self): self.host.add_external_sup_service("Interface eth0") host_dict = conf.hostsConf[u'testserver1'] host_dict['nagiosSrvDirs'][u'Interface eth0'] = { u"max_check_attempts": u"7", u"retry_interval": u"3"} self.hostloader.load() ci = ConfItem.by_host_service_confitem_name( u'testserver1', u'Interface eth0', u"max_check_attempts") self.assertTrue(ci, "confitem max_check_attempts must exist") self.assertEquals(ci.value, "7", "max_check_attempts=7") ci = ConfItem.by_host_service_confitem_name( u'testserver1', u'Interface eth0', u"retry_interval") self.assertTrue(ci, "confitem retry_interval must exist") self.assertEquals(ci.value, "3", "retry_interval=3")
def test_get_by_host_service_confitem_name(self): ob = ConfItem.by_host_service_confitem_name( u'myhost', u'myservice', self.attrs['name']) assert_equals('4', ob.value)