tests: be resiliant to adjusted master zone

This commit is contained in:
Thomas Gelf 2016-05-26 01:33:55 +02:00
parent 4a21b8eb86
commit 123b4c7549
2 changed files with 6 additions and 2 deletions

View File

@ -280,11 +280,12 @@ class IcingaHostTest extends BaseTestCase
$db = $this->getDb(); $db = $this->getDb();
$host = $this->host()->setConnection($db); $host = $this->host()->setConnection($db);
$masterzone = $db->getMasterZoneName();
$config = new IcingaConfig($db); $config = new IcingaConfig($db);
$host->renderToConfig($config); $host->renderToConfig($config);
$this->assertEquals( $this->assertEquals(
array('zones.d/master/hosts.conf'), array('zones.d/' . $masterzone . '/hosts.conf'),
$config->getFileNames() $config->getFileNames()
); );
@ -313,6 +314,8 @@ class IcingaHostTest extends BaseTestCase
$host->object_type = 'template'; $host->object_type = 'template';
$host->zone_id = null; $host->zone_id = null;
// TODO: this should happen automagically
$host->invalidateResolveCache();
$config = new IcingaConfig($db); $config = new IcingaConfig($db);
$host->renderToConfig($config); $host->renderToConfig($config);
$this->assertEquals( $this->assertEquals(

View File

@ -203,8 +203,9 @@ class IcingaServiceTest extends BaseTestCase
$config = new IcingaConfig($db); $config = new IcingaConfig($db);
$service->renderToConfig($config); $service->renderToConfig($config);
$masterzone = $db->getMasterZoneName();
$this->assertEquals( $this->assertEquals(
array('zones.d/master/services.conf'), array('zones.d/' . $masterzone . '/services.conf'),
$config->getFileNames() $config->getFileNames()
); );
} }