Beispiel #1
0
    def do(self):
        countArg = '-c' if not sys.platform == "win32" else '-n'
        self.args = ['ping', countArg, '3', self.factoryStation.adapter.name]

        if not isinstance(
                super(checkDebugAdapter, self).do(), opResultSuccess):
            self.printToLog(
                'WARNING: Cannot communicate with the debug Adapter - bouncing DHCP',
                1)
            os.system(self.dhcpStop)
            time.sleep(1)
            os.system(self.dhcpStart)

            if not isinstance(
                    super(checkDebugAdapter, self).do(), opResultSuccess):
                self.printToLog(
                    'ERROR: Cannot communicate with the debug Adapter', 0)
                return opResultDebugAdapterNoPing()

        self.successKeyword = 'sent and received [1024] ECHO messages Ok'
        self.args = [
            'dxp-run', '-ada', self.factoryStation.adapter.name, '-acmd',
            'aux -echoseqtest 1024', '-int'
        ]
        if not isinstance(
                super(checkDebugAdapter, self).do(), opResultSuccess):
            return opResultDebugAdapterNoDXPrun()

        return opResultSuccess()
Beispiel #2
0
 def do(self):
     imei = utilities.imeiNumber().getFromUser()
     if not imei.lower() == 'q':
         self.factoryStation.scannedIMEI = imei
         self.printToLog('New IMEI is %s' % imei, 5)
         return opResultSuccess()
     else:
         return opResultAbort()
Beispiel #3
0
 def do(self):
     serNum = utilities.serialNumber().getFromUser()
     if not serNum.getSN().lower() == 'q':
         self.factoryStation.serNum = serNum
         self.printToLog('Scanned serial number is %s' % serNum.getSN(), 5)
         return opResultSuccess()
     else:
         return opResultAbort()
Beispiel #4
0
 def do(self):
   backupCurdir = os.path.abspath(os.path.curdir)
   os.chdir(self.factoryStation.sdkPath)
   self.printToLog('Current directory changed to SDK path: %s' % self.factoryStation.sdkPath, 3)
   super(bringupTest,self).do()
   os.chdir(backupCurdir)
   self.printToLog('Current directory changed back to: ' + backupCurdir, 3)
   return opResultSuccess()
Beispiel #5
0
    def processResult(self, errorCode, gotExpectedOutput, reply):
        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()
    def processResult(self, errorCode, text=''):
        '''Return a operationResult object'''
        result = opResultSuccess()
        if errorCode == -1:
            result = opResultSubprocessFail()
        if not text.find(self.successKeyword) >= 0:
            result = opResultUnexpected()

        return result
Beispiel #7
0
 def do(self):
     self.ATcmd = 'AT%MODE=1'
     super(backupFilesys, self).do()
     self.ATcmd = 'AT%IBACKUP'
     super(backupFilesys, self).do()
     time.sleep(2)
     self.ATcmd = 'AT%IFLIST=3'
     super(backupFilesys, self).do()
     return opResultSuccess()
 def processResult(self, errorCode, text):
   if isinstance(super(checkModemFwVer,self).processResult(errorCode,text), opResultSuccess):
     if text.find(self.version) >= 0:
       self.printToLog ('Modem firmware version matches expected value', 5)
       return opResultSuccess()
     else:
       self.printToLog ('FAIL: Modem firmware version does not match %s' % self.version, 0)
       return opResultUnexpected()
   else:
     self.printToLog ('FAIL: Unable to get modem firmware version', 0 )
     return opResultUnexpected()
Beispiel #9
0
 def processResult(self, errorCode, text):
     if super(readPCID, self).processResult(errorCode, text):
         str_pcid = text.strip().split('\n')
         if len(str_pcid) < 2:
             self.printToLog('FAIL: Unable to get modem PCID', 0)
             return opResultUnexpected()
         else:
             pcid = str_pcid[2].strip()
             pcid_len = len(pcid)
             mdm_pcid = pcid[8:pcid_len]
             self.printToLog('Modem PCID: %s' % (mdm_pcid), 1)
             return opResultSuccess()
     else:
         self.printToLog('FAIL: Unable to get modem PCID', 0)
         return opResultUnexpected()
Beispiel #10
0
 def processResult(self, errorCode, text):
     if isinstance(
             super(readModemFwVer, self).processResult(errorCode, text),
             opResultSuccess):
         str_fw = text.split('\n')
         if len(str_fw) < 4:
             self.printToLog('FAIL: Unable to get modem firmware version',
                             0)
             return opResultUnexpected()
         else:
             self.printToLog('Modem firmware version: %s' % (str_fw[4]), 1)
             return opResultSuccess()
     else:
         self.printToLog('FAIL: Unable to get modem firmware version', 0)
         return opResultUnexpected()
Beispiel #11
0
 def processResult(self, errorCode, text):
     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()
Beispiel #12
0
    def do(self, serNum=None):

        if not (self.factoryStation.scannedIMEI in self.pdd):
            self.printToLog(
                'WARNING: Scanned IMEI has no entry in the production device data'
            )
            return opResultNoIMEIinProdDeviceData()

        imeiRecord = self.pdd[self.factoryStation.scannedIMEI]
        self.factoryStation.imeiFile = imeiRecord['IMEI Filename']
        self.printToLog(
            'IMEI record to be used is %s' % self.factoryStation.imeiFile, 3)
        self.factoryStation.devCfgFile = imeiRecord['DeviceConfig Filename']
        self.printToLog(
            'Device Config file to be used is %s' %
            self.factoryStation.devCfgFile, 3)
        return opResultSuccess()
Beispiel #13
0
 def do(self, serNum=None):
   resp = screen().prompt(self.readyPrompt)
   return opResultAbort() if resp.lower() == 'q' else opResultSuccess()