Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PandABox-tst
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PandABox-tst
Commits
83704e75
Commit
83704e75
authored
Mar 03, 2017
by
Christopher Turner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add chance to check connectors
parent
d8cb3c26
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
52 deletions
+52
-52
LoopBack.py
tests/LoopBack.py
+25
-25
PandATest.py
tests/PandATest.py
+1
-1
Unplugged.py
tests/Unplugged.py
+26
-26
No files found.
tests/LoopBack.py
View file @
83704e75
...
...
@@ -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
()
...
...
tests/PandATest.py
View file @
83704e75
...
...
@@ -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
):
...
...
tests/Unplugged.py
View file @
83704e75
...
...
@@ -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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment