Commit 83704e75 authored by Christopher Turner's avatar Christopher Turner

Add chance to check connectors

parent d8cb3c26
......@@ -53,34 +53,29 @@ class LoopBack(PandATest.PandATest):
self.enc4.blocknum = 4
def test_code(self):
self.logger.info('---- {} {}'.format('LVDS LOOP BACK',''.join(['-']*28)))
self.lp.test_code()
self.logger.info('---- {} {}'.format('TTL LOOP BACK',''.join(['-']*28)))
self.tp.test_code()
self.logger.info('---- {} {} {} {}'.format('ENCODER',
self.enc1.blocknum,
'LOOP BACK',
''.join(['-']*28)
))
self.enc1.test_code()
self.logger.info('---- {} {} {} {}'.format('ENCODER',
self.enc2.blocknum,
'LOOP BACK',
''.join(['-']*28)
))
self.enc2.test_code()
self.logger.info('---- {} {} {} {}'.format('ENCODER',
self.enc3.blocknum,
'LOOP BACK',
''.join(['-']*28)
))
self.enc3.test_code()
self.logger.info('---- {} {} {} {}'.format('ENCODER',
self.enc4.blocknum,
self.run_loopback_test(self.lp)
self.run_loopback_test(self.tp)
self.run_loopback_test(self.enc1)
self.run_loopback_test(self.enc2)
self.run_loopback_test(self.enc3)
self.run_loopback_test(self.enc4)
def run_loopback_test(self, test_cls):
self.logger.info('---- {} {} {} {}'.format(test_cls.__class__.__name__,
test_cls.blocknum,
'LOOP BACK',
''.join(['-']*28)
))
self.enc4.test_code()
for attempt in [1, 2]:
self.logger.info('---- ATTEMPT {} {}'.format(attempt, ''.join(['-']*28)))
test_cls.test_code()
if test_cls.test_result.count(0) != 0 and attempt == 1:
test_cls.test_result = []
self.check_connectors(test_cls.__class__.__name__, test_cls.blocknum)
elif test_cls.test_result.count(0) == 0:
break
def get_summary(self):
tests = [self.lp, self.tp, self.enc1, self.enc2, self.enc3, self.enc4]
......@@ -99,6 +94,11 @@ class LoopBack(PandATest.PandATest):
print "Loopback connectors connected, OK ? [return]"
inputy = raw_input()
def check_connectors(self, test, block_no):
inputy = '.'
while inputy not in ['']:
print "TEST FAILED! ({} {}), Check connectors connected [return]".format(test, block_no)
inputy = raw_input()
......
......@@ -57,7 +57,7 @@ class PandATest(object):
]
return summary
def get_user_input(self):
def get_user_input(self, msg=''):
pass
def check_response(self, response, expected, cmd, tol=0):
......
......@@ -58,34 +58,28 @@ class Unplugged(PandATest.PandATest):
self.enc4.unplugged = True
def test_code(self):
self.logger.info('---- {} {}'.format('LVDS UNPLUGGED',''.join(['-']*28)))
self.lu.test_code()
self.logger.info('---- {} {}'.format('TTL UNPLUGGED',''.join(['-']*28)))
self.tu.test_code()
self.logger.info('---- {} {} {} {}'.format('ENCODER',
self.enc1.blocknum,
'UNPLUGGED',
''.join(['-']*28)
))
self.enc1.test_code()
self.logger.info('---- {} {} {} {}'.format('ENCODER',
self.enc2.blocknum,
'UNPLUGGED',
''.join(['-']*28)
))
self.enc2.test_code()
self.logger.info('---- {} {} {} {}'.format('ENCODER',
self.enc3.blocknum,
'UNPLUGGED',
''.join(['-']*28)
))
self.enc3.test_code()
self.logger.info('---- {} {} {} {}'.format('ENCODER',
self.enc4.blocknum,
self.run_unplugged_test(self.lu)
self.run_unplugged_test(self.tu)
self.run_unplugged_test(self.enc1)
self.run_unplugged_test(self.enc2)
self.run_unplugged_test(self.enc3)
self.run_unplugged_test(self.enc4)
def run_unplugged_test(self, test_cls):
self.logger.info('---- {} {} {} {}'.format(test_cls.__class__.__name__,
test_cls.blocknum,
'UNPLUGGED',
''.join(['-']*28)
))
self.enc4.test_code()
for attempt in [1, 2]:
self.logger.info('---- ATTEMPT {} {}'.format(attempt, ''.join(['-']*28)))
test_cls.test_code()
if test_cls.test_result.count(0) != 0 and attempt == 1:
test_cls.test_result = []
self.check_connectors(test_cls.__class__.__name__, test_cls.blocknum)
elif test_cls.test_result.count(0) == 0:
break
def get_summary(self):
tests = [self.lu, self.tu, self.enc1, self.enc2, self.enc3, self.enc4]
......@@ -102,4 +96,10 @@ class Unplugged(PandATest.PandATest):
inputy = '.'
while inputy not in ['']:
print "Loopback connectors NOT connected, OK ? [return]"
inputy = raw_input()
\ No newline at end of file
inputy = raw_input()
def check_connectors(self, test, block_no):
inputy = '.'
while inputy not in ['']:
print "TEST FAILED! ({} {}), Check connectors connected [return]".format(test, block_no)
inputy = raw_input()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment