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

better error handling

parent d9e9e5ce
No related branches found
No related tags found
No related merge requests found
......@@ -133,9 +133,11 @@ def test_BG_to_DB(tc,io,cmd):
# truncate: in 10GbE the data is only sized 700
for s in tc.spNrs:
bg_ram[s][0] = bg_ram[s][0][:-(blocksize-700)]
db_ram[s][0] = db_ram[s][0][:-(blocksize-700)]
for bg in bg_ram:
bg[0] = bg[0][:-(blocksize-700)]
for db in db_ram:
db[0] = db[0][:-(blocksize-700)]
#bg_ram[s][0] = bg_ram[s][0][:-(blocksize-samples_per_packet)]
#db_ram[s][0] = db_ram[s][0][:-(blocksize-samples_per_packet)]
......@@ -404,6 +406,7 @@ io = node_io.NodeIO(tc.nodeImages, tc.base_ip)
##################################################################################################################
# Run tests
nof_errors = 0
rep = 0
while rep < tc.repeat:
rep += 1
......@@ -414,17 +417,28 @@ while rep < tc.repeat:
for cmd in tc.sequence:
tc.append_log(3, 'Next command: %s : %s: %s' % (cmd,Cmd[cmd][1],Cmd[cmd][2]))
subtc = test_case.Testcase('SUBTB - ', '')
subtc.set_result('PASSED')
if cmd == 'INFO': # reload node_io:
io = Cmd[cmd][0](tc,io,cmd)
io = Cmd[cmd][0](subtc,io,cmd)
else:
Cmd[cmd][0](tc,io,cmd)
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, '>>>')
tc.set_result('FAILED')
except KeyError:
print 'Unknown command:',cmd
cmd='help'
Cmd[cmd][0](tc,io,cmd)
except:
print 'Catched error:',sys.exc_info()[0]
# except:
# print 'Catched error:',sys.exc_info()[0]
......@@ -434,6 +448,7 @@ 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 errors=%d' % nof_errors)
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