def run_all(origin): test_summary = "" #initialize return value t_str = time.strftime("%d.%b.%Y %H.%M.%S", time.gmtime()) with file_manager.ManagedFileOpen( '/root/log/laser_self_test_data/%s.gz' % t_str, 'w') as (f, tags): tags['origin'] = origin f.write('Laser Self-test, %s\n' % t_str) print(' CLICK-A Laser Self-Test Script') try: def file_as_bytes(file): with file: return file.read() hash_v = hashlib.md5( file_as_bytes( open('/root/test/automated_laser_checks.py', 'rb'))).hexdigest() f.write('MD5: %s\n' % str(hash_v)) print('MD5: %s' % str(hash_v)) except: f.write('Hash failure, check script path\n') print('Hash failure, check script path') results = ["", ""] results[0] = "PASS" if test_calib_laser(f) else "FAIL" results[1] = "PASS" if test_seed(f) else "FAIL" test_summary = "Calib Test: %s\nSeed Test: %s" % tuple(results) return test_summary
def run_all(origin): test_summary = "" #initialize return value t_str = time.strftime("%d.%b.%Y %H.%M.%S", time.gmtime()) with file_manager.ManagedFileOpen('/root/log/%s.gz' % t_str,'w') as (f, tags): tags['origin'] = origin f.write('EDFA OFF Script, %s\n' % t_str) print(' CLICK-A EDFA OFF Script') try: def file_as_bytes(file): with file: return file.read() hash_v = hashlib.md5(file_as_bytes(open('/root/test/edfa_off.py', 'rb'))).hexdigest() f.write('MD5: %s\n' % str(hash_v)) print('MD5: %s' % str(hash_v)) except: f.write('Hash failure, check script path\n') print('Hash failure, check script path') results = "SUCCESS" if pwr_edfa_off(f) else "FAIL" test_summary = "EDFA OFF: %s" % results f.write(test_summary) print(test_summary) return test_summary
def run_all(origin): test_summary = "" #initialize return val t_str = time.strftime("%d.%b.%Y %H.%M.%S", time.gmtime()) with file_manager.ManagedFileOpen('/root/log/self_test_data/%s.gz' % t_str, 'w') as (f, tags): tags['origin'] = origin f.write('Self-test, %s\n' % t_str) print(' CLICK-A Self-Test Script') try: def file_as_bytes(file): with file: return file.read() hash_v = hashlib.md5( file_as_bytes( open('/root/test/general_functionality_test.py', 'rb'))).hexdigest() f.write('MD5: %s\n' % str(hash_v)) print('MD5: %s' % str(hash_v)) except: f.write('Hash failure, check script path\n') print('Hash failure, check script path') results = ["", "", "", "", "", "", "", "", "", "", "", ""] results[0] = "PASS" if reflash_fpga( f) else "FAIL" #"Reflashing FPGA to start self test sequence" results[1] = "PASS" if test_basic_fpga_if( f) else "FAIL" #'Basic FPGA read/write' results[2] = "PASS" if test_fpga_if_performance( f) else "FAIL" #'Benchmark FPGA read/write' results[3] = "PASS" if test_mod_FIFO( f) else "FAIL" #'Modulator Data FIFO Test' results[4] = "PASS" if check_temperature_init( f) else "FAIL" #"Temperature Sensor Init Sequence Check" results[5] = "PASS" if test_BIST(f) else "FAIL" #BIST Circuit Test results[6] = "PASS" if test_EDFA_IF( f) else "FAIL" # "Testing EDFA IF & Current" results[7] = "PASS" if test_tec_driver( f) else "FAIL" #"TEC Driver Test" results[8] = "PASS" if test_bias_driver(f) else "FAIL" #"LD Bias Test" results[9] = "PASS" if test_scan_PPM(f) else "FAIL" #"PPM Power Test" results[10] = "PASS" if check_CW_power(f) else "FAIL" #"CW Power Test" results[11] = "PASS" if test_heaters( f) else "FAIL" #"Heater Actuation Test" test_summary = "Reflash FPGA: %s\nBasic FPGA R/W: %s\nBenchmark FPGA R/W: %s\nFIFO: %s\nTemp Sensor Init: %s\nBIST Circuit: %s\nEDFA IF & Current: %s\nTEC Driver: %s\nLD Bias: %s\nPPM Pwr: %s\nCW Pwr: %s\nHeater Actuation: %s" % tuple( results) return test_summary
#PPM Order PPM = int(sys.argv[1]) assert sys.argv[2] in ('m', 'd', 'a') end = int(sys.argv[3]) #time window size, in symbols SYMB = int(sys.argv[4]) #phase, 32 by symbol PHA = int(sys.argv[5]) MAX = 0xCCCC t_str = time.strftime("%d.%b.%Y %H.%M.%S", time.gmtime()) with file_manager.ManagedFileOpen('/root/data/bist/%s.gz' % t_str, 'w') as (f, tags): tags['PPM'] = sys.argv[1] tags['mode'] = sys.argv[2] tags['mode param'] = sys.argv[3] tags['Symbols'] = sys.argv[4] tags['Phase'] = sys.argv[5] sc = Scope(fpga) sc.init_thresholds() sc.set_frequency(slots=SYMB) sc.set_timebase(phase=PHA) if sys.argv[2] == 'm': rc = VerticalRecordMonotonic(f, th_range=(0, MAX), step=end) elif sys.argv[2] == 'd': rc = VerticalRecordDivide(f, th_range=(0, MAX), max_pts=end)