regulators: Enhance config file parser

Enhance JSON config file parser to convert relative inventory paths to
absolute form.

Tested:
Run local CI with -Dlong-tests=enabled to enable tests for
validate-regulators-config.py.

Signed-off-by: Bob King <Bob_King@wistron.com>
Change-Id: I80237a673f9c5918898db15363847722141388e6
diff --git a/phosphor-regulators/test/actions/i2c_compare_bytes_action_tests.cpp b/phosphor-regulators/test/actions/i2c_compare_bytes_action_tests.cpp
index d03b358..5685db7 100644
--- a/phosphor-regulators/test/actions/i2c_compare_bytes_action_tests.cpp
+++ b/phosphor-regulators/test/actions/i2c_compare_bytes_action_tests.cpp
@@ -161,8 +161,10 @@
             .WillOnce(SetArrayArgument<2>(actualValues, actualValues + 2));
 
         // Create Device, IDMap, and ActionEnvironment
-        Device device{"reg1", true, "/system/chassis/motherboard/reg1",
-                      std::move(i2cInterface)};
+        Device device{
+            "reg1", true,
+            "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg1",
+            std::move(i2cInterface)};
         IDMap idMap{};
         idMap.addDevice(device);
         ActionEnvironment env{idMap, "reg1"};
@@ -194,8 +196,10 @@
             .WillOnce(SetArrayArgument<2>(actualValues, actualValues + 3));
 
         // Create Device, IDMap, and ActionEnvironment
-        Device device{"reg1", true, "/system/chassis/motherboard/reg1",
-                      std::move(i2cInterface)};
+        Device device{
+            "reg1", true,
+            "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg1",
+            std::move(i2cInterface)};
         IDMap idMap{};
         idMap.addDevice(device);
         ActionEnvironment env{idMap, "reg1"};
@@ -223,8 +227,10 @@
             .WillOnce(SetArrayArgument<2>(actualValues, actualValues + 2));
 
         // Create Device, IDMap, and ActionEnvironment
-        Device device{"reg1", true, "/system/chassis/motherboard/reg1",
-                      std::move(i2cInterface)};
+        Device device{
+            "reg1", true,
+            "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg1",
+            std::move(i2cInterface)};
         IDMap idMap{};
         idMap.addDevice(device);
         ActionEnvironment env{idMap, "reg1"};
@@ -256,8 +262,10 @@
             .WillOnce(SetArrayArgument<2>(actualValues, actualValues + 3));
 
         // Create Device, IDMap, and ActionEnvironment
-        Device device{"reg1", true, "/system/chassis/motherboard/reg1",
-                      std::move(i2cInterface)};
+        Device device{
+            "reg1", true,
+            "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg1",
+            std::move(i2cInterface)};
         IDMap idMap{};
         idMap.addDevice(device);
         ActionEnvironment env{idMap, "reg1"};
@@ -285,8 +293,10 @@
             .WillOnce(SetArrayArgument<2>(actualValues, actualValues + 1));
 
         // Create Device, IDMap, and ActionEnvironment
-        Device device{"reg1", true, "/system/chassis/motherboard/reg1",
-                      std::move(i2cInterface)};
+        Device device{
+            "reg1", true,
+            "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg1",
+            std::move(i2cInterface)};
         IDMap idMap{};
         idMap.addDevice(device);
         ActionEnvironment env{idMap, "reg1"};
@@ -339,8 +349,10 @@
                                               "/dev/i2c-1", 0x70}));
 
         // Create Device, IDMap, and ActionEnvironment
-        Device device{"reg1", true, "/system/chassis/motherboard/reg1",
-                      std::move(i2cInterface)};
+        Device device{
+            "reg1", true,
+            "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg1",
+            std::move(i2cInterface)};
         IDMap idMap{};
         idMap.addDevice(device);
         ActionEnvironment env{idMap, "reg1"};