regulators: Make inventory_path required property

Make "inventory_path" a required property of the "chassis" object in the
regulators JSON configuration file.

This property is used to create the chassis <-> sensor associations
required by bmcweb for finding regulator sensors.

The property is already documented in the markdown file as being
required.  However, that requirement was not being enforced in the JSON
schema nor in the C++ configuration file parser.

The existing configuration files did not have the property, and
requiring it would have caused errors.

Those configuration files have been updated to include the property, so
the requirement is now being enforced.

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: If9af7969f8b92068e66c750681179db70eae489e
diff --git a/phosphor-regulators/test/validate-regulators-config_tests.cpp b/phosphor-regulators/test/validate-regulators-config_tests.cpp
index 18eef6f..f6033d5 100644
--- a/phosphor-regulators/test/validate-regulators-config_tests.cpp
+++ b/phosphor-regulators/test/validate-regulators-config_tests.cpp
@@ -565,7 +565,6 @@
     {
         json configFile = validConfigFile;
         configFile["chassis"][0].erase("comments");
-        configFile["chassis"][0].erase("inventory_path");
         configFile["chassis"][0].erase("devices");
         EXPECT_JSON_VALID(configFile);
     }
@@ -576,6 +575,13 @@
         EXPECT_JSON_INVALID(configFile, "Validation failed.",
                             "'number' is a required property");
     }
+    // Invalid: test chassis with no inventory_path.
+    {
+        json configFile = validConfigFile;
+        configFile["chassis"][0].erase("inventory_path");
+        EXPECT_JSON_INVALID(configFile, "Validation failed.",
+                            "'inventory_path' is a required property");
+    }
     // Invalid: test chassis with property comments wrong type.
     {
         json configFile = validConfigFile;
@@ -809,6 +815,7 @@
     {
         json configFile;
         configFile["chassis"][0]["number"] = 1;
+        configFile["chassis"][0]["inventory_path"] = "system/chassis";
         EXPECT_JSON_VALID(configFile);
     }
     // Valid: All properties specified
@@ -3084,6 +3091,7 @@
     {
         json configFile = validConfigFile;
         configFile["chassis"][1]["number"] = 1;
+        configFile["chassis"][1]["inventory_path"] = "system/chassis2";
         EXPECT_JSON_INVALID(configFile, "Error: Duplicate chassis number.", "");
     }
 }