host-check: additional debug and time

Increased the amount of time host-check has to check the status of
interfaces that have been added to the DBus, but have not yet been added
to the mapper. This helps to mitigate situations where host-check does
not get the correct state from pldm and assumes the system is off by
allowing additional retries over an increased window of time.
The amount of retries was increased from two to five, with the amount of
downtime between each attempt being increased from 500ms to 1000ms.
Logging statements were added to checkFirmwareConditionRunning() to
indicate the condition of services currently running.

Signed-off-by: Corey Hardesty <corey.hardesty@icloud.com>
Change-Id: I3fc088b27ac459322ebccf7a8dc52aa30a1ee364
diff --git a/host_check.cpp b/host_check.cpp
index 2bdcb1f..7e6dbef 100644
--- a/host_check.cpp
+++ b/host_check.cpp
@@ -101,12 +101,16 @@
                               CONDITION_HOST_PROPERTY);
 
                 auto response = bus.call(method);
-
                 std::variant<FirmwareCondition> currentFwCondV;
                 response.read(currentFwCondV);
                 auto currentFwCond =
                     std::get<FirmwareCondition>(currentFwCondV);
 
+                info(
+                    "Read host fw condition {COND_VALUE} from {COND_SERVICE}, {COND_PATH}",
+                    "COND_VALUE", currentFwCond, "COND_SERVICE", service,
+                    "COND_PATH", path);
+
                 if (currentFwCond == FirmwareCondition::Running)
                 {
                     return true;
@@ -139,9 +143,9 @@
         method.append(CHASSIS_STATE_INTF, CHASSIS_STATE_POWER_PROP);
 
         auto response = bus.call(method);
-
         std::variant<PowerState> currentPowerStateV;
         response.read(currentPowerStateV);
+
         auto currentPowerState = std::get<PowerState>(currentPowerStateV);
 
         if (currentPowerState == PowerState::On)
@@ -176,16 +180,19 @@
     // application that could possibly implement the needed interface have
     // been started. However, the use of mapper to find those interfaces means
     // we have a condition where the interface may be on D-Bus but not stored
-    // within mapper yet. Keep it simple and just build one retry into the
-    // check if it's found the host is not up. This service is only called if
-    // chassis power is on when the BMC comes up, so this wont impact most
-    // normal cases where the BMC is rebooted with chassis power off. In
-    // cases where chassis power is on, the host is likely running so we want
-    // to be sure we check all interfaces
-    for (int i = 0; i < 2; i++)
+    // within mapper yet. There are five built in retries to check if it's
+    // found the host is not up. This service is only called if chassis power
+    // is on when the BMC comes up, so this wont impact most normal cases
+    // where the BMC is rebooted with chassis power off. In cases where
+    // chassis power is on, the host is likely running so we want to be sure
+    // we check all interfaces
+    for (int i = 0; i < 5; i++)
     {
+        debug(
+            "Introspecting new bus objects for bus id: {ID} sleeping for 1 second.",
+            "ID", id);
         // Give mapper a small window to introspect new objects on bus
-        std::this_thread::sleep_for(std::chrono::milliseconds(500));
+        std::this_thread::sleep_for(std::chrono::milliseconds(1000));
         if (checkFirmwareConditionRunning(bus))
         {
             info("Host is running!");