Ejemplo n.º 1
0
        if isinstance(
                super(readModemFwId, self).processResult(errorCode, text),
                opResultSuccess):
            str_fwid = text.split('\n')
            if len(str_fwid) < 2:
                self.printToLog('FAIL: Unable to get modem firmware id', 0)
                return opResultUnexpected()
            else:
                mdm_fwid = str_fwid[1]
                fwid_len = len(mdm_fwid)
                mdm_fwid = mdm_fwid[11:fwid_len]
                self.printToLog('Modem firmware ID: %s' % (mdm_fwid), 1)
                return opResultSuccess()
        else:
            self.printToLog('FAIL: Unable to get modem firmware id', 0)
            return opResultUnexpected()


# -------------------------------------------------
# Testing
# -------------------------------------------------
if __name__ == "__main__":

    testMode = True
    fs = factoryStation.factoryStation(
        None, testMode)  # default factoryStation object
    options = {'ATtool': 'atcmd-itf'}
    fo = readModemFwId(fs, options)
    fo.do()
    fo.postResult(fo.do())
Ejemplo n.º 2
0
    parser.add_argument('--prodDefs',
                        default='product_definitions',
                        help='Product Definitions file')
    parser.add_argument('--cableLoss',
                        default='ical_cable_loss.xml',
                        help='Cable Loss (Main)')
    parser.add_argument('--cableLossDiv',
                        default='ical_cable_loss.xml',
                        help='Cable Loss (Div)')
    args = parser.parse_args()

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

    # Factory Station and attributes
    fs = factoryStation.factoryStation(
        debugLog, args.test)  # default factoryStation object
    fs.productName = 'i500_1720_att'
    fs.powerMeterVisaAddress = '1234'

    # Set options
    if args.xml == None:  # set default values if no XML
        options = {
            'sysConfig': args.sysConfig,
            'prodDefs': args.prodDefs,
            'cableLoss': args.cableLoss,
            'cableLossDiv': args.cableLossDiv,
        }
    else:
        debugLog.lineOut('Getting options from XML')
        options = factoryConfig.operationsParser().itemsFromXML(
            args.xml, 'operation')['interfaceTest']['subItem']
Ejemplo n.º 3
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'
        })
    fo.postResult(fo.do())
Ejemplo n.º 4
0
import factoryStation, factoryOperation

class testOp1(factoryOperation.factoryOperation):
  '''Simple operation where all arguments to the subprocess are hard-wired''' 

  def initialize(self):
    self.args = ['ls', '-al']
    return True

if __name__ == "__main__":

  ''' Basic test -------------------------------------------------------
       Provide no log file (prints to screen only)
       Passes a default factoryStation object
       The subprocess and its arguments are hard-wired 
       Operation has no name 
       No serial number used
       No logs are collected
  '''

if __name__ == '__main__':
  fs = factoryStation.factoryStation()               # default factoryStation object
  fo = testOp1(fs)
  fo.postResult(fo.do())