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
7113151c
Commit
7113151c
authored
Jan 22, 2019
by
Tom Trafford
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated tests for Panda 1.0
parent
29a597af
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
33 deletions
+45
-33
read_config.py
read_config.py
+1
-3
Encoder.py
tests/Encoder.py
+17
-5
EncoderLoopBack.py
tests/EncoderLoopBack.py
+1
-1
EncoderUnplugged.py
tests/EncoderUnplugged.py
+1
-1
Fmc.py
tests/Fmc.py
+10
-10
PandATest.py
tests/PandATest.py
+3
-3
Sfp.py
tests/Sfp.py
+12
-10
No files found.
read_config.py
View file @
7113151c
...
...
@@ -3,9 +3,7 @@ import os, sys, getopt
import
csv
import
collections
PAR_DIR
=
os
.
path
.
join
(
__file__
,
os
.
pardir
)
ROOT_DIR
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
PAR_DIR
))
APP_DIR
=
os
.
path
.
join
(
ROOT_DIR
,
"PandATest"
)
APP_DIR
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
class
ConfigReader
(
object
):
def
__init__
(
self
):
...
...
tests/Encoder.py
View file @
7113151c
...
...
@@ -11,10 +11,8 @@ class Encoder(PandATest.PandATest):
def
setup_quad
(
self
):
#(cmd, (expected result, +- bound of result))
setup_quad_commands
=
OrderedDict
([
(
'INENC{}.BYPASS=On'
.
format
(
self
.
blocknum
),
(
'OK'
,
0
)),
(
'OUTENC{}.BYPASS=On'
.
format
(
self
.
blocknum
),
(
'OK'
,
0
)),
(
'INENC{}.PROTOCOL=Quadrature'
.
format
(
self
.
blocknum
),
(
'OK'
,
0
)),
(
'OUTENC{}.PROTOCOL=
Quadrature
'
.
format
(
self
.
blocknum
),
(
'OK'
,
0
))
(
'OUTENC{}.PROTOCOL=
ABZ Passthrough
'
.
format
(
self
.
blocknum
),
(
'OK'
,
0
))
])
#SET FOR QUADRATURE
for
cmd
,
expected
in
setup_quad_commands
.
items
():
...
...
@@ -25,17 +23,31 @@ class Encoder(PandATest.PandATest):
def
setup_ssi
(
self
):
setup_ssi_commands
=
OrderedDict
([
(
'INENC{}.PROTOCOL=SSI'
.
format
(
self
.
blocknum
),
(
'OK'
,
0
)),
(
'OUTENC{}.PROTOCOL=SSI'
.
format
(
self
.
blocknum
),
(
'OK'
,
0
))
(
'OUTENC{}.PROTOCOL=SSI'
.
format
(
self
.
blocknum
),
(
'OK'
,
0
)),
(
'INENC{}.CLK_SRC=From CLK'
.
format
(
self
.
blocknum
),
(
'OK'
,
0
))
])
#SET FOR SSI
for
cmd
,
expected
in
setup_ssi_commands
.
items
():
response
=
self
.
send_cmd
(
cmd
)
self
.
test_result
.
append
(
self
.
check_response
(
response
,
expected
[
0
],
cmd
,
expected
[
1
]))
def
setup_data
(
self
):
setup_data_commands
=
OrderedDict
([
(
'INENC{}.PROTOCOL=SSI'
.
format
(
self
.
blocknum
),
(
'OK'
,
0
)),
(
'OUTENC{}.PROTOCOL=DATA Passthrough'
.
format
(
self
.
blocknum
),
(
'OK'
,
0
)),
(
'INENC{}.CLK_SRC=From CLK'
.
format
(
self
.
blocknum
),
(
'OK'
,
0
)),
(
'OUTENC{}.CONN=ONE'
.
format
(
self
.
blocknum
),
(
'OK'
,
0
))
])
#SET FOR SSI
for
cmd
,
expected
in
setup_data_commands
.
items
():
response
=
self
.
send_cmd
(
cmd
)
self
.
test_result
.
append
(
self
.
check_response
(
response
,
expected
[
0
],
cmd
,
expected
[
1
]))
def
check_daughter_board
(
self
):
#CHECK FOR CONTROL ENCODERS
response
=
self
.
send_cmd
(
'INENC{}.DCARD_
ID
?'
.
format
(
self
.
blocknum
))
response
=
self
.
send_cmd
(
'INENC{}.DCARD_
TYPE
?'
.
format
(
self
.
blocknum
))
if
'Encoder Control'
not
in
response
:
print
"Encoder {} daughter board mismatch: {}"
.
format
(
self
.
blocknum
,
response
)
...
...
tests/EncoderLoopBack.py
View file @
7113151c
...
...
@@ -33,7 +33,7 @@ class EncoderLB(Encoder.Encoder):
self
.
outputs
[
0
]:
self
.
inputs
[
0
]
}
self
.
toggle_val
(
'INENC'
,
''
,
'OUTENC'
,
''
,
default_val
)
self
.
setup_data
()
self
.
outputs
=
[
'DATA'
]
self
.
inputs
=
self
.
outputs
self
.
ch_connect
=
{
...
...
tests/EncoderUnplugged.py
View file @
7113151c
...
...
@@ -33,7 +33,7 @@ class EncoderUP(Encoder.Encoder):
self
.
outputs
[
0
]:
-
1
,
}
self
.
toggle_val
(
'INENC'
,
''
,
'OUTENC'
,
''
,
default_val
)
self
.
setup_data
()
self
.
outputs
=
[
'DATA'
]
self
.
inputs
=
self
.
outputs
self
.
ch_connect
=
{
...
...
tests/Fmc.py
View file @
7113151c
...
...
@@ -9,19 +9,19 @@ class Fmc(PandATest.PandATest):
#(cmd, (expected result, +/- tolerance of result))
internal_commands
=
OrderedDict
([
(
'FMC.FMC_PRSNT?'
,
(
'OK =1'
,
0
)),
(
'FMC.LOOP_PERIOD=125'
,
(
'OK'
,
0
)),
(
'FMC.SOFT_RESET='
,
(
'OK'
,
0
)),
(
'FMC.LA_P_ERROR?'
,
(
'OK =0'
,
0
)),
(
'FMC.LA_N_ERROR?'
,
(
'OK =0'
,
0
)),
(
'FMC.GTREFCLK?'
,
(
'OK =8191'
,
1
)),
(
'FMC.FMC_CLK0?'
,
(
'OK =10240'
,
1
)),
(
'FMC.FMC_CLK1?'
,
(
'OK =10240'
,
1
)),
(
'FMC.LINK_UP?'
,
(
'OK =1'
,
0
)),
(
'FMC
_LBACK
.FMC_PRSNT?'
,
(
'OK =1'
,
0
)),
(
'FMC
_LBACK
.LOOP_PERIOD=125'
,
(
'OK'
,
0
)),
(
'FMC
_LBACK
.SOFT_RESET='
,
(
'OK'
,
0
)),
(
'FMC
_LBACK
.LA_P_ERROR?'
,
(
'OK =0'
,
0
)),
(
'FMC
_LBACK
.LA_N_ERROR?'
,
(
'OK =0'
,
0
)),
(
'FMC
_LBACK
.GTREFCLK?'
,
(
'OK =8191'
,
1
)),
(
'FMC
_LBACK
.FMC_CLK0?'
,
(
'OK =10240'
,
1
)),
(
'FMC
_LBACK
.FMC_CLK1?'
,
(
'OK =10240'
,
1
)),
(
'FMC
_LBACK
.LINK_UP?'
,
(
'OK =1'
,
0
)),
])
external_commands
=
OrderedDict
([
(
'FMC.EXT_CLK?'
,
(
'OK ={}'
,
1
)),
(
'FMC
_LBACK
.EXT_CLK?'
,
(
'OK ={}'
,
1
)),
])
for
cmd
,
expected
in
internal_commands
.
items
():
...
...
tests/PandATest.py
View file @
7113151c
...
...
@@ -15,8 +15,8 @@ class PandATest(object):
1
:
"..OK"
}
self
.
toggle_cmd
=
{
0
:
'
BITS.
ZERO'
,
1
:
'
BITS.
ONE'
0
:
'ZERO'
,
1
:
'ONE'
}
self
.
unplugged_string
=
{
False
:
'Loop Back'
,
...
...
@@ -111,4 +111,4 @@ class PandATest(object):
self
.
test_result
.
append
(
0
)
self
.
logger
.
info
(
"{:<28}[{:<9}] {}"
.
format
(
"OUT{}=>{}, INP{}=>"
.
format
(
output
,
tgl_val
,
inp
),
response
,
self
.
ok_string
[
self
.
test_result
[
-
1
]]))
\ No newline at end of file
response
,
self
.
ok_string
[
self
.
test_result
[
-
1
]]))
tests/Sfp.py
View file @
7113151c
...
...
@@ -8,16 +8,18 @@ class Sfp(PandATest.PandATest):
def
test_code
(
self
):
#(cmd, (expected result, +- tolerance of result))
internal_commands
=
OrderedDict
([
(
'SFP.SOFT_RESET='
,
(
'OK'
,
0
)),
(
'SFP.SFP_CLK1?'
,
(
'OK=3276'
,
1
)),
(
'SFP.SFP_CLK2?'
,
(
'OK=3276'
,
1
)),
(
'SFP.SFP_CLK3?'
,
(
'OK=3276'
,
1
)),
(
'SFP.LINK1_UP?'
,
(
'OK =1'
,
0
)),
(
'SFP.ERROR1_COUNT?'
,
(
'OK =0'
,
0
)),
(
'SFP.LINK2_UP?'
,
(
'OK =1'
,
0
)),
(
'SFP.ERROR2_COUNT?'
,
(
'OK =0'
,
0
)),
(
'SFP.LINK3_UP?'
,
(
'OK =1'
,
0
)),
(
'SFP.ERROR3_COUNT?'
,
(
'OK =0'
,
0
))
(
'SFP1_LBACK.SOFT_RESET='
,
(
'OK'
,
0
)),
(
'SFP2_LBACK.SOFT_RESET='
,
(
'OK'
,
0
)),
(
'SFP3_LBACK.SOFT_RESET='
,
(
'OK'
,
0
)),
(
'SFP1_LBACK.SFP_CLK?'
,
(
'OK=3276'
,
1
)),
(
'SFP2_LBACK.SFP_CLK?'
,
(
'OK=3276'
,
1
)),
(
'SFP3_LBACK.SFP_CLK?'
,
(
'OK=3276'
,
1
)),
(
'SFP1_LBACK.LINK_UP?'
,
(
'OK =1'
,
0
)),
(
'SFP1_LBACK.ERROR_COUNT?'
,
(
'OK =0'
,
0
)),
(
'SFP2_LBACK.LINK_UP?'
,
(
'OK =1'
,
0
)),
(
'SFP2_LBACK.ERROR_COUNT?'
,
(
'OK =0'
,
0
)),
(
'SFP3_LBACK.LINK_UP?'
,
(
'OK =1'
,
0
)),
(
'SFP3_LBACK.ERROR_COUNT?'
,
(
'OK =0'
,
0
))
])
for
cmd
,
expected
in
internal_commands
.
items
():
...
...
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