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
ac73b647
Commit
ac73b647
authored
Mar 03, 2017
by
Christopher Turner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix formatting and naming
parent
803eb903
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
25 deletions
+29
-25
run_tests.py
run_tests.py
+6
-2
LvdsLoopBack.py
tests/LvdsLoopBack.py
+2
-2
LvdsUnplugged.py
tests/LvdsUnplugged.py
+2
-2
PandATest.py
tests/PandATest.py
+1
-1
Plugged.py
tests/Plugged.py
+7
-7
TtlLoopBack.py
tests/TtlLoopBack.py
+2
-2
TtlUnplugged.py
tests/TtlUnplugged.py
+2
-2
Unplugged.py
tests/Unplugged.py
+7
-7
No files found.
run_tests.py
View file @
ac73b647
...
...
@@ -19,6 +19,7 @@ class RunTests(object):
try
:
self
.
cmdsock
=
self
.
setup_connection
(
hostname
,
cmdport
)
except
socket
.
error
as
e
:
raise
self
.
console_logger
.
error
(
e
)
def
setup_connection
(
self
,
hostname
,
cmdport
):
...
...
@@ -70,7 +71,7 @@ class RunTests(object):
def
print_summary
(
self
,
cls_list
):
self
.
console_logger
.
info
(
'-- SUMMARY {}'
.
format
(
''
.
join
([
'-'
]
*
24
)))
self
.
console_logger
.
info
(
'{:<1
0
}{:<11}{:<10}'
.
format
(
'TEST'
,
'NUMBER'
,
'ERRORS'
))
'{:<1
5
}{:<11}{:<10}'
.
format
(
'TEST'
,
'NUMBER'
,
'ERRORS'
))
self
.
console_logger
.
info
(
'{}'
.
format
(
''
.
join
([
'-'
]
*
35
)))
for
cls
in
cls_list
:
summary
=
cls
.
get_summary
()
...
...
@@ -78,7 +79,7 @@ class RunTests(object):
self
.
console_logger
.
info
(
item
)
def
setup_logging
(
logPath
):
file_format
=
"
%(asctime)
s [
%(levelname)-5
s] [
%(name)-1
0
s]
%(message)
s"
file_format
=
"
%(asctime)
s [
%(levelname)-5
s] [
%(name)-1
3
s]
%(message)
s"
console_format
=
"
%(asctime)
s [
%(levelname)-5
s]
%(message)
s"
logging
.
basicConfig
(
level
=
logging
.
DEBUG
,
format
=
file_format
,
...
...
@@ -119,9 +120,12 @@ def main(argv):
'hostname'
,
help
=
'Name or IP address of Panda device'
)
args
=
parser
.
parse_args
()
# try:
rt
=
RunTests
(
'config'
,
args
.
hostname
,
int
(
args
.
port
))
rt
.
run_tests
()
view_log
(
log_path
)
# except:
# print "CONNECTION ERROR"
if
__name__
==
'__main__'
:
main
(
sys
.
argv
[
1
:])
tests/LvdsLoopBack.py
View file @
ac73b647
...
...
@@ -6,10 +6,10 @@ LVDS Loop Back (LB) test
"""
class
LvdsL
B
(
PandATest
.
PandATest
):
class
LvdsL
oopBack
(
PandATest
.
PandATest
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
LvdsL
B
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
super
(
LvdsL
oopBack
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
outputs
=
[
1
,
2
]
self
.
inputs
=
[
1
,
2
]
self
.
ch_connect
=
{
...
...
tests/LvdsUnplugged.py
View file @
ac73b647
...
...
@@ -6,10 +6,10 @@ LVDS Unplugged (U) test
"""
class
LvdsU
(
PandATest
.
PandATest
):
class
LvdsU
nplugged
(
PandATest
.
PandATest
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
LvdsU
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
super
(
LvdsU
nplugged
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
inputs
=
[
1
,
2
]
self
.
outputs
=
[
1
,
2
]
self
.
ch_connect
=
{
...
...
tests/PandATest.py
View file @
ac73b647
...
...
@@ -42,7 +42,7 @@ class PandATest(object):
def
get_summary
(
self
):
error_count
=
self
.
test_result
.
count
(
0
)
summary
=
[
"{:<1
0
}{:<10} ERRORS: {}"
.
format
(
summary
=
[
"{:<1
5
}{:<10} ERRORS: {}"
.
format
(
self
.
__class__
.
__name__
,
self
.
blocknum
,
error_count
)
...
...
tests/Plugged.py
View file @
ac73b647
#!/bin/env dls-python
import
PandATest
import
LvdsL
B
import
TtlL
B
import
LvdsL
oopBack
import
TtlL
oopBack
"""
LVDS and TTL Loop Back (LB) tests combined
...
...
@@ -12,8 +12,8 @@ class Plugged(PandATest.PandATest):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
Plugged
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
lp
=
LvdsL
B
.
LvdsLB
(
*
args
,
**
kwargs
)
self
.
tp
=
TtlL
B
.
TtlLB
(
*
args
,
**
kwargs
)
self
.
lp
=
LvdsL
oopBack
.
LvdsLoopBack
(
*
args
,
**
kwargs
)
self
.
tp
=
TtlL
oopBack
.
TtlLoopBack
(
*
args
,
**
kwargs
)
def
test_code
(
self
):
self
.
logger
.
info
(
'LVDS PLUGGED'
)
...
...
@@ -22,11 +22,11 @@ class Plugged(PandATest.PandATest):
self
.
tp
.
test_code
()
def
get_summary
(
self
):
summary
=
[
"{:<1
0
}{:<10} ERRORS: {}"
.
format
(
summary
=
[
"{:<1
5
}{:<10} ERRORS: {}"
.
format
(
self
.
lp
.
__class__
.
__name__
,
self
.
blocknum
,
self
.
lp
.
test_result
.
count
(
0
)),
"{:<1
0
}{:<10} ERRORS: {}"
.
format
(
"{:<1
5
}{:<10} ERRORS: {}"
.
format
(
self
.
tp
.
__class__
.
__name__
,
self
.
blocknum
,
self
.
tp
.
test_result
.
count
(
0
)),
...
...
@@ -36,5 +36,5 @@ class Plugged(PandATest.PandATest):
def
get_user_input
(
self
):
inputy
=
'.'
while
inputy
not
in
[
''
]:
print
"Loopback connect
e
rs connected, OK ? [return]"
print
"Loopback connect
o
rs connected, OK ? [return]"
inputy
=
raw_input
()
\ No newline at end of file
tests/TtlLoopBack.py
View file @
ac73b647
...
...
@@ -5,10 +5,10 @@ import PandATest
TTL Loop Back (LB) test
"""
class
TtlL
B
(
PandATest
.
PandATest
):
class
TtlL
oopBack
(
PandATest
.
PandATest
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
TtlL
B
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
super
(
TtlL
oopBack
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
outputs
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
]
self
.
inputs
=
[
1
,
2
,
3
,
4
,
5
,
6
]
self
.
ch_connect
=
{
...
...
tests/TtlUnplugged.py
View file @
ac73b647
...
...
@@ -6,10 +6,10 @@ TTL Unplugged (U) test
"""
class
TtlU
(
PandATest
.
PandATest
):
class
TtlU
nplugged
(
PandATest
.
PandATest
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
TtlU
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
super
(
TtlU
nplugged
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
outputs
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
]
self
.
inputs
=
[
1
,
2
,
3
,
4
,
5
,
6
]
self
.
ch_connect
=
{
...
...
tests/Unplugged.py
View file @
ac73b647
#!/bin/env dls-python
import
PandATest
import
LvdsU
import
TtlU
import
LvdsU
nplugged
import
TtlU
nplugged
"""
LVDS and TTL Unplugged tests
...
...
@@ -12,8 +12,8 @@ class Unplugged(PandATest.PandATest):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
Unplugged
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
lu
=
LvdsU
.
LvdsU
(
*
args
,
**
kwargs
)
self
.
tu
=
TtlU
.
TtlU
(
*
args
,
**
kwargs
)
self
.
lu
=
LvdsU
nplugged
.
LvdsUnplugged
(
*
args
,
**
kwargs
)
self
.
tu
=
TtlU
nplugged
.
TtlUnplugged
(
*
args
,
**
kwargs
)
def
test_code
(
self
):
self
.
logger
.
info
(
'LVDS UNPLUGGED'
)
...
...
@@ -22,11 +22,11 @@ class Unplugged(PandATest.PandATest):
self
.
tu
.
test_code
()
def
get_summary
(
self
):
summary
=
[
"{:<1
0
}{:<10} ERRORS: {}"
.
format
(
summary
=
[
"{:<1
5
}{:<10} ERRORS: {}"
.
format
(
self
.
lu
.
__class__
.
__name__
,
self
.
blocknum
,
self
.
lu
.
test_result
.
count
(
0
)),
"{:<1
0
}{:<10} ERRORS: {}"
.
format
(
"{:<1
5
}{:<10} ERRORS: {}"
.
format
(
self
.
tu
.
__class__
.
__name__
,
self
.
blocknum
,
self
.
tu
.
test_result
.
count
(
0
)),
...
...
@@ -36,5 +36,5 @@ class Unplugged(PandATest.PandATest):
def
get_user_input
(
self
):
inputy
=
'.'
while
inputy
not
in
[
''
]:
print
"Loopback connect
e
rs NOT connected, OK ? [return]"
print
"Loopback connect
o
rs NOT connected, OK ? [return]"
inputy
=
raw_input
()
\ No newline at end of file
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