PEL: Add CalloutsWhenNoADMatch msg reg support

There is a new use case where we need to do one callout in the message
registry based on the value of an AdditionalData field value, and
another callout in all other cases.

To support this, this commit is adding a new 'CalloutsWhenNoADMatch'
field in the PEL message registry that allows one to add callouts when
there is no match on the 'ADValue' field.  This behaves like an 'else'
leg to the 'if AdValue == X' structure in the message registry.

Example:
{
    "ADName": "PROC_NUM",
    "CalloutsWithTheirADValues":
    [
        {
            "ADValue": "0",
            "Callouts":
            [
                // callouts when PROC_NUM == 0
            ]
        },
        {
            "ADValue": "1",
            "Callouts":
            [
                // callouts when PROC_NUM == 1
            ]
        }
    ],
    "CalloutsWhenNoADMatch": [
        {
            // callouts when PROC_NUM != 0 or 1
        }
    ]
}

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ib8e208ff950a643302e856c7dd2b7474fec61b26
diff --git a/test/openpower-pels/registry_test.cpp b/test/openpower-pels/registry_test.cpp
index de7eb27..edfbeda 100644
--- a/test/openpower-pels/registry_test.cpp
+++ b/test/openpower-pels/registry_test.cpp
@@ -662,6 +662,54 @@
             EXPECT_TRUE(callouts.empty());
         }
     }
+
+    {
+        // Callouts with a 'CalloutsWhenNoADMatch' section that will
+        // be used when the AdditionalData value doesn't match.
+        auto json = R"(
+        {
+            "ADName": "PROC_NUM",
+            "CalloutsWithTheirADValues":
+            [
+                {
+                    "ADValue": "0",
+                    "Callouts":
+                    [
+                        {
+                            "CalloutList":
+                            [
+                                {
+                                    "Priority": "high",
+                                    "LocCode": "P0-C0"
+                                }
+                            ]
+                        }
+                    ]
+                }
+            ],
+            "CalloutsWhenNoADMatch": [
+                {
+                    "CalloutList": [
+                        {
+                            "Priority": "medium",
+                            "LocCode": "P1-C1"
+                        }
+                    ]
+                }
+            ]
+        })"_json;
+
+        // There isn't an entry in the JSON for a PROC_NUM of 8
+        // so it should choose the P1-C1 callout.
+        std::vector<std::string> adData{"PROC_NUM=8"};
+        AdditionalData ad{adData};
+        names.clear();
+
+        auto callouts = Registry::getCallouts(json, names, ad);
+        EXPECT_EQ(callouts.size(), 1);
+        EXPECT_EQ(callouts[0].priority, "medium");
+        EXPECT_EQ(callouts[0].locCode, "P1-C1");
+    }
 }
 
 TEST_F(RegistryTest, TestNoSubsystem)