regulators: Add configure support to Chassis class

Implemented the configure() method in the Chassis class.  This method
configures all the regulator devices within the chassis.

Also made very minor fixes to two testcases.

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: Ib29fdfa36e59f6b79d9467cdc52c3c6fc9c6886d
diff --git a/phosphor-regulators/src/chassis.cpp b/phosphor-regulators/src/chassis.cpp
index 3787365..3390ec5 100644
--- a/phosphor-regulators/src/chassis.cpp
+++ b/phosphor-regulators/src/chassis.cpp
@@ -16,6 +16,9 @@
 
 #include "chassis.hpp"
 
+#include "journal.hpp"
+#include "system.hpp"
+
 namespace phosphor::power::regulators
 {
 
@@ -28,4 +31,16 @@
     }
 }
 
+void Chassis::configure(System& system)
+{
+    // Log info message in journal; important for verifying success of boot
+    journal::logInfo("Configuring chassis " + std::to_string(number));
+
+    // Configure devices
+    for (std::unique_ptr<Device>& device : devices)
+    {
+        device->configure(system, *this);
+    }
+}
+
 } // namespace phosphor::power::regulators
diff --git a/phosphor-regulators/src/chassis.hpp b/phosphor-regulators/src/chassis.hpp
index 1fe74cb..354da30 100644
--- a/phosphor-regulators/src/chassis.hpp
+++ b/phosphor-regulators/src/chassis.hpp
@@ -27,6 +27,9 @@
 namespace phosphor::power::regulators
 {
 
+// Forward declarations to avoid circular dependencies
+class System;
+
 /**
  * @class Chassis
  *
@@ -82,6 +85,16 @@
     void addToIDMap(IDMap& idMap);
 
     /**
+     * Configure the devices within this chassis, if any.
+     *
+     * This method should be called during the boot before regulators are
+     * enabled.
+     *
+     * @param system system that contains this chassis
+     */
+    void configure(System& system);
+
+    /**
      * Returns the devices within this chassis, if any.
      *
      * The vector contains regulator devices and any related devices