1*de2a132aSGilbert Chen #include "common/instance_id.hpp" 2*de2a132aSGilbert Chen #include "mock_terminus_manager.hpp" 3*de2a132aSGilbert Chen #include "platform-mc/platform_manager.hpp" 4*de2a132aSGilbert Chen #include "test/test_instance_id.hpp" 5*de2a132aSGilbert Chen 6*de2a132aSGilbert Chen #include <sdeventplus/event.hpp> 7*de2a132aSGilbert Chen 8*de2a132aSGilbert Chen #include <bitset> 9*de2a132aSGilbert Chen 10*de2a132aSGilbert Chen #include <gtest/gtest.h> 11*de2a132aSGilbert Chen 12*de2a132aSGilbert Chen class PlatformManagerTest : public testing::Test 13*de2a132aSGilbert Chen { 14*de2a132aSGilbert Chen protected: 15*de2a132aSGilbert Chen PlatformManagerTest() : 16*de2a132aSGilbert Chen bus(pldm::utils::DBusHandler::getBus()), 17*de2a132aSGilbert Chen event(sdeventplus::Event::get_default()), instanceIdDb(), 18*de2a132aSGilbert Chen reqHandler(pldmTransport, event, instanceIdDb, false, 19*de2a132aSGilbert Chen std::chrono::seconds(1), 2, std::chrono::milliseconds(100)), 20*de2a132aSGilbert Chen mockTerminusManager(event, reqHandler, instanceIdDb, termini, nullptr), 21*de2a132aSGilbert Chen platformManager(mockTerminusManager, termini) 22*de2a132aSGilbert Chen {} 23*de2a132aSGilbert Chen 24*de2a132aSGilbert Chen PldmTransport* pldmTransport = nullptr; 25*de2a132aSGilbert Chen sdbusplus::bus_t& bus; 26*de2a132aSGilbert Chen sdeventplus::Event event; 27*de2a132aSGilbert Chen TestInstanceIdDb instanceIdDb; 28*de2a132aSGilbert Chen pldm::requester::Handler<pldm::requester::Request> reqHandler; 29*de2a132aSGilbert Chen pldm::platform_mc::MockTerminusManager mockTerminusManager; 30*de2a132aSGilbert Chen pldm::platform_mc::PlatformManager platformManager; 31*de2a132aSGilbert Chen std::map<pldm_tid_t, std::shared_ptr<pldm::platform_mc::Terminus>> termini; 32*de2a132aSGilbert Chen }; 33*de2a132aSGilbert Chen 34*de2a132aSGilbert Chen TEST_F(PlatformManagerTest, initTerminusTest) 35*de2a132aSGilbert Chen { 36*de2a132aSGilbert Chen // Add terminus 37*de2a132aSGilbert Chen auto mappedTid = mockTerminusManager.mapTid(pldm::MctpInfo(10, "", "", 1)); 38*de2a132aSGilbert Chen auto tid = mappedTid.value(); 39*de2a132aSGilbert Chen termini[tid] = std::make_shared<pldm::platform_mc::Terminus>( 40*de2a132aSGilbert Chen tid, 1 << PLDM_BASE | 1 << PLDM_PLATFORM); 41*de2a132aSGilbert Chen auto terminus = termini[tid]; 42*de2a132aSGilbert Chen 43*de2a132aSGilbert Chen /* Set supported command by terminus */ 44*de2a132aSGilbert Chen auto size = PLDM_MAX_TYPES * (PLDM_MAX_CMDS_PER_TYPE / 8); 45*de2a132aSGilbert Chen std::vector<uint8_t> pldmCmds(size); 46*de2a132aSGilbert Chen uint8_t type = PLDM_PLATFORM; 47*de2a132aSGilbert Chen uint8_t cmd = PLDM_GET_PDR; 48*de2a132aSGilbert Chen auto idx = type * (PLDM_MAX_CMDS_PER_TYPE / 8) + (cmd / 8); 49*de2a132aSGilbert Chen pldmCmds[idx] = pldmCmds[idx] | (1 << (cmd % 8)); 50*de2a132aSGilbert Chen cmd = PLDM_GET_PDR_REPOSITORY_INFO; 51*de2a132aSGilbert Chen idx = type * (PLDM_MAX_CMDS_PER_TYPE / 8) + (cmd / 8); 52*de2a132aSGilbert Chen pldmCmds[idx] = pldmCmds[idx] | (1 << (cmd % 8)); 53*de2a132aSGilbert Chen termini[tid]->setSupportedCommands(pldmCmds); 54*de2a132aSGilbert Chen 55*de2a132aSGilbert Chen // queue getPDRRepositoryInfo response 56*de2a132aSGilbert Chen const size_t getPDRRepositoryInfoLen = 57*de2a132aSGilbert Chen PLDM_GET_PDR_REPOSITORY_INFO_RESP_BYTES; 58*de2a132aSGilbert Chen std::array<uint8_t, sizeof(pldm_msg_hdr) + getPDRRepositoryInfoLen> 59*de2a132aSGilbert Chen getPDRRepositoryInfoResp{ 60*de2a132aSGilbert Chen 0x0, 0x02, 0x50, PLDM_SUCCESS, 61*de2a132aSGilbert Chen 0x0, // repositoryState 62*de2a132aSGilbert Chen 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 63*de2a132aSGilbert Chen 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, // updateTime 64*de2a132aSGilbert Chen 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 65*de2a132aSGilbert Chen 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, // OEMUpdateTime 66*de2a132aSGilbert Chen 1, 0x0, 0x0, 0x0, // recordCount 67*de2a132aSGilbert Chen 0x0, 0x1, 0x0, 0x0, // repositorySize 68*de2a132aSGilbert Chen 59, 0x0, 0x0, 0x0, // largestRecordSize 69*de2a132aSGilbert Chen 0x0 // dataTransferHandleTimeout 70*de2a132aSGilbert Chen }; 71*de2a132aSGilbert Chen auto rc = mockTerminusManager.enqueueResponse( 72*de2a132aSGilbert Chen (pldm_msg*)getPDRRepositoryInfoResp.data(), 73*de2a132aSGilbert Chen sizeof(getPDRRepositoryInfoResp)); 74*de2a132aSGilbert Chen EXPECT_EQ(rc, PLDM_SUCCESS); 75*de2a132aSGilbert Chen 76*de2a132aSGilbert Chen // queue getPDR responses 77*de2a132aSGilbert Chen const size_t getPdrRespLen = 81; 78*de2a132aSGilbert Chen std::array<uint8_t, sizeof(pldm_msg_hdr) + getPdrRespLen> getPdrResp{ 79*de2a132aSGilbert Chen 0x0, 0x02, 0x51, PLDM_SUCCESS, 0x0, 0x0, 0x0, 0x0, // nextRecordHandle 80*de2a132aSGilbert Chen 0x0, 0x0, 0x0, 0x0, // nextDataTransferHandle 81*de2a132aSGilbert Chen 0x5, // transferFlag 82*de2a132aSGilbert Chen 69, 0x0, // responseCount 83*de2a132aSGilbert Chen // numeric Sensor PDR 84*de2a132aSGilbert Chen 0x1, 0x0, 0x0, 85*de2a132aSGilbert Chen 0x0, // record handle 86*de2a132aSGilbert Chen 0x1, // PDRHeaderVersion 87*de2a132aSGilbert Chen PLDM_NUMERIC_SENSOR_PDR, // PDRType 88*de2a132aSGilbert Chen 0x0, 89*de2a132aSGilbert Chen 0x0, // recordChangeNumber 90*de2a132aSGilbert Chen PLDM_PDR_NUMERIC_SENSOR_PDR_FIXED_LENGTH + 91*de2a132aSGilbert Chen PLDM_PDR_NUMERIC_SENSOR_PDR_VARIED_SENSOR_DATA_SIZE_MIN_LENGTH + 92*de2a132aSGilbert Chen PLDM_PDR_NUMERIC_SENSOR_PDR_VARIED_RANGE_FIELD_MIN_LENGTH, 93*de2a132aSGilbert Chen 0, // dataLength 94*de2a132aSGilbert Chen 0, 95*de2a132aSGilbert Chen 0, // PLDMTerminusHandle 96*de2a132aSGilbert Chen 0x1, 97*de2a132aSGilbert Chen 0x0, // sensorID=1 98*de2a132aSGilbert Chen 120, 99*de2a132aSGilbert Chen 0, // entityType=Power Supply(120) 100*de2a132aSGilbert Chen 1, 101*de2a132aSGilbert Chen 0, // entityInstanceNumber 102*de2a132aSGilbert Chen 0x1, 103*de2a132aSGilbert Chen 0x0, // containerID=1 104*de2a132aSGilbert Chen PLDM_NO_INIT, // sensorInit 105*de2a132aSGilbert Chen false, // sensorAuxiliaryNamesPDR 106*de2a132aSGilbert Chen PLDM_SENSOR_UNIT_DEGRESS_C, // baseUint(2)=degrees C 107*de2a132aSGilbert Chen 1, // unitModifier = 1 108*de2a132aSGilbert Chen 0, // rateUnit 109*de2a132aSGilbert Chen 0, // baseOEMUnitHandle 110*de2a132aSGilbert Chen 0, // auxUnit 111*de2a132aSGilbert Chen 0, // auxUnitModifier 112*de2a132aSGilbert Chen 0, // auxRateUnit 113*de2a132aSGilbert Chen 0, // rel 114*de2a132aSGilbert Chen 0, // auxOEMUnitHandle 115*de2a132aSGilbert Chen true, // isLinear 116*de2a132aSGilbert Chen PLDM_SENSOR_DATA_SIZE_UINT8, // sensorDataSize 117*de2a132aSGilbert Chen 0, 0, 0xc0, 118*de2a132aSGilbert Chen 0x3f, // resolution=1.5 119*de2a132aSGilbert Chen 0, 0, 0x80, 120*de2a132aSGilbert Chen 0x3f, // offset=1.0 121*de2a132aSGilbert Chen 0, 122*de2a132aSGilbert Chen 0, // accuracy 123*de2a132aSGilbert Chen 0, // plusTolerance 124*de2a132aSGilbert Chen 0, // minusTolerance 125*de2a132aSGilbert Chen 2, // hysteresis 126*de2a132aSGilbert Chen 0, // supportedThresholds 127*de2a132aSGilbert Chen 0, // thresholdAndHysteresisVolatility 128*de2a132aSGilbert Chen 0, 0, 0x80, 129*de2a132aSGilbert Chen 0x3f, // stateTransistionInterval=1.0 130*de2a132aSGilbert Chen 0, 0, 0x80, 131*de2a132aSGilbert Chen 0x3f, // updateInverval=1.0 132*de2a132aSGilbert Chen 255, // maxReadable 133*de2a132aSGilbert Chen 0, // minReadable 134*de2a132aSGilbert Chen PLDM_RANGE_FIELD_FORMAT_UINT8, // rangeFieldFormat 135*de2a132aSGilbert Chen 0, // rangeFieldsupport 136*de2a132aSGilbert Chen 0, // nominalValue 137*de2a132aSGilbert Chen 0, // normalMax 138*de2a132aSGilbert Chen 0, // normalMin 139*de2a132aSGilbert Chen 0, // warningHigh 140*de2a132aSGilbert Chen 0, // warningLow 141*de2a132aSGilbert Chen 0, // criticalHigh 142*de2a132aSGilbert Chen 0, // criticalLow 143*de2a132aSGilbert Chen 0, // fatalHigh 144*de2a132aSGilbert Chen 0 // fatalLow 145*de2a132aSGilbert Chen }; 146*de2a132aSGilbert Chen rc = mockTerminusManager.enqueueResponse((pldm_msg*)getPdrResp.data(), 147*de2a132aSGilbert Chen sizeof(getPdrResp)); 148*de2a132aSGilbert Chen EXPECT_EQ(rc, PLDM_SUCCESS); 149*de2a132aSGilbert Chen 150*de2a132aSGilbert Chen stdexec::sync_wait(platformManager.initTerminus()); 151*de2a132aSGilbert Chen EXPECT_EQ(true, terminus->initialized); 152*de2a132aSGilbert Chen EXPECT_EQ(1, terminus->pdrs.size()); 153*de2a132aSGilbert Chen } 154*de2a132aSGilbert Chen 155*de2a132aSGilbert Chen TEST_F(PlatformManagerTest, initTerminusDontSupportGetPDRTest) 156*de2a132aSGilbert Chen { 157*de2a132aSGilbert Chen // Add terminus 158*de2a132aSGilbert Chen auto mappedTid = mockTerminusManager.mapTid(pldm::MctpInfo(10, "", "", 1)); 159*de2a132aSGilbert Chen auto tid = mappedTid.value(); 160*de2a132aSGilbert Chen termini[tid] = std::make_shared<pldm::platform_mc::Terminus>( 161*de2a132aSGilbert Chen tid, 1 << PLDM_BASE | 1 << PLDM_PLATFORM); 162*de2a132aSGilbert Chen auto terminus = termini[tid]; 163*de2a132aSGilbert Chen 164*de2a132aSGilbert Chen /* Set supported command by terminus */ 165*de2a132aSGilbert Chen auto size = PLDM_MAX_TYPES * (PLDM_MAX_CMDS_PER_TYPE / 8); 166*de2a132aSGilbert Chen std::vector<uint8_t> pldmCmds(size); 167*de2a132aSGilbert Chen uint8_t type = PLDM_PLATFORM; 168*de2a132aSGilbert Chen uint8_t cmd = PLDM_GET_PDR_REPOSITORY_INFO; 169*de2a132aSGilbert Chen auto idx = type * (PLDM_MAX_CMDS_PER_TYPE / 8) + (cmd / 8); 170*de2a132aSGilbert Chen pldmCmds[idx] = pldmCmds[idx] | (1 << (cmd % 8)); 171*de2a132aSGilbert Chen termini[tid]->setSupportedCommands(pldmCmds); 172*de2a132aSGilbert Chen 173*de2a132aSGilbert Chen // queue getPDRRepositoryInfo response 174*de2a132aSGilbert Chen const size_t getPDRRepositoryInfoLen = 175*de2a132aSGilbert Chen PLDM_GET_PDR_REPOSITORY_INFO_RESP_BYTES; 176*de2a132aSGilbert Chen std::array<uint8_t, sizeof(pldm_msg_hdr) + getPDRRepositoryInfoLen> 177*de2a132aSGilbert Chen getPDRRepositoryInfoResp{ 178*de2a132aSGilbert Chen 0x0, 0x02, 0x50, PLDM_SUCCESS, 179*de2a132aSGilbert Chen 0x0, // repositoryState 180*de2a132aSGilbert Chen 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 181*de2a132aSGilbert Chen 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, // updateTime 182*de2a132aSGilbert Chen 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 183*de2a132aSGilbert Chen 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, // OEMUpdateTime 184*de2a132aSGilbert Chen 1, 0x0, 0x0, 0x0, // recordCount 185*de2a132aSGilbert Chen 0x0, 0x1, 0x0, 0x0, // repositorySize 186*de2a132aSGilbert Chen 59, 0x0, 0x0, 0x0, // largestRecordSize 187*de2a132aSGilbert Chen 0x0 // dataTransferHandleTimeout 188*de2a132aSGilbert Chen }; 189*de2a132aSGilbert Chen auto rc = mockTerminusManager.enqueueResponse( 190*de2a132aSGilbert Chen (pldm_msg*)getPDRRepositoryInfoResp.data(), 191*de2a132aSGilbert Chen sizeof(getPDRRepositoryInfoResp)); 192*de2a132aSGilbert Chen EXPECT_EQ(rc, PLDM_SUCCESS); 193*de2a132aSGilbert Chen 194*de2a132aSGilbert Chen // queue getPDR responses 195*de2a132aSGilbert Chen const size_t getPdrRespLen = 81; 196*de2a132aSGilbert Chen std::array<uint8_t, sizeof(pldm_msg_hdr) + getPdrRespLen> getPdrResp{ 197*de2a132aSGilbert Chen 0x0, 0x02, 0x51, PLDM_SUCCESS, 0x0, 0x0, 0x0, 0x0, // nextRecordHandle 198*de2a132aSGilbert Chen 0x0, 0x0, 0x0, 0x0, // nextDataTransferHandle 199*de2a132aSGilbert Chen 0x5, // transferFlag 200*de2a132aSGilbert Chen 69, 0x0, // responseCount 201*de2a132aSGilbert Chen // numeric Sensor PDR 202*de2a132aSGilbert Chen 0x1, 0x0, 0x0, 203*de2a132aSGilbert Chen 0x0, // record handle 204*de2a132aSGilbert Chen 0x1, // PDRHeaderVersion 205*de2a132aSGilbert Chen PLDM_NUMERIC_SENSOR_PDR, // PDRType 206*de2a132aSGilbert Chen 0x0, 207*de2a132aSGilbert Chen 0x0, // recordChangeNumber 208*de2a132aSGilbert Chen PLDM_PDR_NUMERIC_SENSOR_PDR_FIXED_LENGTH + 209*de2a132aSGilbert Chen PLDM_PDR_NUMERIC_SENSOR_PDR_VARIED_SENSOR_DATA_SIZE_MIN_LENGTH + 210*de2a132aSGilbert Chen PLDM_PDR_NUMERIC_SENSOR_PDR_VARIED_RANGE_FIELD_MIN_LENGTH, 211*de2a132aSGilbert Chen 0, // dataLength 212*de2a132aSGilbert Chen 0, 213*de2a132aSGilbert Chen 0, // PLDMTerminusHandle 214*de2a132aSGilbert Chen 0x1, 215*de2a132aSGilbert Chen 0x0, // sensorID=1 216*de2a132aSGilbert Chen 120, 217*de2a132aSGilbert Chen 0, // entityType=Power Supply(120) 218*de2a132aSGilbert Chen 1, 219*de2a132aSGilbert Chen 0, // entityInstanceNumber 220*de2a132aSGilbert Chen 0x1, 221*de2a132aSGilbert Chen 0x0, // containerID=1 222*de2a132aSGilbert Chen PLDM_NO_INIT, // sensorInit 223*de2a132aSGilbert Chen false, // sensorAuxiliaryNamesPDR 224*de2a132aSGilbert Chen PLDM_SENSOR_UNIT_DEGRESS_C, // baseUint(2)=degrees C 225*de2a132aSGilbert Chen 1, // unitModifier = 1 226*de2a132aSGilbert Chen 0, // rateUnit 227*de2a132aSGilbert Chen 0, // baseOEMUnitHandle 228*de2a132aSGilbert Chen 0, // auxUnit 229*de2a132aSGilbert Chen 0, // auxUnitModifier 230*de2a132aSGilbert Chen 0, // auxRateUnit 231*de2a132aSGilbert Chen 0, // rel 232*de2a132aSGilbert Chen 0, // auxOEMUnitHandle 233*de2a132aSGilbert Chen true, // isLinear 234*de2a132aSGilbert Chen PLDM_SENSOR_DATA_SIZE_UINT8, // sensorDataSize 235*de2a132aSGilbert Chen 0, 0, 0xc0, 236*de2a132aSGilbert Chen 0x3f, // resolution=1.5 237*de2a132aSGilbert Chen 0, 0, 0x80, 238*de2a132aSGilbert Chen 0x3f, // offset=1.0 239*de2a132aSGilbert Chen 0, 240*de2a132aSGilbert Chen 0, // accuracy 241*de2a132aSGilbert Chen 0, // plusTolerance 242*de2a132aSGilbert Chen 0, // minusTolerance 243*de2a132aSGilbert Chen 2, // hysteresis 244*de2a132aSGilbert Chen 0, // supportedThresholds 245*de2a132aSGilbert Chen 0, // thresholdAndHysteresisVolatility 246*de2a132aSGilbert Chen 0, 0, 0x80, 247*de2a132aSGilbert Chen 0x3f, // stateTransistionInterval=1.0 248*de2a132aSGilbert Chen 0, 0, 0x80, 249*de2a132aSGilbert Chen 0x3f, // updateInverval=1.0 250*de2a132aSGilbert Chen 255, // maxReadable 251*de2a132aSGilbert Chen 0, // minReadable 252*de2a132aSGilbert Chen PLDM_RANGE_FIELD_FORMAT_UINT8, // rangeFieldFormat 253*de2a132aSGilbert Chen 0, // rangeFieldsupport 254*de2a132aSGilbert Chen 0, // nominalValue 255*de2a132aSGilbert Chen 0, // normalMax 256*de2a132aSGilbert Chen 0, // normalMin 257*de2a132aSGilbert Chen 0, // warningHigh 258*de2a132aSGilbert Chen 0, // warningLow 259*de2a132aSGilbert Chen 0, // criticalHigh 260*de2a132aSGilbert Chen 0, // criticalLow 261*de2a132aSGilbert Chen 0, // fatalHigh 262*de2a132aSGilbert Chen 0 // fatalLow 263*de2a132aSGilbert Chen }; 264*de2a132aSGilbert Chen rc = mockTerminusManager.enqueueResponse((pldm_msg*)getPdrResp.data(), 265*de2a132aSGilbert Chen sizeof(getPdrResp)); 266*de2a132aSGilbert Chen EXPECT_EQ(rc, PLDM_SUCCESS); 267*de2a132aSGilbert Chen 268*de2a132aSGilbert Chen stdexec::sync_wait(platformManager.initTerminus()); 269*de2a132aSGilbert Chen EXPECT_EQ(true, terminus->initialized); 270*de2a132aSGilbert Chen EXPECT_EQ(0, terminus->pdrs.size()); 271*de2a132aSGilbert Chen } 272*de2a132aSGilbert Chen 273*de2a132aSGilbert Chen TEST_F(PlatformManagerTest, negativeInitTerminusTest1) 274*de2a132aSGilbert Chen { 275*de2a132aSGilbert Chen // terminus doesn't Type2 support 276*de2a132aSGilbert Chen auto mappedTid = mockTerminusManager.mapTid(pldm::MctpInfo(10, "", "", 1)); 277*de2a132aSGilbert Chen auto tid = mappedTid.value(); 278*de2a132aSGilbert Chen termini[tid] = 279*de2a132aSGilbert Chen std::make_shared<pldm::platform_mc::Terminus>(tid, 1 << PLDM_BASE); 280*de2a132aSGilbert Chen auto terminus = termini[tid]; 281*de2a132aSGilbert Chen 282*de2a132aSGilbert Chen stdexec::sync_wait(platformManager.initTerminus()); 283*de2a132aSGilbert Chen EXPECT_EQ(true, terminus->initialized); 284*de2a132aSGilbert Chen EXPECT_EQ(0, terminus->pdrs.size()); 285*de2a132aSGilbert Chen } 286*de2a132aSGilbert Chen 287*de2a132aSGilbert Chen TEST_F(PlatformManagerTest, negativeInitTerminusTest2) 288*de2a132aSGilbert Chen { 289*de2a132aSGilbert Chen // terminus responses error 290*de2a132aSGilbert Chen auto mappedTid = mockTerminusManager.mapTid(pldm::MctpInfo(10, "", "", 1)); 291*de2a132aSGilbert Chen auto tid = mappedTid.value(); 292*de2a132aSGilbert Chen termini[tid] = std::make_shared<pldm::platform_mc::Terminus>( 293*de2a132aSGilbert Chen tid, 1 << PLDM_BASE | 1 << PLDM_PLATFORM); 294*de2a132aSGilbert Chen auto terminus = termini[tid]; 295*de2a132aSGilbert Chen 296*de2a132aSGilbert Chen // queue getPDRRepositoryInfo response cc=PLDM_ERROR 297*de2a132aSGilbert Chen const size_t getPDRRepositoryInfoLen = 1; 298*de2a132aSGilbert Chen std::array<uint8_t, sizeof(pldm_msg_hdr) + getPDRRepositoryInfoLen> 299*de2a132aSGilbert Chen getPDRRepositoryInfoResp{0x0, 0x02, 0x50, PLDM_ERROR}; 300*de2a132aSGilbert Chen auto rc = mockTerminusManager.enqueueResponse( 301*de2a132aSGilbert Chen (pldm_msg*)getPDRRepositoryInfoResp.data(), 302*de2a132aSGilbert Chen sizeof(getPDRRepositoryInfoResp)); 303*de2a132aSGilbert Chen EXPECT_EQ(rc, PLDM_SUCCESS); 304*de2a132aSGilbert Chen 305*de2a132aSGilbert Chen // queue getPDR responses cc=PLDM_ERROR 306*de2a132aSGilbert Chen const size_t getPdrRespLen = 1; 307*de2a132aSGilbert Chen std::array<uint8_t, sizeof(pldm_msg_hdr) + getPdrRespLen> getPdrResp{ 308*de2a132aSGilbert Chen 0x0, 0x02, 0x51, PLDM_ERROR}; 309*de2a132aSGilbert Chen rc = mockTerminusManager.enqueueResponse((pldm_msg*)getPdrResp.data(), 310*de2a132aSGilbert Chen sizeof(getPdrResp)); 311*de2a132aSGilbert Chen EXPECT_EQ(rc, PLDM_SUCCESS); 312*de2a132aSGilbert Chen 313*de2a132aSGilbert Chen stdexec::sync_wait(platformManager.initTerminus()); 314*de2a132aSGilbert Chen EXPECT_EQ(true, terminus->initialized); 315*de2a132aSGilbert Chen EXPECT_EQ(0, terminus->pdrs.size()); 316*de2a132aSGilbert Chen } 317