Skip to content
Snippets Groups Projects
Commit c2bc38d7 authored by Kenneth Hiemstra's avatar Kenneth Hiemstra
Browse files

enhanced

parent 2109532a
No related branches found
No related tags found
No related merge requests found
......@@ -48,6 +48,7 @@ Description:
###############################################################################
# System imports
import sys
import signal
import test_case
import node_io
import pi_system_info
......@@ -75,17 +76,17 @@ def show_compare_arrays(tc,a,b):
return (not False in compared)
def test_BG_to_DB(tc,io,cmd):
tc.set_section_id('Test BG - ')
tc.append_log(3, '>>>')
tc.append_log(1, '>>> %s' % help_text(tc,io,cmd))
tc.append_log(3, '>>>')
if tc.number == 1:
use_pps=True
tc.append_log(1, '>>> Using PPS')
tc.set_section_id('Test BG-DB (pps) - ')
else:
use_pps=False
tc.append_log(1, '>>> NOT Using PPS')
tc.set_section_id('Test BG-DB (nopps) - ')
tc.append_log(3, '>>>')
tc.append_log(1, '>>> %s' % help_text(tc,io,cmd))
tc.append_log(3, '>>>')
if use_pps==True: ppsh = pi_ppsh.PiPpsh(tc, io)
......@@ -377,7 +378,7 @@ def help_text(tc,io,cmd):
tc.append_log(0, '')
tc.append_log(0, '[reset, load user img] sequence: --seq REGMAP,WDI,REGMAP,REMU,REGMAP,INFO')
tc.append_log(0, '[flash+start user img] sequence: --seq FLASH,WDI,REGMAP,REMU,REGMAP,INFO -s file.rbf')
tc.append_log(0, '[re-read info,sensors] sequence: --seq INFO,PPSH,SENSORS --rep 10 -s expected_design_name')
tc.append_log(0, '[re-read info,sensors] sequence: --seq INFO,PPSH,SENSORS --rep -1 -s expected_design_name')
tc.append_log(0, '[reset to factory] sequence: --seq WDI,REGMAP')
tc.append_log(0, '[program user image] sequence: --seq FLASH -s file.rbf')
tc.append_log(0, '[load user image] sequence: --seq REMU,REGMAP')
......@@ -387,6 +388,9 @@ def help_text(tc,io,cmd):
return str
def signal_handler(signal, frame):
print('You pressed Ctrl+C!')
tc.repeat=0
##################################################################################################################
......@@ -398,37 +402,41 @@ tc.set_result('PASSED')
dgnName = tc.gpString
tc.append_log(3, '>>>')
tc.append_log(1, '>>> Title : Test bench (%s) on nodes %s, %s' % (sys.argv[0],tc.unb_nodes_string(''),dgnName))
tc.append_log(1, '>>> Commandline : %s' % " ".join(sys.argv))
tc.append_log(3, '>>>')
# Create access object for nodes
io = node_io.NodeIO(tc.nodeImages, tc.base_ip)
signal.signal(signal.SIGINT, signal_handler)
##################################################################################################################
# Run tests
nof_errors = 0
rep = 0
while rep < tc.repeat:
rep += 1
run = 0
while tc.repeat != 0: # -1 for non-stop
tc.repeat -= 1
run += 1
tc.append_log(3, '')
tc.append_log(2, 'Rep = %d' % rep)
tc.append_log(2, 'Run = %d' % run)
try:
for cmd in tc.sequence:
tc.append_log(3, 'Next command: %s : %s: %s' % (cmd,Cmd[cmd][1],Cmd[cmd][2]))
tc.append_log(3, 'Next command: %s' % cmd)
subtc = test_case.Testcase('SUBTB - ', '')
subtc = test_case.Testcase('TB %d (%.02fs) - ' % (run,tc.get_run_time()), '')
subtc.set_result('PASSED')
if cmd == 'INFO': # reload node_io:
if cmd == 'REGMAP': # reload node_io:
io = Cmd[cmd][0](subtc,io,cmd)
else:
Cmd[cmd][0](subtc,io,cmd)
if subtc.get_result() == 'FAILED':
nof_errors+=1
tc.append_log(3, 'This test FAILED')
tc.append_log(3, 'Testcase FAILED')
tc.append_log(3, '>>>')
tc.set_result('FAILED')
......@@ -448,7 +456,9 @@ tc.set_section_id('')
tc.append_log(3, '')
tc.append_log(3, '>>>')
tc.append_log(0, '>>> Test bench result: %s' % tc.get_result())
tc.append_log(0, '>>> Number of runs=%d' % run)
tc.append_log(0, '>>> Number of errors=%d' % nof_errors)
tc.append_log(0, '>>> Runtime=%f seconds (%f hours)' % (tc.get_run_time(),tc.get_run_time()/3600))
tc.append_log(3, '>>>')
sys.exit(tc.get_result())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment