def alt_buzz(self, sn): if self.passed: sounder.play(sound_passed_clap, repeat=False) sounder.sound_and_confirm('%s has passed the test' % sn, sound_passed, repeat=True) tp5_poly else: sounder.play(sound_failed_noo, repeat=Ftp5_polyalseself) sounder.sound_and_confirm('%s has failed the test' % sn, sound_failed, repeat=True)
def alt_buzz(self, sn): if not blmdebug: if self.passed: sounder.play(sound_passed_clap, repeat=False) sounder.sound_and_confirm('%s has passed the test' % sn, sound_passed, repeat=True) else: sounder.play(sound_failed_noo, repeat=False) sounder.sound_and_confirm('%s has failed the test' % sn, sound_failed, repeat=True)
def blmtester(self, sn, rfMac, wo): global snap_mac global hostname try: # gitrev = get_app_revision() self.sequence_start(sn + '_' + wo, 'blmtest', get_revision()) self.init() uut_snap_mac = rfMac print 'UUT_SNAP_MAC: ', hexlify(uut_snap_mac) vresult = os.path.exists('results.csv') if vresult == False: #lets create the file. try: #lets use the append command. If no file exsists it will create it and open for read/write vfile = open('results.csv','ab') except: print('Error in creating the data file.') sys.exit(0) else: try: #lets use the append command. If it does exists it will open for read/write vfile = open('results.csv','ab') except: print('Error in creating the data file.') sys.exit(0) pass sounder.play(sound_test, repeat=False) if Powerup_Init: self.step('Powerup_Init',(self.powerOn,), lim='x == %s' % "True") sleep(3) # ************************************************************************ # Look for BOGUS NetID and Channel # ************************************************************************ print '*********************************************' print ' Setting up for netID = 0x0101 Channel: 1' print '*********************************************' self.eng.open_usb_serial(eng1_usb_serial) self.eng.call(eng1_mac,'saveNvParam', 3, 0x0101) sleep(.5) self.eng.call(eng1_mac,'saveNvParam', 4, 1) sleep(.5) self.eng.call(eng1_mac,'saveNvParam', 11, 0x0514) self.eng.enable_crc(uut_snap_mac, True, False) # self.eng.print_info('eng1', uut_snap_mac) # print '---------------------------> Proper group ID found' # self.eng.call(eng1_mac,'reboot') # sleep(3) if SNAP_OS_VERSION: self.uut_snappy_os_version_read = self.step( 'UUT_SNAPPY_OS_VERSION_READ', (self.eng.read_snappy_os_version, uut_snap_mac),) if Firmware_Upgrade: if self.eng.read_snappy_os_version(uut_snap_mac) !=\ uut_snap_os_version: self.step('UUT_SNAP_OS_UPGRADE', (self.firmware_upgrade, uut_snap_mac, SM220_firmware_file), ) sleep(30) self.eng.call(uut_snap_mac,'reboot') sleep(3) # if SNAP_OS_VERSION: # self.uut_snappy_os_version_read = self.step( # 'UUT_SNAPPY_OS_VERSION_READ', # (self.eng.read_snappy_os_version, uut_snap_mac),) # tmp = self.eng.read_snappy_os_version(eng1_mac) # print 'Test OS:', str(tmp) # tmp = self.eng.read_snappy_os_version(uut_snap_mac) # print 'UUT OS:', str(tmp) # self.step('Verify_UUT_Script_Erased', # (self.eng.call, uut_snap_mac, # 'imageName'), lim=('x=="Arcee"') # ) sounder.play(sound_test, repeat=False) if Spy_Upload: self.step('SPY_UPLOAD', (self.spy_up, uut_snap_mac, uut_test_script)) # sleep(2) # self.eng.call(uut_snap_mac,'reboot') # sleep(5) # tmp = k.GetReading() # print '*********************************************' # print tmp # print '*********************************************' # ************************************************************************ # Change NetID and Channel # ************************************************************************ print '*********************************************' print ' Setting up for netID = 0xbeef Channel: 7' print '*********************************************' self.eng.enable_crc(eng1_mac) self.eng.call(eng1_mac,'saveNvParam', 3, 0xbeef) self.eng.call(eng1_mac,'saveNvParam', 4, 7) # sleep(.5) # self.eng.call(eng1_mac,'saveNvParam', 11, 0x0514) # sleep(1) self.eng.call(eng1_mac,'reboot') sleep(3) self.eng.enable_crc(uut_snap_mac) # self.eng.enable_crc(uut_snap_mac, True, False) self.eng.print_info('eng1', uut_snap_mac) sounder.play(sound_test, repeat=False) self.step('Verify_UUT_Script_Loaded', (self.eng.call, uut_snap_mac, 'imageName'), lim=('x=="Arcee"') ) # self.step('UUT Temp Read', # (self.eng.call, uut_snap_mac, # 'read_temp'),'x > 17 and x < 30') # # self.step('UUT Input Voltage', # (self.eng.call, uut_snap_mac, # 'read_input_voltage'),) temptmp = self.eng.call(uut_snap_mac,'read_temp') print 'Input Voltage = ', temptmp vtmp = self.eng.call(uut_snap_mac,'read_input_voltage') print 'Input Voltage = ', vtmp # self.step('UUT Output Voltage', # (self.eng.call, uut_snap_mac, # 'read_out_voltage'),'x > 11750 and x < 12250') sounder.play(sound_test, repeat=False) # tmp = k.GetReading() # print '*********************************************' # print tmp # print '*********************************************' sounder.play(sound_test, repeat=False) self.eng.enable_crc(eng1_mac) self.eng.call(eng1_mac,'saveNvParam', 3, 0x0101) self.eng.call(eng1_mac,'saveNvParam', 4, 1) sleep(1) self.eng.call(eng1_mac,'reboot') sleep(5) self.eng.close_usb_serial(eng1_usb_serial) #create string for file vstring = time.strftime('%x %X') + "," + hostname + "," + wo + "," + sn + "," + "001C2C1B" + snap_mac_full + "\n" #write string to file print '========---Writing Data to file---=======' vfile.write(vstring) vfile.close() self.BK_TurnPSOff() # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # self.BK_TurnPSOff() # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= except BaseException as e: self.passed = False self.ex = '%s%s' % ( type(e).__name__, str(e.args) ) self.eng.enable_crc(eng1_mac) self.eng.call(eng1_mac,'saveNvParam', 3, 0x0101) self.eng.call(eng1_mac,'saveNvParam', 4, 1) sleep(1) self.eng.call(eng1_mac,'reboot') sleep(5) self.BK_TurnPSOff() # Power BK Off in event of failure self.tb = traceback.format_exc() #create string for file print '(Exception) Writing Data to file' vstring = time.strftime('%x %X') + "," + hostname + "," + wo + "," + sn + "," + "001C2C1B" + snap_mac_full + "\n" #write string to file vfile.write(vstring) finally: #try: # self.init() #except: # pass self.sequence_finish() tester.print_outcome(self.passed) self.alt_buzz(sn)
#DEBUG PROGRAM LOOP REMOVE FOR FINAL TEST VERSION if blmdebug: while True: # raw_input('press Enter to continue') blmtester.start_loop() else: blmtester.start_loop() except: # bk.TurnPSOff() if dup: dup.stop() dup.join() traceback.print_exc(file=sys.stderr) raw_input( 'press Enter to close the test software') sounder.play(sound_close, repeat=False) # sn, sound_close, repeat=False) #========================================================== #========================================================== # self.step('UUT_TEST_SPY_UPLOAD', # (self.spy_up, self.uut_node, # sm220_uut_spy_file) # ) # self.step( # 'REBOOT_UUT', # (self.eng.call, self.uut_node, 'reboot'), # ) # sleep(0.5) # self.step('UUT_IO_TEST',