From 123b4c75492963f8608c60447c3a05181e593030 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 26 May 2016 01:33:55 +0200 Subject: [PATCH] tests: be resiliant to adjusted master zone --- test/php/library/Director/Objects/IcingaHostTest.php | 5 ++++- test/php/library/Director/Objects/IcingaServiceTest.php | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/php/library/Director/Objects/IcingaHostTest.php b/test/php/library/Director/Objects/IcingaHostTest.php index c487bee6..942a6639 100644 --- a/test/php/library/Director/Objects/IcingaHostTest.php +++ b/test/php/library/Director/Objects/IcingaHostTest.php @@ -280,11 +280,12 @@ class IcingaHostTest extends BaseTestCase $db = $this->getDb(); $host = $this->host()->setConnection($db); + $masterzone = $db->getMasterZoneName(); $config = new IcingaConfig($db); $host->renderToConfig($config); $this->assertEquals( - array('zones.d/master/hosts.conf'), + array('zones.d/' . $masterzone . '/hosts.conf'), $config->getFileNames() ); @@ -313,6 +314,8 @@ class IcingaHostTest extends BaseTestCase $host->object_type = 'template'; $host->zone_id = null; + // TODO: this should happen automagically + $host->invalidateResolveCache(); $config = new IcingaConfig($db); $host->renderToConfig($config); $this->assertEquals( diff --git a/test/php/library/Director/Objects/IcingaServiceTest.php b/test/php/library/Director/Objects/IcingaServiceTest.php index fdfcb3df..e86e53e1 100644 --- a/test/php/library/Director/Objects/IcingaServiceTest.php +++ b/test/php/library/Director/Objects/IcingaServiceTest.php @@ -203,8 +203,9 @@ class IcingaServiceTest extends BaseTestCase $config = new IcingaConfig($db); $service->renderToConfig($config); + $masterzone = $db->getMasterZoneName(); $this->assertEquals( - array('zones.d/master/services.conf'), + array('zones.d/' . $masterzone . '/services.conf'), $config->getFileNames() ); }