From b3ef6ec422344837fdf1f095b816736cefafa242 Mon Sep 17 00:00:00 2001 From: shakeeb Date: Wed, 18 May 2016 17:09:07 +0530 Subject: PSU test framework update Restructuring of SBE-HOST MBOX interface test framework Change-Id: Icc24fde4c0ac09ecbe2288f3ac4327b14defe156 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24702 Tested-by: Jenkins Server Reviewed-by: Sachin Gupta --- sbe/test/testClass.py | 343 ------------------------------------------ sbe/test/testClassUtil.py | 35 ----- sbe/test/testExecutorPSU.py | 14 +- sbe/test/testPSUUserUtil.py | 35 +++++ sbe/test/testPSUUtil.py | 353 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 395 insertions(+), 385 deletions(-) delete mode 100644 sbe/test/testClass.py delete mode 100644 sbe/test/testClassUtil.py create mode 100644 sbe/test/testPSUUserUtil.py create mode 100644 sbe/test/testPSUUtil.py (limited to 'sbe') diff --git a/sbe/test/testClass.py b/sbe/test/testClass.py deleted file mode 100644 index bdae1df5..00000000 --- a/sbe/test/testClass.py +++ /dev/null @@ -1,343 +0,0 @@ -#!/usr/bin/python -''' -############################################################# -# @file testClass.py -# @author: George Keishing -# @brief Framework class Host SBE interface on simics -# -# Created on March 29, 2016 -# ---------------------------------------------------- -# @version Developer Date Description -# ---------------------------------------------------- -# 1.0 gkeishin 29/03/16 Initial create -############################################################# -''' - -#------------------------- -# Imports packages -#------------------------- -import time -import conf -import testClassUtil as util -from sim_commands import * - -#------------------------- -# Macros constants -#------------------------- -SUCCESS = 1 -FAILURE = 0 - -#------------------------- -# SIM OBJs -#------------------------- -''' -This is a simulator obj mapped. Refer simics folks if new objects are needed. -''' -simSbeObj = conf.p9Proc0.sbe.mibo_space -simHostObj = conf.p9Proc0.p9_mem_map.host_xscom_device_mm -simMemObj = conf.system_cmp0.phys_mem - -''' -This is a base MBOX registry address from 0..7 -''' -# Register MBOX 0..3 SBE side address in order -REGDATA_SBE = [ - 0x00680500, - 0x00680510, - 0x00680520, - 0x00680530 - ] - -# Register MBOX 4..7 host side address in order -REGDATA_HOST = [ - 0x00680540, - 0x00680550, - 0x00680560, - 0x00680570 - ] - -# Supporting Class objects -''' -Base function members definitions for set,get,read, write and others needed. -Keep it simple and modular so that it can be extended as a base class. -''' -#------------------ -# Registry class -#------------------ -class registry(object): - #------------------------------ - # Set the reg data - #------------------------------ - def setRegData(self, addr, value, size): - self.regAddr = addr - self.regVal = value - self.regSize = size - - #------------------------------ - # Read Reg value set or updated - #------------------------------ - def getRegData(self): - print " Addr : ",hex(self.regAddr) - print " Value : ",self.regVal - print " Size : ",self.regSize - - #------------------------------ - # Write to a Registry - #------------------------------ - def writeToReg(self, objType): - address = self.regAddr - value = self.stringToByte(self.regVal) - size = self.regSize - print " WData : 0x%s -> Byte Data %s"% (self.regVal,value) - print " Addr :", hex(address) - print " Size : %s Bytes"% size - - self.__write(objType,address,value,size) - return - - #------------------------------ - # Write to Registry 0..3 using - # test data directly. - #------------------------------ - def writeTestData(self, data): - simObj = SIM_get_interface(simSbeObj, "memory_space") - entryCount = len(data) - size = 8 - for i in range (entryCount): - value = stringToByte(data[i]) - print "\n Writting ", hex(REGDATA_SBE[i]) - print " %x %x %x %x %x %x %x %x" % (value[0],value[1],value[2],value[3],value[4],value[5],value[6],value[7]) - simObj.write(None, REGDATA_SBE[regIndex], - (value[0],value[1],value[2],value[3],value[4],value[5],value[6],value[7]), - size) - return - - #------------------------------ - # Write using SIM object - # 4/8 Bytes data - #------------------------------ - def __write(self, Targetobj, address, value, size): - simObj = SIM_get_interface(Targetobj, "memory_space") - if int(size) == 4: - simObj.write(None, address, - (value[0],value[1],value[2],value[3]), - size) - elif int(size) == 8: - simObj.write(None, address, - (value[0],value[1],value[2],value[3],value[4],value[5],value[6],value[7]), - size) - print " SIM obj: Write %s bytes [ OK ] " % size - return - - #--------------------------- - # Read from a Registry - #--------------------------- - def readFromReg(self, objType): - address = self.regAddr - size = self.regSize - value = self.regVal - if int(value) !=0: - print " RData :", value - print " Addr :", hex(address) - print " Size : %s Bytes"% size - - value = self.__read(objType,address,size) - return value - - #--------------------------- - # Read from a memomry - # Max Sim interface can read 8 - # byte data at a given time - #--------------------------- - def readFromMemory(self, objType, magicNum): - # Start addr + 8 bytes - address = self.regAddr - size = self.regSize # Max it can read is 8 Bytes - value = self.regVal # Max lentgth it should read - - MaxAddr = address + value # This is the addres range it could read - print " MaxAddr Range:",hex(MaxAddr) - OffsetAddr = address - print " OffsetAddr:",hex(OffsetAddr) - - print " Memory Entries to be read : %d" % (value/8) - print " Match Magic Number : ", magicNum - - while ( OffsetAddr <= MaxAddr): - sim_data = self.__read(objType,OffsetAddr,size) - print " ", hex(OffsetAddr),self.joinListDataToHex(sim_data).upper() - OffsetAddr += 8 - - if self.validateTestMemOp(sim_data,magicNum) == True: - print " Test validated .. [ OK ]" - return SUCCESS - - return FAILURE # Failed validation - - #------------------------------ - # Read using SIM Object - #------------------------------ - def __read(self, Targetobj, address, size): - simObj = SIM_get_interface(Targetobj, "memory_space") - value = simObj.read(None, address, size, 0x0) - #print " SIM obj: Read %s bytes [ OK ] " % size - return value - - #-------------------------------- - # Prepare the byte data from the - # string and return the list set - #------------------------------- - def stringToByte(self,value): - ''' - The sim interface doesnt take the values as it is .. - it takes as byte arrays - Ex: "0000030100F0D101" - '\x00\x00\x03\x01\x00\xf0\xd1\x01' - [0, 0, 3, 1, 0, 240, 209, 1] - ''' - # Convert it to a hex string - hex_val= value.decode("hex") - # Prepare the conversion to a list of byte values - value=map(ord, hex_val) - return value - - #--------------------------------------- - # Joing the list set data to hex data - # Reverse of the stringToByte logic - #--------------------------------------- - def joinListDataToHex(self, data): - # simics> (0, 0, 3, 1, 0, 240, 209, 1) - # Join this data into hex string 0xf0d101 - bit_shift=56 - hex_val = 0x0 - for val in data: - hex_val |= int(val) << bit_shift - bit_shift -=8 - return hex(hex_val) - - #---------------------------------------------------- - # Execute the read or write operation in loop as per - # Test data set pre-defined - #---------------------------------------------------- - def ExecuteTestOp(self, testOp, test_bucket): - ''' - 3 prong steps : set data, read/write data, validate - ''' - #-------------------------------------------- - for l_params in test_bucket: - #-------------------------------------------- - print " Desc : %s " % l_params[5] - print " Op : %s " % l_params[0] - if "func" == l_params[0]: - print " Func : %s " % l_params[1] - if l_params[4] != "None": - print " Expect : %s " % l_params[4] - if "func" == l_params[0]: - print " Function Params :",l_params[2] - else: - # addr, value, size - self.setRegData(l_params[1],l_params[2],l_params[3]) - - # --------------------------------------------- - # Check the Op and perform the action - # read/write - # --------------------------------------------- - if "read" == l_params[0]: - sim_data = self.readFromReg(testOp) - print " ++++++++++++++++++++++++++++++++++++++++++" - print " simics Data : ", sim_data - print " simics Hex : ", self.joinListDataToHex(sim_data).upper() - - # Validate the test data - ''' - This field in the test entry holds the data - that needs validation against sim data. - ''' - if l_params[4] != "None": - if self.validateTestOp(sim_data,l_params[4]) == True: - print " Test validated .. [ OK ]" - else: - return FAILURE # Failed validation - else: - print " ++++++++++++++++++++++++++++++++++++++++++" - elif "write" == l_params[0]: - self.writeToReg(testOp) - elif "memRead" == l_params[0]: - # (Sim obj) (Validate) - return self.readFromMemory(testOp, l_params[4]) - elif "func" == l_params[0]: - # Func name Params - rc = self.loadFunc( l_params[1], l_params[2] ) - return rc - else: - return FAILURE # Unknown entry op - - print "\n" - return SUCCESS - - #---------------------------------------------------- - # Validate simulator data against test data - #---------------------------------------------------- - def validateTestOp(self, sim_data, test_data): - print " Test Expects : 0x%s " % test_data - print " Expect bytes : ", self.stringToByte(test_data) - if self.compareList(self.stringToByte(test_data), sim_data, "None") == True: - print " Test ... [ OK ] " - print " ++++++++++++++++++++++++++++++++++++++++++" - return SUCCESS - else: - print " Test Failed... !!!" - print " ++++++++++++++++++++++++++++++++++++++++++" - return FAILURE - - #---------------------------------------------------- - # Validate simulator data against test data - #---------------------------------------------------- - def validateTestMemOp(self, sim_data, test_data): - if self.compareList(self.stringToByte(test_data), sim_data,"memRead") == True: - return SUCCESS - return # Return nothing to check next memory entry - - - #---------------------------------------------------- - # Compare the result vs expected list data - # byte by byte - #---------------------------------------------------- - def compareList(self, expList, resList, opType): - for i in range(0,8): - if int(expList[i]) == int(resList[i]): - #print " %s : %s " % (expList[i],resList[i]) - continue - else: - if opType != "memRead": - print " Error \t %s : %s [ Mismatch ]" % (expList[i],resList[i]) - return False # mismatch - return # Return nothing for Next Mem byte read - return True - - #---------------------------------------------------- - # A basic loop wait poll mechanism - #---------------------------------------------------- - def pollingOn(self, simObj, test_data, timeOut): - print "\n***** Polling On result for %d seconds " % timeOut - while True: - print "\n" - rc = self.ExecuteTestOp(simObj,test_data) - if rc == SUCCESS: - return rc - elif timeOut <= 0: - print " Timmer Expired... Exiting polling" - break - else: - time.sleep(5) - timeOut = timeOut - 5 - return FAILURE - - #---------------------------------------------------- - # Load the function and execute - #---------------------------------------------------- - def loadFunc(self, func_name, i_pArray ): - rc = util.__getattribute__(func_name)(i_pArray) - return rc # Either success or failure from func - - diff --git a/sbe/test/testClassUtil.py b/sbe/test/testClassUtil.py deleted file mode 100644 index 48e79b80..00000000 --- a/sbe/test/testClassUtil.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/python -''' -############################################################# -# @file testClassUtil.py -# @author: George Keishing -# @brief Framework utility fucntions for Host SBE -# interface on simics -# -# Created on March 29, 2016 -# ---------------------------------------------------- -# @version Developer Date Description -# ---------------------------------------------------- -# 1.0 gkeishin 29/03/16 Initial create -############################################################# -''' - -import testClass as testClass - -''' -Add your personalize functions here for execution but ensure it returns -either SUCCESS or FAILURE as an end result for generalization purpose. -''' - -########################################################################## -# Function : classUtilFuncSample -# -# @param i_paramArray : user supplied input array parameters -# -# @brief Function to do a task and returns SUCCCES or FAILURE -# -########################################################################## -def classUtilFuncSample(i_paramArray): - for input in i_paramArray: - print " classUtilFuncSample : parm: ",input - return testClass.SUCCESS diff --git a/sbe/test/testExecutorPSU.py b/sbe/test/testExecutorPSU.py index 20314792..52846ecb 100644 --- a/sbe/test/testExecutorPSU.py +++ b/sbe/test/testExecutorPSU.py @@ -13,7 +13,7 @@ ############################################################# ''' -import testClass as testObj +import testPSUUtil import testRegistry as reg #------------------------------- @@ -93,19 +93,19 @@ def main(): # Intialize the class obj instances print "\n Initializing Registry instances ...." - regObj = testObj.registry() # Registry obj def for operation + regObj = testPSUUtil.registry() # Registry obj def for operation print "\n Execute SBE Test set [ PSU ] ...\n" - # Sim obj Target Test set - rc_test = regObj.ExecuteTestOp(testObj.simSbeObj,sbe_test_data) - if rc_test != testObj.SUCCESS: + # Sim obj Target Test set Raise Exception + rc_test = regObj.ExecuteTestOp(testPSUUtil.simSbeObj,sbe_test_data, True) + if rc_test != testPSUUtil.SUCCESS: print " SBE Test data set .. [ Failed ] .." else: print " SBE Test data set .. [ OK ] " print "\n Poll on Host side for INTR ...\n" # Sim obj Target Test set Max timedout - rc_intr = regObj.pollingOn(testObj.simSbeObj,host_test_data,20) - if rc_intr == testObj.SUCCESS: + rc_intr = regObj.pollingOn(testPSUUtil.simSbeObj,host_test_data,20) + if rc_intr == testPSUUtil.SUCCESS: print " Interrupt Event Recieved .. Success !!" else: print " Interrupt not Recieved.. Exiting .." diff --git a/sbe/test/testPSUUserUtil.py b/sbe/test/testPSUUserUtil.py new file mode 100644 index 00000000..d2126e56 --- /dev/null +++ b/sbe/test/testPSUUserUtil.py @@ -0,0 +1,35 @@ +#!/usr/bin/python +''' +############################################################# +# @file testClassUtil.py +# @author: George Keishing +# @brief Framework utility fucntions for Host SBE +# interface on simics +# +# Created on March 29, 2016 +# ---------------------------------------------------- +# @version Developer Date Description +# ---------------------------------------------------- +# 1.0 gkeishin 29/03/16 Initial create +############################################################# +''' + +import testPSUUtil + +''' +Add your personalize functions here for execution but ensure it returns +either SUCCESS or FAILURE as an end result for generalization purpose. +''' + +########################################################################## +# Function : classUtilFuncSample +# +# @param i_paramArray : user supplied input array parameters +# +# @brief Function to do a task and returns SUCCCES or FAILURE +# +########################################################################## +def classUtilFuncSample(i_paramArray): + for input in i_paramArray: + print " classUtilFuncSample : parm: ",input + return testPSUUtil.SUCCESS diff --git a/sbe/test/testPSUUtil.py b/sbe/test/testPSUUtil.py new file mode 100644 index 00000000..a452b5e8 --- /dev/null +++ b/sbe/test/testPSUUtil.py @@ -0,0 +1,353 @@ +#!/usr/bin/python +''' +############################################################# +# @file testClass.py +# @author: George Keishing +# @brief Framework class Host SBE interface on simics +# +# Created on March 29, 2016 +# ---------------------------------------------------- +# @version Developer Date Description +# ---------------------------------------------------- +# 1.0 gkeishin 29/03/16 Initial create +############################################################# +''' + +#------------------------- +# Imports packages +#------------------------- +import time +import conf +import testUtil +import testPSUUserUtil +from sim_commands import * + +#------------------------- +# Macros constants +#------------------------- +SUCCESS = 1 +FAILURE = 0 + +#------------------------- +# SIM OBJs +#------------------------- +''' +This is a simulator obj mapped. Refer simics folks if new objects are needed. +''' +simSbeObj = conf.p9Proc0.sbe.mibo_space +simHostObj = conf.p9Proc0.p9_mem_map.host_xscom_device_mm +simMemObj = conf.system_cmp0.phys_mem + +''' +This is a base MBOX registry address from 0..7 +''' +# Register MBOX 0..3 SBE side address in order +REGDATA_SBE = [ + 0x00680500, + 0x00680510, + 0x00680520, + 0x00680530 + ] + +# Register MBOX 4..7 host side address in order +REGDATA_HOST = [ + 0x00680540, + 0x00680550, + 0x00680560, + 0x00680570 + ] + +# Supporting Class objects +''' +Base function members definitions for set,get,read, write and others needed. +Keep it simple and modular so that it can be extended as a base class. +''' +#------------------ +# Registry class +#------------------ +class registry(object): + #------------------------------ + # Set the reg data + #------------------------------ + def setRegData(self, addr, value, size): + self.regAddr = addr + self.regVal = value + self.regSize = size + + #------------------------------ + # Read Reg value set or updated + #------------------------------ + def getRegData(self): + print " Addr : ",hex(self.regAddr) + print " Value : ",self.regVal + print " Size : ",self.regSize + + #------------------------------ + # Write to a Registry + #------------------------------ + def writeToReg(self, objType): + address = self.regAddr + value = self.stringToByte(self.regVal) + size = self.regSize + print " WData : 0x%s -> Byte Data %s"% (self.regVal,value) + print " Addr :", hex(address) + print " Size : %s Bytes"% size + + self.__write(objType,address,value,size) + return + + #------------------------------ + # Write to Registry 0..3 using + # test data directly. + #------------------------------ + def writeTestData(self, data): + simObj = SIM_get_interface(simSbeObj, "memory_space") + entryCount = len(data) + size = 8 + for i in range (entryCount): + value = stringToByte(data[i]) + print "\n Writting ", hex(REGDATA_SBE[i]) + print " %x %x %x %x %x %x %x %x" % (value[0],value[1],value[2],value[3],value[4],value[5],value[6],value[7]) + simObj.write(None, REGDATA_SBE[regIndex], + (value[0],value[1],value[2],value[3],value[4],value[5],value[6],value[7]), + size) + return + + #------------------------------ + # Write using SIM object + # 4/8 Bytes data + #------------------------------ + def __write(self, Targetobj, address, value, size): + simObj = SIM_get_interface(Targetobj, "memory_space") + if int(size) == 4: + simObj.write(None, address, + (value[0],value[1],value[2],value[3]), + size) + elif int(size) == 8: + simObj.write(None, address, + (value[0],value[1],value[2],value[3],value[4],value[5],value[6],value[7]), + size) + print " SIM obj: Write %s bytes [ OK ] " % size + return + + #--------------------------- + # Read from a Registry + #--------------------------- + def readFromReg(self, objType): + address = self.regAddr + size = self.regSize + value = self.regVal + if int(value) !=0: + print " RData :", value + print " Addr :", hex(address) + print " Size : %s Bytes"% size + + value = self.__read(objType,address,size) + return value + + #--------------------------- + # Read from a memomry + # Max Sim interface can read 8 + # byte data at a given time + #--------------------------- + def readFromMemory(self, objType, magicNum): + # Start addr + 8 bytes + address = self.regAddr + size = self.regSize # Max it can read is 8 Bytes + value = self.regVal # Max lentgth it should read + + MaxAddr = address + value # This is the addres range it could read + print " MaxAddr Range:",hex(MaxAddr) + OffsetAddr = address + print " OffsetAddr:",hex(OffsetAddr) + + print " Memory Entries to be read : %d" % (value/8) + print " Match Magic Number : ", magicNum + + while ( OffsetAddr <= MaxAddr): + sim_data = self.__read(objType,OffsetAddr,size) + print " ", hex(OffsetAddr),self.joinListDataToHex(sim_data).upper() + OffsetAddr += 8 + + if self.validateTestMemOp(sim_data,magicNum) == True: + print " Test validated .. [ OK ]" + return SUCCESS + + return FAILURE # Failed validation + + #------------------------------ + # Read using SIM Object + #------------------------------ + def __read(self, Targetobj, address, size): + simObj = SIM_get_interface(Targetobj, "memory_space") + value = simObj.read(None, address, size, 0x0) + #print " SIM obj: Read %s bytes [ OK ] " % size + return value + + #-------------------------------- + # Prepare the byte data from the + # string and return the list set + #------------------------------- + def stringToByte(self,value): + ''' + The sim interface doesnt take the values as it is .. + it takes as byte arrays + Ex: "0000030100F0D101" + '\x00\x00\x03\x01\x00\xf0\xd1\x01' + [0, 0, 3, 1, 0, 240, 209, 1] + ''' + # Convert it to a hex string + hex_val= value.decode("hex") + # Prepare the conversion to a list of byte values + value=map(ord, hex_val) + return value + + #--------------------------------------- + # Joing the list set data to hex data + # Reverse of the stringToByte logic + #--------------------------------------- + def joinListDataToHex(self, data): + # simics> (0, 0, 3, 1, 0, 240, 209, 1) + # Join this data into hex string 0xf0d101 + bit_shift=56 + hex_val = 0x0 + for val in data: + hex_val |= int(val) << bit_shift + bit_shift -=8 + return hex(hex_val) + + #---------------------------------------------------- + # Execute the read or write operation in loop as per + # Test data set pre-defined + #---------------------------------------------------- + def ExecuteTestOp(self, testOp, test_bucket, raiseException): + ''' + 3 prong steps : set data, read/write data, validate + ''' + #-------------------------------------------- + for l_params in test_bucket: + #-------------------------------------------- + print " Desc : %s " % l_params[5] + print " Op : %s " % l_params[0] + if "func" == l_params[0]: + print " Func : %s " % l_params[1] + if l_params[4] != "None": + print " Expect : %s " % l_params[4] + if "func" == l_params[0]: + print " Function Params :",l_params[2] + else: + # addr, value, size + self.setRegData(l_params[1],l_params[2],l_params[3]) + + # --------------------------------------------- + # Check the Op and perform the action + # read/write + # --------------------------------------------- + if "read" == l_params[0]: + sim_data = self.readFromReg(testOp) + print " ++++++++++++++++++++++++++++++++++++++++++" + print " simics Data : ", sim_data + print " simics Hex : ", self.joinListDataToHex(sim_data).upper() + + # Validate the test data + ''' + This field in the test entry holds the data + that needs validation against sim data. + ''' + if l_params[4] != "None": + if self.validateTestOp(sim_data,l_params[4]) == True: + print " Test validated .. [ OK ]" + else: + if(raiseException == True): + raise Exception('Data mistmach'); + return FAILURE # Failed validation + else: + print " ++++++++++++++++++++++++++++++++++++++++++" + elif "write" == l_params[0]: + self.writeToReg(testOp) + elif "memRead" == l_params[0]: + # (Sim obj) (Validate) + return self.readFromMemory(testOp, l_params[4]) + elif "func" == l_params[0]: + # Func name Params + rc = self.loadFunc( l_params[1], l_params[2] ) + return rc + else: + print "\n Invalid Test Data" + if(raiseException == True): + raise Exception('Invalid Test Data'); + return FAILURE # Unknown entry op + + print "\n" + return SUCCESS + + #---------------------------------------------------- + # Validate simulator data against test data + #---------------------------------------------------- + def validateTestOp(self, sim_data, test_data): + print " Test Expects : 0x%s " % test_data + print " Expect bytes : ", self.stringToByte(test_data) + if self.compareList(self.stringToByte(test_data), sim_data, "None") == True: + print " Test ... [ OK ] " + print " ++++++++++++++++++++++++++++++++++++++++++" + return SUCCESS + else: + print " Test Failed... !!!" + print " ++++++++++++++++++++++++++++++++++++++++++" + return FAILURE + + #---------------------------------------------------- + # Validate simulator data against test data + #---------------------------------------------------- + def validateTestMemOp(self, sim_data, test_data): + if self.compareList(self.stringToByte(test_data), sim_data,"memRead") == True: + return SUCCESS + return # Return nothing to check next memory entry + + + #---------------------------------------------------- + # Compare the result vs expected list data + # byte by byte + #---------------------------------------------------- + def compareList(self, expList, resList, opType): + for i in range(0,8): + if int(expList[i]) == int(resList[i]): + #print " %s : %s " % (expList[i],resList[i]) + continue + else: + if opType != "memRead": + print " Error \t %s : %s [ Mismatch ]" % (expList[i],resList[i]) + return False # mismatch + return # Return nothing for Next Mem byte read + return True + + #---------------------------------------------------- + # A basic loop poll mechanism + #---------------------------------------------------- + def pollingOn(self, simObj, test_data, retries=20): + for l_param in test_data: + print "\n***** Polling On result - retrials left [%d] " % retries + while True: + print "\n" + testUtil.runCycles( 10000000); + test_d = (l_param,) + rc = self.ExecuteTestOp(simObj, test_d, False) + if rc == SUCCESS: + print ('Polling Successful for - ' + l_param[5]) + break + elif retries <= 0: + print " Retrials exhausted... Exiting polling" + raise Exception('Polling Failed for - ' + l_param[5]); + break + else: + retries = retries - 1 + return FAILURE + + #---------------------------------------------------- + # Load the function and execute + #---------------------------------------------------- + def loadFunc(self, func_name, i_pArray ): + rc = testPSUUserUtil.__getattribute__(func_name)(i_pArray) + return rc # Either success or failure from func + + -- cgit v1.2.1