pseq: Add is_power_supply_rail JSON file property

Enhance the JSON configuration file for the phosphor-power-sequencer
application.  Add an "is_power_supply_rail" property to the "rail"
object.

Update the config file documentation, config file parser, Rail class,
and the associated tests.

Change-Id: I3d0e8276324dd9cf25f386016c6f275b540515aa
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
diff --git a/phosphor-power-sequencer/src/config_file_parser.cpp b/phosphor-power-sequencer/src/config_file_parser.cpp
index db055d1..37c6b04 100644
--- a/phosphor-power-sequencer/src/config_file_parser.cpp
+++ b/phosphor-power-sequencer/src/config_file_parser.cpp
@@ -100,6 +100,15 @@
         ++propertyCount;
     }
 
+    // Optional is_power_supply_rail property
+    bool isPowerSupplyRail{false};
+    auto isPowerSupplyRailIt = element.find("is_power_supply_rail");
+    if (isPowerSupplyRailIt != element.end())
+    {
+        isPowerSupplyRail = parseBoolean(*isPowerSupplyRailIt);
+        ++propertyCount;
+    }
+
     // Optional check_status_vout property
     bool checkStatusVout{false};
     auto checkStatusVoutIt = element.find("check_status_vout");
@@ -137,8 +146,9 @@
     // Verify no invalid properties exist
     verifyPropertyCount(element, propertyCount);
 
-    return std::make_unique<Rail>(name, presence, page, checkStatusVout,
-                                  compareVoltageToLimits, gpio);
+    return std::make_unique<Rail>(name, presence, page, isPowerSupplyRail,
+                                  checkStatusVout, compareVoltageToLimits,
+                                  gpio);
 }
 
 std::vector<std::unique_ptr<Rail>> parseRailArray(const json& element)
diff --git a/phosphor-power-sequencer/src/rail.hpp b/phosphor-power-sequencer/src/rail.hpp
index 5445449..6ac8610 100644
--- a/phosphor-power-sequencer/src/rail.hpp
+++ b/phosphor-power-sequencer/src/rail.hpp
@@ -71,6 +71,8 @@
      *                 must be present in order for the rail to be present
      * @param page Optional PMBus PAGE number of the rail.  Required if
      *             checkStatusVout or compareVoltageToLimits is true.
+     * @param isPowerSupplyRail Specifies whether the rail is produced by a
+     *                          power supply
      * @param checkStatusVout Specifies whether to check the value of the PMBus
      *                        STATUS_VOUT command when determining the pgood
      *                        status of the rail
@@ -83,11 +85,12 @@
      */
     explicit Rail(const std::string& name,
                   const std::optional<std::string>& presence,
-                  const std::optional<uint8_t>& page, bool checkStatusVout,
-                  bool compareVoltageToLimits,
+                  const std::optional<uint8_t>& page, bool isPowerSupplyRail,
+                  bool checkStatusVout, bool compareVoltageToLimits,
                   const std::optional<GPIO>& gpio) :
         name{name},
-        presence{presence}, page{page}, checkStatusVout{checkStatusVout},
+        presence{presence}, page{page}, isPsuRail{isPowerSupplyRail},
+        checkStatusVout{checkStatusVout},
         compareVoltageToLimits{compareVoltageToLimits}, gpio{gpio}
     {
         // If checking STATUS_VOUT or output voltage, verify PAGE was specified
@@ -129,6 +132,16 @@
     }
 
     /**
+     * Returns whether the rail is produced by a power supply.
+     *
+     * @return true if rail is produced by a power supply, false otherwise
+     */
+    bool isPowerSupplyRail() const
+    {
+        return isPsuRail;
+    }
+
+    /**
      * Returns whether the value of the PMBus STATUS_VOUT command is checked
      * when determining the pgood status of the rail.
      *
@@ -180,6 +193,11 @@
     std::optional<uint8_t> page{};
 
     /**
+     * Specifies whether the rail is produced by a power supply.
+     */
+    bool isPsuRail{false};
+
+    /**
      * Specifies whether to check the value of the PMBus STATUS_VOUT command
      * when determining the pgood status of the rail.
      *