Esempio n. 1
0
        if not errorCode == 0:
            if errorCode > 0:
                self.printToLog('FAIL:' + hex(errorCode), 0)
            else:
                self.printToLog('FAIL:' + hex(errorCode & 0xffffffff), 0)
            return opResultUnexpected()

        return opResultSuccess()


# -------------------------------------------------
# Testing
# -------------------------------------------------
if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='fwProgramming')
    utilities.cmdLineArgs(parser)  # general args from parent class
    args = parser.parse_args()

    # Factory Station and attributes
    fs = factoryStation.factoryStation(
        None, args.test)  # default factoryStation object
    fs.adapter = utilities.debugAdapter()
    fs.sdkPath = os.path.join(os.environ['ICERA_ROOT'], 'dxp-bare', 'examples',
                              'bringup_ice9040')

    # FW programming
    fo = fwProgramming(
        fs, {
            'args': '-9040 -hwplat p2341',
            'sourcePackage': '',
            'gangImage': 'gang_image'
Esempio n. 2
0
class testStation(factoryStation.factoryStation):
  
  def __init__(self, logger=None, testMode=None):
    self.name = 'testStation'
    self.desc = testStation.__doc__
    self.attrib1 = 'attrib1'
    self.attrib2 = 'attrib2'
    super(testStation,self).__init__(logger, testMode)
        
# -------------------------------------------------  
# Testing  
# -------------------------------------------------
if __name__ == "__main__":
  parser = argparse.ArgumentParser(description='simple test station')
  utilities.cmdLineArgs(parser)                  # general args 
  args = parser.parse_args()    

# Debug logger  
  debugLog = utilities.logger (args.trace, '', args.verbosity)

  fs = testStation( None, args.test)       

  fs.operations.append ( blockingPrompt( fs, { 'prompt' : 'Hit a key when ready.' }))
  fs.operations.append ( testOp1( fs ))
  fs.operations.append ( testOp2( fs, { 'command' : 'ls', 'option1' : '-al'} ))

  fs.attrib1 = 'attrib1'
  fs.attrib2 = 'attrib2'
  fs.operations.append ( testOp3( fs, { 'command' : 'command', 
                                        'arg1' : 'arg1',