Repair unit tests

This commit is contained in:
Alexander A. Klimov 2023-02-21 17:49:26 +01:00
parent 20d7e1b5e6
commit 396a71c6a0
1 changed files with 14 additions and 2 deletions

View File

@ -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