[icinga-checkins] icinga.org: icingaweb2-module-director/fiddle/mfrosch: tests: be resiliant to adjusted master zone

git at icinga.org git at icinga.org
Tue Jun 7 15:59:16 CEST 2016


Module: icingaweb2-module-director
Branch: fiddle/mfrosch
Commit: 123b4c75492963f8608c60447c3a05181e593030
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=123b4c75492963f8608c60447c3a05181e593030

Author: Thomas Gelf <thomas at gelf.net>
Date:   Thu May 26 01:33:55 2016 +0200

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 c487bee..942a663 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 fdfcb3d..e86e53e 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()
         );
     }



More information about the icinga-checkins mailing list