summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@us.ibm.com>2012-12-11 15:44:56 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-12-13 13:00:03 -0600
commita6b9b70b9dd7651a8e1b99f474e2a8128f0740af (patch)
tree2d0e7093fc2359dc1e90ee56379dfb48502f5460
parent59c4e0d981d865d6cb84aa73f8ba079668cbad7d (diff)
downloadblackbird-hostboot-a6b9b70b9dd7651a8e1b99f474e2a8128f0740af.tar.gz
blackbird-hostboot-a6b9b70b9dd7651a8e1b99f474e2a8128f0740af.zip
Remove some memory diagnostics tests.
Change-Id: If7c37d8ec0be993d8e577d21adaded57f54c60b4 RTC: 60430 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2646 Tested-by: Jenkins Server Reviewed-by: Zane Shelley <zshelle@us.ibm.com> Reviewed-by: Christopher T. Phan <cphan@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r--src/usr/diag/mdia/test/mdiafakesm.C60
-rw-r--r--src/usr/diag/mdia/test/mdiafakesm.H40
-rw-r--r--src/usr/diag/mdia/test/mdiatest.H58
-rw-r--r--src/usr/diag/mdia/test/mdiatestsm.H188
4 files changed, 23 insertions, 323 deletions
diff --git a/src/usr/diag/mdia/test/mdiafakesm.C b/src/usr/diag/mdia/test/mdiafakesm.C
index 6b1372b15..66545613b 100644
--- a/src/usr/diag/mdia/test/mdiafakesm.C
+++ b/src/usr/diag/mdia/test/mdiafakesm.C
@@ -151,64 +151,4 @@ bool FakeStateMachine1::isEqual(
return isEqual;
}
-
-errlHndl_t FakeStateMachine2::doMaintCommand(WorkFlowProperties & i_wfp)
-{
- MDIA_DBG("FakeStateMachine2: doMaintCommand");
- mutex_lock(&iv_mutex);
-
- uint32_t timeout = 100;
- i_wfp.timer = getMonitor().addMonitor(timeout);
-
- uint64_t workItem = *i_wfp.workItem;
- bool restart = i_wfp.restartCommand;
-
- mutex_unlock(&iv_mutex);
-
- switch(workItem) {
-
- case START_PATTERN_0:
- case START_PATTERN_1:
- case START_PATTERN_2:
- case START_PATTERN_3:
- case START_PATTERN_4:
- case START_PATTERN_5:
- case START_PATTERN_6:
- case START_PATTERN_7:
- case START_SCRUB:
-
- mutex_lock(&iv_mutex);
-
- if(restart) {
- MDIA_DBG("FakeStateMachine2: issuing increment address on: %p",
- getTarget(i_wfp));
- // TODO...restart the command (increment address)
- }
- else {
- MDIA_DBG("FakeStateMachine2: issuing maint command on: %p",
- getTarget(i_wfp));
- // TODO...start a command
- }
-
- mutex_unlock(&iv_mutex);
-
- break;
-
- default:
- break;
- }
-
- return 0;
-}
-
-CommandMonitor & FakeStateMachine2::getMonitor()
-{
- if(!iv_monitor)
- {
- MDIA_DBG("FakeStateMachine2: Starting monitor...");
- iv_monitor = new FakeCommandMonitor();
- iv_monitor->start(*this);
- }
- return *iv_monitor;
-}
}
diff --git a/src/usr/diag/mdia/test/mdiafakesm.H b/src/usr/diag/mdia/test/mdiafakesm.H
index 78e402a38..a2cd8de3b 100644
--- a/src/usr/diag/mdia/test/mdiafakesm.H
+++ b/src/usr/diag/mdia/test/mdiafakesm.H
@@ -157,45 +157,5 @@ class FakeStateMachine1 : public StateMachine
*/
mutex_t *iv_mutex;
};
-
-/**
- * @brief FakeStateMachine2
- *
- * Used to test processing a maint command timeout
- * from the StateMachine perspective
- */
-class FakeStateMachine2 : public StateMachine
-{
- public:
-
- /**
- * @brief doMaintCommand maint command work item handler
- *
- * determine correct comman and issue it. Does not support
- * polling/processing fake events.
- *
- * @param[in] i_wfp the target for which a command should be issued
- */
- errlHndl_t doMaintCommand(WorkFlowProperties & i_wfp);
-
- /**
- * @brief ctor
- */
- FakeStateMachine2(){}
-
- /**
- * @brief dtor
- */
- ~FakeStateMachine2(){}
-
- private:
-
- /**
- * @brief getMonitor Create and start the FakeMdiaCMTest
- *
- * @retval CommandMonitor reference
- */
- CommandMonitor & getMonitor();
-};
}
#endif
diff --git a/src/usr/diag/mdia/test/mdiatest.H b/src/usr/diag/mdia/test/mdiatest.H
index b32401d99..43b1db8df 100644
--- a/src/usr/diag/mdia/test/mdiatest.H
+++ b/src/usr/diag/mdia/test/mdiatest.H
@@ -1,25 +1,25 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/diag/mdia/test/mdiatest.H $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2012
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/mdia/test/mdiatest.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
#ifndef __TEST_MDIATESTMDIA_H
#define __TEST_MDIATESTMDIA_H
@@ -46,23 +46,11 @@ class MdiaTest : public CxxTest::TestSuite
TargetHandleList list;
- TS_TRACE(ENTER_MRK "checkpoint");
errlHndl_t err = runStep(list);
if(err)
{
- TS_FAIL("getMbaDiagnosticMode failed unexpectedly");
- }
-
- TargetHandle_t target = 0;
-
- list.push_back(target);
-
- err = runStep(list);
-
- if(err)
- {
- TS_FAIL("getMbaDiagnosticMode failed unexpectedly");
+ TS_FAIL("runStep failed unexpectedly");
}
TS_TRACE(EXIT_MRK "testRunStep");
diff --git a/src/usr/diag/mdia/test/mdiatestsm.H b/src/usr/diag/mdia/test/mdiatestsm.H
index 3874c2f57..f7fe5bf1a 100644
--- a/src/usr/diag/mdia/test/mdiatestsm.H
+++ b/src/usr/diag/mdia/test/mdiatestsm.H
@@ -48,8 +48,6 @@ class MdiaSmTest : public CxxTest::TestSuite
void getTargets(uint64_t i_count, TARGETING::TargetHandleList & o_list)
{
- // TODO...real target mbas
-
TARGETING::TargetHandle_t first = 0;
while(i_count-- != 0)
@@ -615,191 +613,5 @@ class MdiaSmTest : public CxxTest::TestSuite
TS_TRACE(EXIT_MRK "testSmRun");
}
-
- void testSmDoMaintCommand(void)
- {
- using namespace MDIA;
- using namespace TARGETING;
-
- TS_TRACE(ENTER_MRK "testSmDoMaintCommand");
-
- StateMachine s;
-
- WorkFlowAssocMap wkFlentries;
-
- TargetHandleList targets;
- getTargets(1, targets);
-
- wkFlentries[targets[0]].push_back(START_SCRUB);
- s.setup(wkFlentries);
-
- WorkFlowProperties & wfp = *s.iv_workFlowProperties.front();
- s.executeWorkItem(&wfp);
-
- TS_TRACE(EXIT_MRK "testSmDoMaintCommand");
- }
-
- void testSmRunning(void)
- {
- TS_TRACE(ENTER_MRK "testSmRunning");
-
- StateMachine s;
-
- bool running = false;
-
- do {
-
- s.running(running);
-
- if(running)
- {
- TS_FAIL("unexpected result calling running (1)");
- break;
- }
-
- WorkFlowAssocMap wkFlentries;
-
- TargetHandleList targets;
- getTargets(1, targets);
-
- wkFlentries[targets[0]].push_back(START_SCRUB);
-
- s.setup(wkFlentries);
-
- s.running(running);
-
- if(!running)
- {
- TS_FAIL("unexpected result calling running (2)");
- break;
- }
-
- s.reset();
-
- s.run(wkFlentries);
-
- s.running(running);
-
- if(running)
- {
- TS_FAIL("unexpected result calling running (3)");
- break;
- }
-
- } while(0);
-
- TS_TRACE(EXIT_MRK "testSmRunning");
- }
-
- void testSmProcessCommandTimeout(void)
- {
- using namespace MDIA;
- using namespace TARGETING;
-
- TS_TRACE(ENTER_MRK "testSmProcessCommandTimeout");
-
- FakeStateMachine2 stateMac;
- WorkFlowAssocMap wkFlEntries;
-
- TargetHandleList targets;
- getTargets(3, targets);
-
- wkFlEntries[targets[0]].push_back(START_SCRUB);
- wkFlEntries[targets[1]].push_back(START_SCRUB);
- wkFlEntries[targets[2]].push_back(START_SCRUB);
- stateMac.setup(wkFlEntries);
-
- uint64_t indexWkPr = stateMac.iv_workFlowProperties.size();
- while(indexWkPr-- != 0)
- {
- stateMac.doMaintCommand(
- *stateMac.iv_workFlowProperties[indexWkPr]);
- }
-
- static const uint64_t wakeupIntervalNanoSecs = 100000000;
- nanosleep(0, TARGETING::is_vpo()
- ? TEN_CTX_SWITCHES_NS
- : wakeupIntervalNanoSecs);
-
- // All targets' maint cmd should time out
- while(++indexWkPr < stateMac.iv_workFlowProperties.size())
- {
- if((*stateMac.iv_workFlowProperties[indexWkPr]).status
- != COMMAND_TIMED_OUT)
- {
- TS_FAIL("StateMachine:processCommandTimeout(1)."
- "Unexpected status");
- }
- }
-
- stateMac.shutdown();
- TS_TRACE(EXIT_MRK "testSmProcessCommandTimeout");
-
- }
-
- void testSmProcessCommandTimeoutSubset(void)
- {
- using namespace MDIA;
- using namespace TARGETING;
-
- TS_TRACE(ENTER_MRK "testSmProcessCommandTimeoutSubset");
-
- FakeStateMachine2 stateMac;
- WorkFlowAssocMap wkFlEntries;
-
- TargetHandleList targets;
- getTargets(3, targets);
-
- wkFlEntries[targets[0]].push_back(START_SCRUB);
- wkFlEntries[targets[1]].push_back(START_SCRUB);
- wkFlEntries[targets[2]].push_back(START_SCRUB);
- stateMac.setup(wkFlEntries);
-
- uint64_t indexWkPr = stateMac.iv_workFlowProperties.size();
- while(indexWkPr-- != 0)
- {
- stateMac.doMaintCommand(
- *stateMac.iv_workFlowProperties[indexWkPr]);
- }
-
- // Send a 'COMMAND_COMPLETE' event for one of the targets
- MaintCommandEvent event;
- event.type = COMMAND_COMPLETE;
- event.target = targets[0];
- stateMac.processMaintCommandEvent(event);
-
- static const uint64_t wakeupIntervalNanoSecs = 100000000;
- nanosleep(0, TARGETING::is_vpo()
- ? TEN_CTX_SWITCHES_NS
- : wakeupIntervalNanoSecs);
-
- indexWkPr = stateMac.iv_workFlowProperties.size();
- indexWkPr--;
-
- // One of the targets should not have timedout.
- if((*stateMac.iv_workFlowProperties[indexWkPr]).status
- == COMMAND_TIMED_OUT)
- {
- TS_FAIL("StateMachine:processCommandTimeout(2)."
- "Unexpected status");
- }
- else
- {
- //Rest of the targets should have timedout
- while(indexWkPr-- != 0)
- {
- if((*stateMac.iv_workFlowProperties[indexWkPr]).status
- != COMMAND_TIMED_OUT)
- {
- TS_FAIL("StateMachine:processCommandTimeout(3)."
- "Unexpected status");
- }
- }
- }
-
- stateMac.shutdown();
- TS_TRACE(EXIT_MRK "testSmProcessCommandTimeoutSubset");
-
- }
};
#endif
OpenPOWER on IntegriCloud