Skip to content

Commit

Permalink
Full Path of SBE message passing Add HTMGT default path testing
Browse files Browse the repository at this point in the history
Add a test that calls the default HTMGT processing path when HTMGT
is configured.

Change-Id: I6cde3e9fbf35370118e715c19fb4f63c2ee21edd
RTC:173806
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40099
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
  • Loading branch information
mgloff authored and wghoffa committed May 18, 2017
1 parent ce71d0b commit 291b8a5
Showing 1 changed file with 94 additions and 3 deletions.
97 changes: 94 additions & 3 deletions src/usr/sbeio/runtime/test/sbeiotestRt.H
Expand Up @@ -161,9 +161,9 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite
TS_INFO("SBE Communication area not available from "
"SBE_COMM_ADDR attribute");
uint64_t l_instance = proc->getAttr<ATTR_POSITION>();
o_sbeCommAddr =
g_hostInterfaces->get_reserved_mem("ibm,sbe-comm",
l_instance);
o_sbeCommAddr = g_hostInterfaces->get_reserved_mem(
HBRT_RSVD_MEM__SBE_COMM,
l_instance);
if(NULL == o_sbeCommAddr)
{
rc = -1;
Expand Down Expand Up @@ -730,6 +730,97 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite
"testSbeMessagePassingDataOffset");
}

/**
* @brief testSbeMessagePassing Unit test for the
* SBE message passing default path.
*/
void testSbeMessagePassingDefaultPath(void)
{
#ifdef CONFIG_HTMGT
// Test entry
TRACFCOMP(g_trac_sbeio, ENTER_MRK "SbeMessagePassingRtTest::"
"testSbeMessagePassingDefaultPath");

sbeMessage_t l_request;
sbeMessage_t l_expected_response;
RT_TARG::rtChipId_t chipId = 0;
uint64_t l_sbeCommAddr = 0;
runtimeInterfaces_t *rt_intf = nullptr;

int rc = 0;

do
{
// Do initializations for SBE Message passing
rc = initSbeMessagePassing(l_request,
l_expected_response,
chipId,
l_sbeCommAddr,
&rt_intf);

// Get the response address in the SBE Communication area
sbeMessage_t *l_sbeCommAddr_rsp =
reinterpret_cast<sbeMessage_t*>(l_sbeCommAddr);

// Copy test request into SBE Communication area
memcpy(reinterpret_cast<void*>(l_sbeCommAddr),
reinterpret_cast<void*>(&l_request),
l_request.sbeHdr.msgSize);

// Call the SBE message passing code
TRACFCOMP(g_trac_sbeio, "SbeMessagePassingRtTest::"
"testSbeMessagePassingDefaultPath "
"calling sbe_message_passing");
rc = rt_intf->sbe_message_passing(chipId);
if(0 != rc)
{
TS_FAIL("Unexpected return during RT SBE message passing. "
"Testing default path for chipID: 0x%08X, rc: "
"0x%08x, but expected 0",
chipId, rc);
break;
}

// Compare test response from SBE Communication area
if(cmpSbeHdr(*l_sbeCommAddr_rsp, l_expected_response) ||
cmpCmdHdr(*l_sbeCommAddr_rsp, l_expected_response))
{
TRACFBIN( g_trac_sbeio,
"testSbeMessagePassingDefaultPath: expected rsp",
&l_expected_response,
l_expected_response.sbeHdr.msgSize);
TRACFBIN( g_trac_sbeio,
"testSbeMessagePassingDefaultPath: actual rsp",
l_sbeCommAddr_rsp,
l_sbeCommAddr_rsp->sbeHdr.msgSize);
TS_FAIL("Unexpected response from RT SBE message passing. "
"Testing default path for chipID: 0x%08X",
chipId);
break;
}

// Check setting of bits in CFAM register
rc = checkResetSbeMessagePassingCFAM(chipId);
if(0 != rc)
{
TS_FAIL("Unexpected error during RT SBE message passing. "
"chipID: 0x%08X, rc: 0x%08x, but expected 0 for "
"CFAM register checking",
chipId, rc);
break;
}
}while (0);

// Test exit
TRACFCOMP(g_trac_sbeio, EXIT_MRK "SbeMessagePassingRtTest::"
"testSbeMessagePassingDefaultPath");
#else
TRACFCOMP(g_trac_sbeio, "SbeMessagePassingRtTest::"
"testSbeMessagePassingDefaultPath skipped "
"because HTMGT is not supported");
#endif
}

/**
* @brief testSbeMessagePassing Unit test for the
* SBE message passing function.
Expand Down

0 comments on commit 291b8a5

Please sign in to comment.