blob: e92ca9d1fcb2e68950b656c1a2b9bc3beab63afe [file] [log] [blame]
Zane Shelley0b8368c2021-03-18 17:33:41 -05001#include <stdio.h>
2
3#include <analyzer/resolution.hpp>
Zane Shelley5d63cef2021-09-17 18:10:17 -05004#include <util/trace.hpp>
5
6#include <regex>
Zane Shelley0b8368c2021-03-18 17:33:41 -05007
8#include "gtest/gtest.h"
9
10// Chip string
11constexpr auto chip_str = "/proc0";
12
13// Unit paths
Zane Shelley5d63cef2021-09-17 18:10:17 -050014constexpr auto proc_str = "";
15constexpr auto iolink_str = "pib/perv24/pauc0/iohs0/smpgroup0";
16constexpr auto omi_str = "pib/perv12/mc0/mi0/mcc0/omi0";
17constexpr auto ocmb_str = "pib/perv12/mc0/mi0/mcc0/omi0/ocmb0";
18constexpr auto core_str = "pib/perv39/eq7/fc1/core1";
Zane Shelley0b8368c2021-03-18 17:33:41 -050019
20// Local implementation of this function.
21namespace analyzer
22{
23
Zane Shelley84721d92021-09-08 13:30:27 -050024//------------------------------------------------------------------------------
25
Zane Shelley96d54862021-09-17 11:16:12 -050026// Helper function to get the root cause chip target path from the service data.
27std::string __getRootCauseChipPath(const ServiceData& i_sd)
28{
29 return std::string{(const char*)i_sd.getRootCause().getChip().getChip()};
30}
31
32//------------------------------------------------------------------------------
33
34// Helper function to get a unit target path from the given unit path, which is
35// a devtree path relative the the containing chip. An empty string indicates
36// the chip target path should be returned.
37std::string __getUnitPath(const std::string& i_chipPath,
38 const std::string& i_unitPath)
39{
40 auto path = i_chipPath; // default, if i_unitPath is empty
41
42 if (!i_unitPath.empty())
43 {
44 path += "/" + i_unitPath;
45 }
46
47 return path;
48}
49
50//------------------------------------------------------------------------------
51
Zane Shelley5d63cef2021-09-17 18:10:17 -050052// Helper function to get the connected target Path on the other side of the
53// given bus.
54std::tuple<std::string, std::string>
55 __getConnectedPath(const std::string& i_rxPath,
56 const callout::BusType& i_busType)
57{
58 std::string txUnitPath{};
59 std::string txChipPath{};
60
61 // Need to get the target type from the RX path.
62 const std::regex re{"(/proc0)(.*)/([a-z]+)([0-9]+)"};
63 std::smatch match;
64 std::regex_match(i_rxPath, match, re);
65 assert(5 == match.size());
66 std::string rxType = match[3].str();
67
68 if (callout::BusType::SMP_BUS == i_busType && "smpgroup" == rxType)
69 {
70 // Use the RX unit path on a different processor.
71 txUnitPath = "/proc1" + match[2].str() + "/" + rxType + match[4].str();
72 txChipPath = "/proc1";
73 }
74 else if (callout::BusType::OMI_BUS == i_busType && "omi" == rxType)
75 {
76 // Append the OCMB to the RX path.
77 txUnitPath = i_rxPath + "/ocmb0";
78 txChipPath = txUnitPath;
79 }
80 else if (callout::BusType::OMI_BUS == i_busType && "ocmb" == rxType)
81 {
82 // Strip the OCMB off of the RX path.
83 txUnitPath = match[1].str() + match[2].str();
84 txChipPath = "/proc0";
85 }
86 else
87 {
88 // This would be a code bug.
89 throw std::logic_error("Unsupported config: i_rxTarget=" + i_rxPath +
90 " i_busType=" + i_busType.getString());
91 }
92
93 assert(!txUnitPath.empty()); // just in case we missed something above
94
95 return std::make_tuple(txUnitPath, txChipPath);
96}
97
98//------------------------------------------------------------------------------
99
Zane Shelley1eff9452021-11-03 13:59:54 -0500100void __calloutBackplane(ServiceData& io_sd, const callout::Priority& i_priority)
101{
102 // TODO: There isn't a device tree object for this. So will need to hardcode
103 // the location code for now. In the future, we will need a mechanism
104 // to make this data driven.
105
106 nlohmann::json callout;
107 callout["LocationCode"] = "P0";
108 callout["Priority"] = i_priority.getUserDataString();
109 callout["Deconfigured"] = false;
110 callout["Guarded"] = false;
111 io_sd.addCallout(callout);
112}
113
114//------------------------------------------------------------------------------
115
Zane Shelley0b8368c2021-03-18 17:33:41 -0500116void HardwareCalloutResolution::resolve(ServiceData& io_sd) const
117{
Zane Shelley96d54862021-09-17 11:16:12 -0500118 // Get the location code and entity path for this target.
119 auto locCode = __getRootCauseChipPath(io_sd);
120 auto entityPath = __getUnitPath(locCode, iv_unitPath);
Zane Shelley0b8368c2021-03-18 17:33:41 -0500121
Zane Shelleyc85716c2021-08-17 10:54:06 -0500122 // Add the actual callout to the service data.
123 nlohmann::json callout;
Zane Shelley96d54862021-09-17 11:16:12 -0500124 callout["LocationCode"] = locCode;
Zane Shelleyc85716c2021-08-17 10:54:06 -0500125 callout["Priority"] = iv_priority.getUserDataString();
126 io_sd.addCallout(callout);
Zane Shelley0b8368c2021-03-18 17:33:41 -0500127
Zane Shelley95135822021-08-23 09:00:05 -0500128 // Add the guard info to the service data.
Zane Shelley96d54862021-09-17 11:16:12 -0500129 Guard guard = io_sd.addGuard(entityPath, iv_guard);
130
131 // Add the callout FFDC to the service data.
132 nlohmann::json ffdc;
133 ffdc["Callout Type"] = "Hardware Callout";
134 ffdc["Target"] = entityPath;
135 ffdc["Priority"] = iv_priority.getRegistryString();
136 ffdc["Guard Type"] = guard.getString();
137 io_sd.addCalloutFFDC(ffdc);
Zane Shelley0b8368c2021-03-18 17:33:41 -0500138}
139
Zane Shelleyc85716c2021-08-17 10:54:06 -0500140//------------------------------------------------------------------------------
141
Zane Shelley5d63cef2021-09-17 18:10:17 -0500142void ConnectedCalloutResolution::resolve(ServiceData& io_sd) const
143{
144 // Get the chip target path from the root cause signature.
145 auto chipPath = __getRootCauseChipPath(io_sd);
146
147 // Get the endpoint target path for the receiving side of the bus.
148 auto rxPath = __getUnitPath(chipPath, iv_unitPath);
149
150 // Get the endpoint target path for the transfer side of the bus.
151 auto txPath = __getConnectedPath(rxPath, iv_busType);
152
153 // Callout the TX endpoint.
154 nlohmann::json txCallout;
155 txCallout["LocationCode"] = std::get<1>(txPath);
156 txCallout["Priority"] = iv_priority.getUserDataString();
157 io_sd.addCallout(txCallout);
158
159 // Guard the TX endpoint.
160 Guard txGuard = io_sd.addGuard(std::get<0>(txPath), iv_guard);
161
162 // Add the callout FFDC to the service data.
163 nlohmann::json ffdc;
164 ffdc["Callout Type"] = "Connected Callout";
165 ffdc["Bus Type"] = iv_busType.getString();
166 ffdc["Target"] = std::get<0>(txPath);
167 ffdc["Priority"] = iv_priority.getRegistryString();
168 ffdc["Guard Type"] = txGuard.getString();
169 io_sd.addCalloutFFDC(ffdc);
170}
171
172//------------------------------------------------------------------------------
173
Zane Shelley4757a7b2021-09-20 22:23:38 -0500174void BusCalloutResolution::resolve(ServiceData& io_sd) const
175{
176 // Get the chip target path from the root cause signature.
177 auto chipPath = __getRootCauseChipPath(io_sd);
178
179 // Get the endpoint target path for the receiving side of the bus.
180 auto rxPath = __getUnitPath(chipPath, iv_unitPath);
181
182 // Get the endpoint target path for the transfer side of the bus.
183 auto txPath = __getConnectedPath(rxPath, iv_busType);
184
185 // Callout the RX endpoint.
186 nlohmann::json rxCallout;
187 rxCallout["LocationCode"] = chipPath;
188 rxCallout["Priority"] = iv_priority.getUserDataString();
189 io_sd.addCallout(rxCallout);
190
191 // Callout the TX endpoint.
192 nlohmann::json txCallout;
193 txCallout["LocationCode"] = std::get<1>(txPath);
194 txCallout["Priority"] = iv_priority.getUserDataString();
195 io_sd.addCallout(txCallout);
196
197 // Callout everything else in between.
198 // TODO: For P10 (OMI bus and XBUS), the callout is simply the backplane.
Zane Shelley1eff9452021-11-03 13:59:54 -0500199 __calloutBackplane(io_sd, iv_priority);
Zane Shelley4757a7b2021-09-20 22:23:38 -0500200
201 // Guard the RX endpoint.
202 Guard guard = io_sd.addGuard(rxPath, iv_guard);
203
204 // Guard the TX endpoint.
205 // No need to check return because it is the same as RX target.
206 io_sd.addGuard(std::get<0>(txPath), iv_guard);
207
208 // TODO: Currently no guard for "everything else in between".
209
210 // Add the callout FFDC to the service data.
211 nlohmann::json ffdc;
212 ffdc["Callout Type"] = "Bus Callout";
213 ffdc["Bus Type"] = iv_busType.getString();
214 ffdc["RX Target"] = rxPath;
215 ffdc["TX Target"] = std::get<0>(txPath);
216 ffdc["Priority"] = iv_priority.getRegistryString();
217 ffdc["Guard Type"] = guard.getString();
218 io_sd.addCalloutFFDC(ffdc);
219}
220
221//------------------------------------------------------------------------------
222
Zane Shelleyc85716c2021-08-17 10:54:06 -0500223void ProcedureCalloutResolution::resolve(ServiceData& io_sd) const
224{
225 // Add the actual callout to the service data.
226 nlohmann::json callout;
227 callout["Procedure"] = iv_procedure.getString();
228 callout["Priority"] = iv_priority.getUserDataString();
229 io_sd.addCallout(callout);
Zane Shelley96d54862021-09-17 11:16:12 -0500230
231 // Add the callout FFDC to the service data.
232 nlohmann::json ffdc;
233 ffdc["Callout Type"] = "Procedure Callout";
234 ffdc["Procedure"] = iv_procedure.getString();
235 ffdc["Priority"] = iv_priority.getRegistryString();
236 io_sd.addCalloutFFDC(ffdc);
Zane Shelleyc85716c2021-08-17 10:54:06 -0500237}
238
Zane Shelley84721d92021-09-08 13:30:27 -0500239//------------------------------------------------------------------------------
240
241void ClockCalloutResolution::resolve(ServiceData& io_sd) const
242{
Zane Shelley1eff9452021-11-03 13:59:54 -0500243 // Callout the clock target.
244 // TODO: For P10, the callout is simply the backplane. Also, there are no
245 // clock targets in the device tree. So at the moment there is no
246 // guard support for clock targets.
247 __calloutBackplane(io_sd, iv_priority);
Zane Shelley96d54862021-09-17 11:16:12 -0500248
249 // Add the callout FFDC to the service data.
Zane Shelley1eff9452021-11-03 13:59:54 -0500250 // TODO: Add the target and guard type if guard is ever supported.
Zane Shelley96d54862021-09-17 11:16:12 -0500251 nlohmann::json ffdc;
252 ffdc["Callout Type"] = "Clock Callout";
253 ffdc["Clock Type"] = iv_clockType.getString();
Zane Shelley96d54862021-09-17 11:16:12 -0500254 ffdc["Priority"] = iv_priority.getRegistryString();
Zane Shelley96d54862021-09-17 11:16:12 -0500255 io_sd.addCalloutFFDC(ffdc);
Zane Shelley84721d92021-09-08 13:30:27 -0500256}
257
258//------------------------------------------------------------------------------
259
Zane Shelley0b8368c2021-03-18 17:33:41 -0500260} // namespace analyzer
261
262using namespace analyzer;
263
264TEST(Resolution, TestSet1)
265{
266 // Create a few resolutions
267 auto c1 = std::make_shared<HardwareCalloutResolution>(
Zane Shelleyc85716c2021-08-17 10:54:06 -0500268 proc_str, callout::Priority::HIGH, false);
Zane Shelley0b8368c2021-03-18 17:33:41 -0500269
270 auto c2 = std::make_shared<HardwareCalloutResolution>(
Zane Shelleyc85716c2021-08-17 10:54:06 -0500271 omi_str, callout::Priority::MED_A, true);
Zane Shelley0b8368c2021-03-18 17:33:41 -0500272
273 auto c3 = std::make_shared<HardwareCalloutResolution>(
Zane Shelleyc85716c2021-08-17 10:54:06 -0500274 core_str, callout::Priority::MED, true);
Zane Shelley0b8368c2021-03-18 17:33:41 -0500275
276 auto c4 = std::make_shared<ProcedureCalloutResolution>(
Zane Shelleyc85716c2021-08-17 10:54:06 -0500277 callout::Procedure::NEXTLVL, callout::Priority::LOW);
Zane Shelley0b8368c2021-03-18 17:33:41 -0500278
Zane Shelley84721d92021-09-08 13:30:27 -0500279 auto c5 = std::make_shared<ClockCalloutResolution>(
280 callout::ClockType::OSC_REF_CLOCK_1, callout::Priority::LOW, false);
281
282 // l1 = (c1, c2, c5)
Zane Shelley723fa232021-08-09 12:02:06 -0500283 auto l1 = std::make_shared<ResolutionList>();
284 l1->push(c1);
285 l1->push(c2);
Zane Shelley84721d92021-09-08 13:30:27 -0500286 l1->push(c5);
Zane Shelley0b8368c2021-03-18 17:33:41 -0500287
Zane Shelley84721d92021-09-08 13:30:27 -0500288 // l2 = (c4, c3, c1, c2, c5)
Zane Shelley723fa232021-08-09 12:02:06 -0500289 auto l2 = std::make_shared<ResolutionList>();
290 l2->push(c4);
291 l2->push(c3);
292 l2->push(l1);
Zane Shelley0b8368c2021-03-18 17:33:41 -0500293
294 // Get some ServiceData objects
295 libhei::Chip chip{chip_str, 0xdeadbeef};
296 libhei::Signature sig{chip, 0xabcd, 0, 0, libhei::ATTN_TYPE_CHECKSTOP};
Zane Shelleyca496192021-08-09 12:05:52 -0500297 ServiceData sd1{sig, true};
298 ServiceData sd2{sig, false};
Zane Shelley0b8368c2021-03-18 17:33:41 -0500299
300 // Resolve
Zane Shelley723fa232021-08-09 12:02:06 -0500301 l1->resolve(sd1);
302 l2->resolve(sd2);
Zane Shelley0b8368c2021-03-18 17:33:41 -0500303
304 // Start verifying
305 nlohmann::json j{};
306 std::string s{};
307
Zane Shelleyc85716c2021-08-17 10:54:06 -0500308 j = sd1.getCalloutList();
Zane Shelley0b8368c2021-03-18 17:33:41 -0500309 s = R"([
310 {
311 "LocationCode": "/proc0",
312 "Priority": "H"
313 },
314 {
Zane Shelley1eff9452021-11-03 13:59:54 -0500315 "Deconfigured": false,
316 "Guarded": false,
Zane Shelley84721d92021-09-08 13:30:27 -0500317 "LocationCode": "P0",
318 "Priority": "L"
Zane Shelley0b8368c2021-03-18 17:33:41 -0500319 }
320])";
Zane Shelley96d54862021-09-17 11:16:12 -0500321 EXPECT_EQ(s, j.dump(4));
Zane Shelley0b8368c2021-03-18 17:33:41 -0500322
Zane Shelleyc85716c2021-08-17 10:54:06 -0500323 j = sd2.getCalloutList();
Zane Shelley0b8368c2021-03-18 17:33:41 -0500324 s = R"([
325 {
326 "Priority": "L",
327 "Procedure": "NEXTLVL"
328 },
329 {
330 "LocationCode": "/proc0",
Zane Shelley0b8368c2021-03-18 17:33:41 -0500331 "Priority": "H"
332 },
333 {
Zane Shelley1eff9452021-11-03 13:59:54 -0500334 "Deconfigured": false,
335 "Guarded": false,
Zane Shelley84721d92021-09-08 13:30:27 -0500336 "LocationCode": "P0",
337 "Priority": "L"
Zane Shelley0b8368c2021-03-18 17:33:41 -0500338 }
339])";
Zane Shelley96d54862021-09-17 11:16:12 -0500340 EXPECT_EQ(s, j.dump(4));
341}
342
343TEST(Resolution, HardwareCallout)
344{
345 auto c1 = std::make_shared<HardwareCalloutResolution>(
346 omi_str, callout::Priority::MED_A, true);
347
348 libhei::Chip chip{chip_str, 0xdeadbeef};
349 libhei::Signature sig{chip, 0xabcd, 0, 0, libhei::ATTN_TYPE_CHECKSTOP};
350 ServiceData sd{sig, true};
351
352 c1->resolve(sd);
353
354 nlohmann::json j{};
355 std::string s{};
356
357 // Callout list
358 j = sd.getCalloutList();
359 s = R"([
360 {
361 "LocationCode": "/proc0",
362 "Priority": "A"
363 }
364])";
365 EXPECT_EQ(s, j.dump(4));
366
367 // Callout FFDC
368 j = sd.getCalloutFFDC();
369 s = R"([
370 {
371 "Callout Type": "Hardware Callout",
372 "Guard Type": "FATAL",
373 "Priority": "medium_group_A",
374 "Target": "/proc0/pib/perv12/mc0/mi0/mcc0/omi0"
375 }
376])";
377 EXPECT_EQ(s, j.dump(4));
378}
379
Zane Shelley5d63cef2021-09-17 18:10:17 -0500380TEST(Resolution, ConnectedCallout)
381{
382 auto c1 = std::make_shared<ConnectedCalloutResolution>(
383 callout::BusType::SMP_BUS, iolink_str, callout::Priority::MED_A, true);
384
385 auto c2 = std::make_shared<ConnectedCalloutResolution>(
386 callout::BusType::OMI_BUS, ocmb_str, callout::Priority::MED_B, true);
387
388 auto c3 = std::make_shared<ConnectedCalloutResolution>(
389 callout::BusType::OMI_BUS, omi_str, callout::Priority::MED_C, true);
390
391 libhei::Chip chip{chip_str, 0xdeadbeef};
392 libhei::Signature sig{chip, 0xabcd, 0, 0, libhei::ATTN_TYPE_CHECKSTOP};
393 ServiceData sd{sig, true};
394
395 nlohmann::json j{};
396 std::string s{};
397
398 c1->resolve(sd);
399 c2->resolve(sd);
400 c3->resolve(sd);
401
402 // Callout list
403 j = sd.getCalloutList();
404 s = R"([
405 {
406 "LocationCode": "/proc1",
407 "Priority": "A"
408 },
409 {
410 "LocationCode": "/proc0",
411 "Priority": "B"
412 },
413 {
414 "LocationCode": "/proc0/pib/perv12/mc0/mi0/mcc0/omi0/ocmb0",
415 "Priority": "C"
416 }
417])";
418 EXPECT_EQ(s, j.dump(4));
419
420 // Callout FFDC
421 j = sd.getCalloutFFDC();
422 s = R"([
423 {
424 "Bus Type": "SMP_BUS",
425 "Callout Type": "Connected Callout",
426 "Guard Type": "FATAL",
427 "Priority": "medium_group_A",
428 "Target": "/proc1/pib/perv24/pauc0/iohs0/smpgroup0"
429 },
430 {
431 "Bus Type": "OMI_BUS",
432 "Callout Type": "Connected Callout",
433 "Guard Type": "FATAL",
434 "Priority": "medium_group_B",
435 "Target": "/proc0/pib/perv12/mc0/mi0/mcc0/omi0"
436 },
437 {
438 "Bus Type": "OMI_BUS",
439 "Callout Type": "Connected Callout",
440 "Guard Type": "FATAL",
441 "Priority": "medium_group_C",
442 "Target": "/proc0/pib/perv12/mc0/mi0/mcc0/omi0/ocmb0"
443 }
444])";
445 EXPECT_EQ(s, j.dump(4));
446}
447
Zane Shelley4757a7b2021-09-20 22:23:38 -0500448TEST(Resolution, BusCallout)
449{
450 auto c1 = std::make_shared<HardwareCalloutResolution>(
451 omi_str, callout::Priority::MED_A, true);
452
453 auto c2 = std::make_shared<ConnectedCalloutResolution>(
454 callout::BusType::OMI_BUS, omi_str, callout::Priority::MED_A, true);
455
456 auto c3 = std::make_shared<BusCalloutResolution>(
457 callout::BusType::OMI_BUS, omi_str, callout::Priority::LOW, false);
458
459 libhei::Chip chip{chip_str, 0xdeadbeef};
460 libhei::Signature sig{chip, 0xabcd, 0, 0, libhei::ATTN_TYPE_CHECKSTOP};
461 ServiceData sd{sig, true};
462
463 nlohmann::json j{};
464 std::string s{};
465
466 c1->resolve(sd);
467 c2->resolve(sd);
468 c3->resolve(sd);
469
470 // Callout list
471 j = sd.getCalloutList();
472 s = R"([
473 {
474 "LocationCode": "/proc0",
475 "Priority": "A"
476 },
477 {
478 "LocationCode": "/proc0/pib/perv12/mc0/mi0/mcc0/omi0/ocmb0",
479 "Priority": "A"
480 },
481 {
Zane Shelley1eff9452021-11-03 13:59:54 -0500482 "Deconfigured": false,
483 "Guarded": false,
Zane Shelley4757a7b2021-09-20 22:23:38 -0500484 "LocationCode": "P0",
485 "Priority": "L"
486 }
487])";
488 EXPECT_EQ(s, j.dump(4));
489
490 // Callout FFDC
491 j = sd.getCalloutFFDC();
492 s = R"([
493 {
494 "Callout Type": "Hardware Callout",
495 "Guard Type": "FATAL",
496 "Priority": "medium_group_A",
497 "Target": "/proc0/pib/perv12/mc0/mi0/mcc0/omi0"
498 },
499 {
500 "Bus Type": "OMI_BUS",
501 "Callout Type": "Connected Callout",
502 "Guard Type": "FATAL",
503 "Priority": "medium_group_A",
504 "Target": "/proc0/pib/perv12/mc0/mi0/mcc0/omi0/ocmb0"
505 },
506 {
507 "Bus Type": "OMI_BUS",
508 "Callout Type": "Bus Callout",
509 "Guard Type": "NONE",
510 "Priority": "low",
511 "RX Target": "/proc0/pib/perv12/mc0/mi0/mcc0/omi0",
512 "TX Target": "/proc0/pib/perv12/mc0/mi0/mcc0/omi0/ocmb0"
513 }
514])";
515 EXPECT_EQ(s, j.dump(4));
516}
517
Zane Shelley96d54862021-09-17 11:16:12 -0500518TEST(Resolution, ClockCallout)
519{
520 auto c1 = std::make_shared<ClockCalloutResolution>(
521 callout::ClockType::OSC_REF_CLOCK_1, callout::Priority::HIGH, false);
522
523 libhei::Chip chip{chip_str, 0xdeadbeef};
524 libhei::Signature sig{chip, 0xabcd, 0, 0, libhei::ATTN_TYPE_CHECKSTOP};
525 ServiceData sd{sig, true};
526
527 c1->resolve(sd);
528
529 nlohmann::json j{};
530 std::string s{};
531
532 // Callout list
533 j = sd.getCalloutList();
534 s = R"([
535 {
Zane Shelley1eff9452021-11-03 13:59:54 -0500536 "Deconfigured": false,
537 "Guarded": false,
Zane Shelley96d54862021-09-17 11:16:12 -0500538 "LocationCode": "P0",
539 "Priority": "H"
540 }
541])";
542 EXPECT_EQ(s, j.dump(4));
543
544 // Callout FFDC
545 j = sd.getCalloutFFDC();
546 s = R"([
547 {
548 "Callout Type": "Clock Callout",
549 "Clock Type": "OSC_REF_CLOCK_1",
Zane Shelley1eff9452021-11-03 13:59:54 -0500550 "Priority": "high"
Zane Shelley96d54862021-09-17 11:16:12 -0500551 }
552])";
553 EXPECT_EQ(s, j.dump(4));
554}
555
556TEST(Resolution, ProcedureCallout)
557{
558 auto c1 = std::make_shared<ProcedureCalloutResolution>(
559 callout::Procedure::NEXTLVL, callout::Priority::LOW);
560
561 libhei::Chip chip{chip_str, 0xdeadbeef};
562 libhei::Signature sig{chip, 0xabcd, 0, 0, libhei::ATTN_TYPE_CHECKSTOP};
563 ServiceData sd{sig, true};
564
565 c1->resolve(sd);
566
567 nlohmann::json j{};
568 std::string s{};
569
570 // Callout list
571 j = sd.getCalloutList();
572 s = R"([
573 {
574 "Priority": "L",
575 "Procedure": "NEXTLVL"
576 }
577])";
578 EXPECT_EQ(s, j.dump(4));
579
580 // Callout FFDC
581 j = sd.getCalloutFFDC();
582 s = R"([
583 {
584 "Callout Type": "Procedure Callout",
585 "Priority": "low",
586 "Procedure": "NEXTLVL"
587 }
588])";
589 EXPECT_EQ(s, j.dump(4));
Zane Shelley0b8368c2021-03-18 17:33:41 -0500590}