From 396a71c6a0b203555c33f5381aa18880ca14280a Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 21 Feb 2023 17:49:26 +0100 Subject: [PATCH] Repair unit tests --- test/icinga-dependencies.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/icinga-dependencies.cpp b/test/icinga-dependencies.cpp index b31f540b1..929b6ca0d 100644 --- a/test/icinga-dependencies.cpp +++ b/test/icinga-dependencies.cpp @@ -70,14 +70,26 @@ BOOST_AUTO_TEST_CASE(multi_parent) /* Test the reachability from this point. * parentHost1 is DOWN, parentHost2 is UP. - * Expected result: childHost is reachable. + * Expected result: childHost is unreachable. */ parentHost1->SetStateRaw(ServiceCritical); // parent Host 1 DOWN parentHost2->SetStateRaw(ServiceOK); // parent Host 2 UP + BOOST_CHECK(childHost->IsReachable() == false); + + /* The only DNS server is DOWN. + * Expected result: childHost is unreachable. + */ + dep1->SetRedundancyGroup("DNS"); + BOOST_CHECK(childHost->IsReachable() == false); + + /* 1/2 DNS servers is DOWN. + * Expected result: childHost is reachable. + */ + dep2->SetRedundancyGroup("DNS"); BOOST_CHECK(childHost->IsReachable() == true); - /* parentHost1 is DOWN, parentHost2 is DOWN. + /* Both DNS servers are DOWN. * Expected result: childHost is unreachable. */ parentHost1->SetStateRaw(ServiceCritical); // parent Host 1 DOWN