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/rail_tests.cpp b/phosphor-regulators/test/rail_tests.cpp
index d5f8db2..089e6ee 100644
--- a/phosphor-regulators/test/rail_tests.cpp
+++ b/phosphor-regulators/test/rail_tests.cpp
@@ -104,7 +104,8 @@
std::vector<std::unique_ptr<Rail>> rails{};
rails.emplace_back(std::move(rail));
std::unique_ptr<Device> device = std::make_unique<Device>(
- "reg1", true, "/system/chassis/motherboard/reg1",
+ "reg1", true,
+ "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg1",
std::move(i2cInterface), std::move(presenceDetection),
std::move(deviceConfiguration), std::move(rails));
Device* devicePtr = device.get();
@@ -157,7 +158,8 @@
std::vector<std::unique_ptr<Rail>> rails{};
rails.emplace_back(std::move(rail));
std::unique_ptr<Device> device = std::make_unique<Device>(
- "reg1", true, "/system/chassis/motherboard/reg1",
+ "reg1", true,
+ "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg1",
std::move(i2cInterface), std::move(presenceDetection),
std::move(deviceConfiguration), std::move(rails));
Device* devicePtr = device.get();
@@ -237,7 +239,8 @@
std::vector<std::unique_ptr<Rail>> rails{};
rails.emplace_back(std::move(rail));
std::unique_ptr<Device> device = std::make_unique<Device>(
- "reg1", true, "/system/chassis/motherboard/reg1",
+ "reg1", true,
+ "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg1",
std::move(i2cInterface), std::move(presenceDetection),
std::move(deviceConfiguration), std::move(rails));
Device* devicePtr = device.get();
@@ -302,7 +305,8 @@
std::vector<std::unique_ptr<Rail>> rails{};
rails.emplace_back(std::move(rail));
std::unique_ptr<Device> device = std::make_unique<Device>(
- "reg1", true, "/system/chassis/motherboard/reg1",
+ "reg1", true,
+ "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg1",
std::move(i2cInterface), std::move(presenceDetection),
std::move(deviceConfiguration), std::move(rails));
Device* devicePtr = device.get();