def test_method(self):
        # now begin the actual testing
        tb = self.config.testbed
        self.MASTER_TAG_LIST = [
                #'DEMOD_MFG.xml',
                #'DEMUX_MFG.xml',
                #'DRIVER_AMP_ADJ_MFG.xml',
                #'DRIVER_AMP_MFG.xml',
                #'EDFA_MFG.xml',
                #'LASER_MFG.xml',
                'LINE_INTF_MFG.xml',
                #'MOD_MFG.xml',
                #'MUX_MFG.xml',
                #'PHRX_MFG.xml',
                #'TDC_CIR_MFG.xml',
                #'TDC_MFG.xml',
                #  Calibration tags
                #'DMUX_CAL.xml',
                #'DRIVER_AMP_ADJ_CAL.xml',
                #'DRIVER_AMP_CAL.xml',
                #'EDFA_CAL.xml',
                #'MOD_TAP_CAL.xml',
                #'MUX_CAL.xml',
                #'PHRX_CAL.xml',
                #'TDC_CAL.xml',
		]
        # prompt for password.
        self.info("This is a restricted program.  Please enter test engr password: "******"Password entered does not match database, you have one more try.")
            pw = getpass.getpass()
            if not database.verify_password(tbl_username, pw, cf.DBURI):
                return self.abort("Password entered mismatch on 2nd try, exiting...")
            else:
                self.info("Engineering password verified!")
        
        else:
            self.info("Engineering password verified!")
        
        signal.signal(signal.SIGCHLD, signal.SIG_IGN)
        sn = cf.ser_no
        ber_obj = self.UUT
        self.info("### Running UUT (%s)" % (sn))
        sn_id = cf.uut_id
        # now get all MFG tags associated with the top SN.  
        res_path = database.get_result_path(self.config, sn_id, 'Titan_saveTags')
        if res_path is None:
            self.errorCount = 1
            self.abort("Can't find xml directory!")
        dir_str = commands.getoutput('ls %s/*.xml' % res_path)
        file_list = dir_str.split('\n')
        self.info("Setting module to flash mode...")
        ber_obj.flashModeSelect()
        self.info("TAGS PATH: %s" %  res_path)
        # 1: restore PhCal tag by looking for PHRX_CAL tag 
        for fname in file_list:
            tag_file = os.path.basename(fname)
            if tag_file: # in self.MASTER_TAG_LIST:  #XXX: use this for dbg
                tag_name = tag_file[:-4]
                if tag_file == 'PHRX_CAL.xml':
                    phrx_cal_path = database.get_result_path(self.config, sn_id, 'PhCalVadj')
                    if phrx_cal_path:
                        self.info("PhCalVadj has run....")
                        phrx_cal_file = commands.getoutput('ls %s/*.xml' % phrx_cal_path)
                        f_obj = file(phrx_cal_file)
                    else:
                        self.info("PhCalVadj has not run yet, using result from saveTag test...")
                        f_obj = file(fname)
                    xml_str = f_obj.read()
                    pom_obj = ber_obj.stringToPomObj(xml_str, tag_name)

                    ber_obj.download(pom_obj)
                    self.save_file(fname)
                else:
                    try:
                        f_obj = file(fname)
                        self.info("Restoring tag from '%s'..." % tag_file)
                        xml_str = f_obj.read()
                        pom_obj = ber_obj.stringToPomObj(xml_str, tag_name)
                        ber_obj.download(pom_obj)
                        self.save_file(fname)
                        time.sleep(20)
                    except:
                        self.errorCount = 1
                        return self.failed("Can't find XML information!")
        # add some sleeps prior to the final reset
        time.sleep(30)

        # DO THIS FROM CAROL
        ber_obj.reset_card_from_mfgtest()
                    
        reset_dsp_sleep_time = 100
        self.info("Wait %s seconds for DSP to come up..." % reset_dsp_sleep_time)
        time.sleep(reset_dsp_sleep_time)

        self.diagnostic(self.errorCount)
        if self.errorCount:
            self.lf.write("\n\nERROR: %s(%s):\n UUT RestoreMfgTags_MfgSw test failed.\n" 
                            %(slot, sn))
            self.failed("UUT RestoreMfgTags_MfgSw test failed.\n")
        else:
            self.passed("UUT RestoreMfgTags_MfgSw test passed.\n")
          
        return self.completed("RestoreMfgTags_MfgSw test completed.")
Beispiel #2
0
    def test_method(self):
        self.errorCount = {} 
        # now begin the actual testing
        tb = self.config.testbed
        self.MASTER_TAG_LIST = [
                #'LINE_INTF_MFG.xml',
                'DEMOD_MFG.xml',
                #'DEMUX_MFG',
                #'DRIVER_AMP_MFG',
                #'EDFA_MFG',
                #'LASER_MFG',
                #'MOD_MFG',
                #'MUX_MFG',
                #'PHRX_MFG',
                #'TDC_MFG',
                #'TDC_CIR_MFG',
                #'DRIVER_AMP_CAL',	
                #'DMUX_CAL',
                #'MUX_CAL',
		]
        # prompt for password.
        self.info("This is a restricted program.  Please enter test engr password: "******"Password entered does not match database, you have one more try.")
            pw = getpass.getpass()
            if not database.verify_password(tbl_username, pw, cf.DBURI):
                return self.abort("Password entered mismatch on 2nd try, exiting...")
            else:
                self.info("Engineering password verified!")
        
        else:
            self.info("Engineering password verified!")
        
        signal.signal(signal.SIGCHLD, signal.SIG_IGN)

        for sn in self.uutSnList:        #excluding refsn
            self.errorCount[sn] = 0
            slot = self.uutDict[sn]["slot"]
            UUT_ber = "UUT_slot%s" % slot
            ber_obj = self.uut_ser_dict[UUT_ber]
            sn_id = self.uutDict[sn]["id"]

            ser_obj = self.uut_ser_dict[slot]
            obj = ser_obj
            self.info("### Running UUT (%s) on slot (%s)" % (sn, slot))
            # now get all MFG tags associated with the top SN.  
            res_path = database.get_result_path(self.config, sn_id, 'Titan_saveTags')
            if res_path is None:
                self.errorCount[sn] = 1
                self.abort("Can't find xml directory!")
            dir_str = commands.getoutput('ls %s/*.xml' % res_path)
            file_list = dir_str.split('\n')
            self.info("Setting module to flash mode...")
            ber_obj.prepFlash()
            self.info("TAGS PATH: %s" %  res_path)
            # 1: restore PhCal tag by looking for PHRX_CAL tag 
            self.info("Disabling Driver and Balance Loops...")
            obj.disable_drv_bal_loops()
            for fname in file_list:
                tag_file = os.path.basename(fname)
                if tag_file in self.MASTER_TAG_LIST:
                    try:
                        f_obj = file(fname)
                        self.info("Restoring tag from '%s'..." % tag_file)
                        ber_obj.download_xml_cust(f_obj)
                        self.save_file(fname)
                    except:
                        self.errorCount[sn] = 1
                        return self.failed("Can't find XML information!")


        # DO THIS FROM CAROL
        #ber_obj.reset_card()
                    
        #reset_dsp_sleep_time = 100
        #self.info("Wait %s seconds for DSP to come up..." % reset_dsp_sleep_time)
        #time.sleep(reset_dsp_sleep_time)

        for sn in self.uutSnList:
            slot = self.uutDict[sn]["slot"]
            uutid = self.uutDict[sn]["id"]
            self.diagnostic(self.errorCount[sn])
            if self.errorCount[sn]:
                self.lf.write("\n\nERROR: %s(%s):\n UUT RestoreMfgTags test failed.\n" 
                            %(slot, sn))
                self.failed("%s(%s):\n UUT RestoreMfgTags test failed.\n" %(slot, sn), uutid)
            else:
                self.passed("%s(%s):\n UUT RestoreMfgTags test passed.\n" %(slot, sn), uutid)
          
        return self.completed("RestoreMfgTags test completed.")
Beispiel #3
0
    def test_method(self):
        errorCount = 0
        # now begin the actual testing
        tag_list = self.config.conf_TagNameLst

        for sn in self.uutSnList:        
            obj = self.uutDict[sn]["obj"]
            slot = self.uutDict[sn]["slot"]
            uut_slot = int(slot)
            ser_obj = self.uut_ser_dict[slot]
            UUT_ber = "UUT_slot%s" % slot
            ber_obj = self.uut_ser_dict[UUT_ber]
            sn_id = self.uutDict[sn]["id"]
            
            obj = ser_obj
            self.info("### Running UUT (%s) on slot (%s)" % (sn, slot))
            uutid = self.uutDict[sn]["id"]
            # get the last save_tags XML data
            res_path = database.get_result_path(self.config, sn_id, sn)
            self.info("Reading original XML from '%s'" % res_path)
            for tag in tag_list:
                xml_file = os.path.join(res_path, "%s.xml" % (tag))
                if not os.path.isfile(xml_file):
                    self.error("File '%s' does not exist!" % xml_file)
                else:
                    fd = open(xml_file)
                    xml_str = fd.read()
                    tag_obj = ber_obj.stringToPomObj(xml_str, tag)
                    (uploaded_tag, upload_status) = ser_obj.read_tag_from_mike(tag)
                    if not upload_status:
                        self.failed("Failed to read tag '%s' from EEPROM" % tag)
                    else:
                        rv = configurator.cmp_pom_objs(tag_obj, uploaded_tag,
                                self)
                    if rv:
                        if tag == 'PHRX_CAL' or tag == 'DRIVER_AMP_CAL':
                            self.diagnostic("IGNORING mismatch on tag '%s'" % tag)
                        else:
                            self.failed("Failed on verify tag '%s'" % tag)
                            self.errorCount[sn] += 1
                    else:
                        fd = open(xml_file)
                        xml_str = fd.read()
                        tag_obj = ber_obj.stringToPomObj(xml_str, tag)
                        (uploaded_tag, upload_status) = ser_obj.read_tag_from_mike(tag)
                        if not upload_status:
                            self.failed("Failed to read tag '%s' from EEPROM" % tag)
                        else:
                            rv = configurator.cmp_pom_objs(tag_obj, uploaded_tag,
                                    self)
                        if rv:
                            self.failed("Failed on verify tag '%s'" % tag)
                            self.errorCount[sn] += 1
                        else:
                            self.passed("Tag '%s' verified" % tag)

        for sn in self.uutSnList:
            self.diagnostic(self.errorCount[sn])
            if (self.errorCount[sn]):
                self.lf.write("\n\nERROR: slot%s(%s):\n UUT VerifyTags test failed.\n" 
                            %(slot, sn))
                return self.failed("slot%s(%s):\n UUT VerifyTags test failed.\n" %(slot, sn), uutid)
            else:
                return self.passed("slot%s(%s):\n UUT VerifyTags test passed.\n" %(slot, sn), uutid)
Beispiel #4
0
    def test_method(self):
        errorCount = 0
        # now begin the actual testing
        tb = self.config.testbed
        tag_list = [
                'LINE_INTF_MFG',
                'DEMOD_MFG',
                'DEMUX_MFG',
                'DRIVER_AMP_MFG',
                'EDFA_MFG',
                'LASER_MFG',
                'MOD_MFG',
                'MUX_MFG',
                'PHRX_MFG',
                'TDC_MFG',
                'TDC_CIR_MFG',
                'DRIVER_AMP_CAL',	
                'DMUX_CAL',
                'MUX_CAL',
		]

        for sn in self.uutSnList:        #excluding refsn
            slot = self.uutDict[sn]["slot"]
            UUT_ber = "UUT_slot%s" % slot
            ber_obj = self.uut_ser_dict[UUT_ber]
            sn_id = self.uutDict[sn]["id"]

            ser_obj = self.uut_ser_dict[slot]
            obj = ser_obj
            self.info("### Running UUT (%s) on slot (%s)" % (sn, slot))
            # now get all MFG tags associated with the top SN.  
            res_path = database.get_result_path(sn_id)
            self.info("Setting module to flash mode...")
            ber_obj.prepFlash()
            print "PATH: %s" %  res_path
            self.info("Disabling Driver and Balance Loops...")
            obj.disable_drv_bal_loops()
            for tag in tag_list:
                src_file = os.path.join(res_path + "/", tag + ".xml")
                f_obj = file(src_file)
                self.info("Restoring tag '%s'..." % tag)
                ber_obj.download_xml_cust(f_obj)
                outfile_name = tag + ".xml"
                self.save_file(src_file)

        # DO THIS FROM CAROL
        ber_obj.reset_card()
                    
        reset_dsp_sleep_time = 100
        self.info("Wait %s seconds for DSP to come up..." % reset_dsp_sleep_time)
        time.sleep(reset_dsp_sleep_time)

        for sn in self.uutSnList:
            slot = self.uutDict[sn]["slot"]
            uutid = self.uutDict[sn]["id"]
            self.diagnostic(self.errorCount[sn])
            if self.errorCount[sn]:
                self.lf.write("\n\nERROR: %s(%s):\n UUT RestoreMfgTags test failed.\n" 
                            %(slot, sn))
                self.failed("%s(%s):\n UUT RestoreMfgTags test failed.\n" %(slot, sn), uutid)
            else:
                self.passed("%s(%s):\n UUT RestoreMfgTags test passed.\n" %(slot, sn), uutid)
          
        return self.completed("RestoreMfgTags test completed.")