libpldmresponder: Make FRU tests load a valid FRU config
FRU_MASTER_JSON yields a value such as
"/usr/local/share/pldm/fru_master.json" which is is not likely to exist
on a on developer's system.
Fix this by replacing use of FRU_MASTER_JSON in the newer test cases
with the fixed, relative path used in the existing test case.
Fixes: 5bfb0dcbbd39 ("Refactor buildFRUTable and update to Association tree")
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Id57fea5a3e9d4dc48d8abff9f6e75aef77e5cc6b
diff --git a/libpldmresponder/test/libpldmresponder_fru_test.cpp b/libpldmresponder/test/libpldmresponder_fru_test.cpp
index 89cc440..d654fca 100644
--- a/libpldmresponder/test/libpldmresponder_fru_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_fru_test.cpp
@@ -115,9 +115,9 @@
uint8_t association_type;
} test_pldm_entity_node;
- pldm::responder::FruImpl mockedFruHandler(FRU_JSONS_DIR, FRU_MASTER_JSON,
- pdrRepo.get(), entityTree.get(),
- bmcEntityTree.get());
+ pldm::responder::FruImpl mockedFruHandler(
+ FRU_JSONS_DIR, "./fru_jsons/fru_master/fru_master.json", pdrRepo.get(),
+ entityTree.get(), bmcEntityTree.get());
pldm_entity systemEntity{0x2d01, 1, 0};
pldm_entity chassisEntity{0x2d, 1, 1};
@@ -168,9 +168,9 @@
pldm_entity_association_tree_destroy);
InterfaceMap iface = {{"xyz.openbmc_project.Inventory.Item.Chassis", {}}};
- pldm::responder::FruImpl mockedFruHandler(FRU_JSONS_DIR, FRU_MASTER_JSON,
- pdrRepo.get(), entityTree.get(),
- bmcEntityTree.get());
+ pldm::responder::FruImpl mockedFruHandler(
+ FRU_JSONS_DIR, "./fru_jsons/fru_master/fru_master.json", pdrRepo.get(),
+ entityTree.get(), bmcEntityTree.get());
// Good path
auto entityPtr = mockedFruHandler.getEntityByObjectPath(iface);