Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha - Testing
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
FMC ADC 100M 14b 4cha - Testing
Commits
9688b260
Commit
9688b260
authored
Jun 20, 2011
by
Samuel Iglesias Gonsalvez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tps: added an extra serial number
parent
4393db5d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
7 deletions
+37
-7
tps.py
tps.py
+28
-6
tps.sh
tps.sh
+8
-1
tpsdefault.cfg
tpsdefault.cfg
+1
-0
No files found.
tps.py
View file @
9688b260
...
...
@@ -67,7 +67,7 @@ def run_test(testname, logname, yes=False):
class
Suite
(
object
):
def
__init__
(
self
,
cfgfilename
=
default_config_file
):
self
.
required
=
[
'board'
,
'serial'
,
'test_path'
,
self
.
required
=
[
'board'
,
'serial'
,
'
extra_serial'
,
'
test_path'
,
'log_path'
,
'sequence'
]
for
fieldname
in
self
.
required
:
self
.
__setattr__
(
fieldname
,
None
)
...
...
@@ -98,6 +98,7 @@ class Suite(object):
try
:
self
.
board
=
config
.
get
(
'global'
,
'board'
)
self
.
serial
=
config
.
get
(
'global'
,
'serial'
)
self
.
extra_serial
=
config
.
get
(
'global'
,
'extra_serial'
)
self
.
test_path
=
config
.
get
(
'global'
,
'test_path'
)
self
.
log_path
=
config
.
get
(
'global'
,
'log_path'
)
self
.
sequence
=
config
.
get
(
'global'
,
'sequence'
)
...
...
@@ -112,6 +113,7 @@ class Suite(object):
config
.
add_section
(
'global'
)
config
.
set
(
'global'
,
'board'
,
self
.
board
)
config
.
set
(
'global'
,
'serial'
,
self
.
serial
)
config
.
set
(
'global'
,
'extra_serial'
,
self
.
extra_serial
)
config
.
set
(
'global'
,
'test_path'
,
self
.
test_path
)
config
.
set
(
'global'
,
'log_path'
,
self
.
log_path
)
config
.
set
(
'global'
,
'sequence'
,
self
.
sequence
)
...
...
@@ -133,6 +135,10 @@ class Suite(object):
msg
=
'invalid serial number [{0}]'
.
format
(
self
.
serial
)
raise
TpsInvalid
(
msg
)
self
.
serial
=
self
.
serial
.
strip
(
','
)
if
not
self
.
extra_serial
:
msg
=
'invalid optional serial number [{0}]'
.
format
(
self
.
extra_serial
)
raise
TpsInvalid
(
msg
)
self
.
extra_serial
=
self
.
extra_serial
.
strip
(
','
)
warnings
.
simplefilter
(
'error'
)
try
:
...
...
@@ -203,11 +209,12 @@ class Suite(object):
sys
.
path
.
append
(
self
.
test_path
)
log
.
write
(
'test run
\n
'
' board = {0}
\n
'
' serial = {1}
\n
'
' timestamp = {2}
\n
'
' runid = {3}
\n
'
.
format
(
self
.
board
,
self
.
serial
,
ts
,
runid
))
' board = {0}
\n
'
' serial = {1}
\n
'
' optional serial = {2}
\n
'
' timestamp = {3}
\n
'
' runid = {4}
\n
'
.
format
(
self
.
board
,
self
.
serial
,
self
.
extra_serial
,
ts
,
runid
))
failures
=
[]
for
test
in
sequence
:
try
:
...
...
@@ -280,6 +287,11 @@ def get_serial():
"""
return
raw_input
(
'board serial number? '
)
.
strip
()
def
get_extra_serial
():
"""return serial number of current board to test
"""
return
raw_input
(
'board serial number? '
)
.
strip
()
def
timestamp
():
"""timestamp for now
"""
...
...
@@ -315,6 +327,13 @@ class Cli(cmd.Cmd, Suite):
else
:
print
self
.
serial
def
do_extra_serial
(
self
,
arg
):
if
arg
:
self
.
extra_serial
=
arg
else
:
print
self
.
extra_serial
def
do_test_path
(
self
,
arg
):
if
arg
:
self
.
test_path
=
arg
...
...
@@ -356,6 +375,7 @@ class Cli(cmd.Cmd, Suite):
params_to_list
=
(
'board'
,
'serial'
,
'extra_serial'
,
'test_path'
,
'log_path'
,
'repeat'
,
...
...
@@ -396,6 +416,8 @@ def main():
help
=
"board name (e.g. -b SPEC)"
,
metavar
=
"NAME"
)
parser
.
add_option
(
"-s"
,
"--serial"
,
dest
=
"serial"
,
help
=
"board serial number"
,
metavar
=
"SERIAL"
)
parser
.
add_option
(
"-e"
,
"--extra_serial"
,
dest
=
"extra_serial"
,
help
=
"another board serial number [Optional]"
,
metavar
=
"SERIAL"
)
parser
.
add_option
(
"-t"
,
"--test-path"
,
dest
=
"test_path"
,
help
=
"path to test files"
,
metavar
=
"PATH"
)
parser
.
add_option
(
"-l"
,
"--log-path"
,
dest
=
"log_path"
,
...
...
tps.sh
View file @
9688b260
...
...
@@ -8,5 +8,12 @@ if [ x$1 = x"" ]; then
read
serial
fi
time
./tps.py
-b
SPEC
-s
$serial
-t
./test/spec/python
-l
/tmp 00 01 02 03 05 06 07 08
extra_serial
=
$1
if
[
x
$2
=
x
""
]
;
then
echo
-n
"Please, input extra SERIAL number [optional]: "
read
extra_serial
fi
time
./tps.py
-b
SPEC
-s
$serial
-e
$extra_serial
-t
./test/spec/python
-l
/tmp 00 01 02 03 05 06 07 08
tpsdefault.cfg
View file @
9688b260
[global]
board = SPEC
serial = 000000
extra-serial = 000000
test_path = tests/
log_path = logs/
sequence = ['00', '02', '03']
...
...
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