Store frro configs in idmap file
This also includes the change to use the configs to decide which (if
any) frros to use at runtime
Bug: 243066074
Test: Manual, updated and created automated tests
Change-Id: I3f1d23e2958ad170799880b9f5eb5bd8ceb1fa67
diff --git a/cmds/idmap2/tests/ResourceMappingTests.cpp b/cmds/idmap2/tests/ResourceMappingTests.cpp
index ca9a444..016d427 100644
--- a/cmds/idmap2/tests/ResourceMappingTests.cpp
+++ b/cmds/idmap2/tests/ResourceMappingTests.cpp
@@ -111,19 +111,20 @@
return Error("Failed to find mapping for target resource");
}
- auto actual_overlay_value = std::get_if<TargetValue>(&entry_map->second);
- if (actual_overlay_value == nullptr) {
+ auto config_map = std::get_if<ConfigMap>(&entry_map->second);
+ if (config_map == nullptr || config_map->empty()) {
return Error("Target resource is not mapped to an inline value");
}
+ auto actual_overlay_value = config_map->begin()->second;
- if (actual_overlay_value->data_type != type) {
+ if (actual_overlay_value.data_type != type) {
return Error(R"(Expected type: "0x%02x" Actual type: "0x%02x")", type,
- actual_overlay_value->data_type);
+ actual_overlay_value.data_type);
}
- if (actual_overlay_value->data_value != value) {
+ if (actual_overlay_value.data_value != value) {
return Error(R"(Expected value: "0x%08x" Actual value: "0x%08x")", type,
- actual_overlay_value->data_value);
+ actual_overlay_value.data_value);
}
return Result<Unit>({});