Skip to content

Commit

Permalink
Enable mbox test cases
Browse files Browse the repository at this point in the history
Change-Id: I22f80858539438871d33b06be505854149d267a0
RTC: 179069
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/46699
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
crgeddes authored and dcrowell77 committed Oct 10, 2017
1 parent c411e8e commit a6aecde
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 65 deletions.
6 changes: 1 addition & 5 deletions src/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,8 @@ TESTCASE_MODULES += testsbeio
# @TODO DefecT: 1035550 Figure out why testattn is failing sometimes
#TESTCASE_MODULES += testattn

TESTCASE_MODULES += testmbox

#*******************************************************
#These modules do not work and are not tracked by any stories
#*******************************************************
#might need to enable isteps that turn mailboxes on
#TESTCASE_MODULES += testmbox

TESTCASE_MODULES += testrtloader

Expand Down
121 changes: 61 additions & 60 deletions src/usr/mbox/test/mboxsptest.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2015 */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -144,8 +144,8 @@ class MboxSPTest : public CxxTest::TestSuite

++msg_idx;

if(msg->type != 1 ||
msg->data[0] != msg_idx ||
if(msg->type != 1 ||
msg->data[0] != msg_idx ||
msg->data[1] != 33 * 1024)
{
TS_FAIL("MBOXTEST: Unexpected message from FSP");
Expand Down Expand Up @@ -228,7 +228,7 @@ class MboxSPTest : public CxxTest::TestSuite

msg->type = 2;
msg->data[1] = 128 * 1024; // too big of message
msg->extra_data = malloc(8);
msg->extra_data = malloc(8);
err = MBOX::sendrecv(MBOX::FSP_ECHO_MSGQ,msg);

if(!err)
Expand Down Expand Up @@ -332,63 +332,64 @@ class MboxSPTest : public CxxTest::TestSuite

/**
* @brief IPC message test
*
*
*/
void testIPC(void)
{
TRACFCOMP(g_trac_mbox,"testIPC>");
errlHndl_t err = NULL;
msg_t * msg = msg_allocate();
msg_t * tmsg = msg_allocate();
msg_q_t msgQ = msg_q_create();

err = MBOX::msgq_register(MBOX::HB_TEST_MSGQ,msgQ);
if(err)
{
TS_FAIL("MBOX IPC: Could not register message queue");
errlCommit(err,MBOX_COMP_ID);
}

msg->type = 1;
msg->data[0] = 0x1111111111111111ull;
msg->data[1] = 0x4444444444444444ull;
msg->extra_data = (void *)0x3333333333333333ull;

*tmsg = *msg; // save for compare
uint64_t node = 0;

err = MBOX::send(MBOX::HB_TEST_MSGQ,msg,node);
if(err)
{
TS_FAIL("MBOX::send (IPC) returned and error log");
errlCommit(err,MBOX_COMP_ID);
msg_free(msg);
return;
}

msg_t * rmsg = msg_wait(msgQ);

if(rmsg->type != tmsg->type ||
rmsg->data[0] != tmsg->data[0] ||
rmsg->data[1] != tmsg->data[1] ||
rmsg->extra_data != tmsg->extra_data)
{
TS_FAIL("IPCTEST: Unexpected IPC message");

TRACFCOMP(g_trac_mbox,
"IPCTEST IPC MSG: %d %lx %lx %p",
rmsg->type,
rmsg->data[0],
rmsg->data[1],
rmsg->extra_data);
}

msgQ = MBOX::msgq_unregister(MBOX::HB_TEST_MSGQ);
msg_q_destroy(msgQ);
msg_free(rmsg);
msg_free(tmsg);
TRACFCOMP(g_trac_mbox,"<testIPC");
}
// TODO: RTC:150861 re-enable test when IPC is available
// void testIPC(void)
// {
// TRACFCOMP(g_trac_mbox,"testIPC>");
// errlHndl_t err = NULL;
// msg_t * msg = msg_allocate();
// msg_t * tmsg = msg_allocate();
// msg_q_t msgQ = msg_q_create();
//
// err = MBOX::msgq_register(MBOX::HB_TEST_MSGQ,msgQ);
// if(err)
// {
// TS_FAIL("MBOX IPC: Could not register message queue");
// errlCommit(err,MBOX_COMP_ID);
// }
//
// msg->type = 1;
// msg->data[0] = 0x1111111111111111ull;
// msg->data[1] = 0x4444444444444444ull;
// msg->extra_data = (void *)0x3333333333333333ull;
//
// *tmsg = *msg; // save for compare
// uint64_t node = 0;
//
// err = MBOX::send(MBOX::HB_TEST_MSGQ,msg,node);
// if(err)
// {
// TS_FAIL("MBOX::send (IPC) returned and error log");
// errlCommit(err,MBOX_COMP_ID);
// msg_free(msg);
// return;
// }
//
// msg_t * rmsg = msg_wait(msgQ);
//
// if(rmsg->type != tmsg->type ||
// rmsg->data[0] != tmsg->data[0] ||
// rmsg->data[1] != tmsg->data[1] ||
// rmsg->extra_data != tmsg->extra_data)
// {
// TS_FAIL("IPCTEST: Unexpected IPC message");
//
// TRACFCOMP(g_trac_mbox,
// "IPCTEST IPC MSG: %d %lx %lx %p",
// rmsg->type,
// rmsg->data[0],
// rmsg->data[1],
// rmsg->extra_data);
// }
//
// msgQ = MBOX::msgq_unregister(MBOX::HB_TEST_MSGQ);
// msg_q_destroy(msgQ);
// msg_free(rmsg);
// msg_free(tmsg);
// TRACFCOMP(g_trac_mbox,"<testIPC");
// }
};

#endif
Expand Down

0 comments on commit a6aecde

Please sign in to comment.