Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Conv TTL RS485 - Testing
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
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
Conv TTL RS485 - Testing
Commits
644df85b
Commit
644df85b
authored
Oct 31, 2014
by
Theodor-Adrian Stana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw: Added grepping log files for PASS/FAIL
parent
a8ec8a03
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
21 deletions
+18
-21
pts.py
pts/python/pts.py
+18
-21
No files found.
pts/python/pts.py
View file @
644df85b
...
...
@@ -171,12 +171,9 @@ if __name__ == '__main__':
time
.
sleep
(
1
)
# Run JPTS in another shell script; JPTS will handle running each of the test scripts
#cmd = "xterm -e ./jpts.py -s %s %s" % (sn1, sn2)
#print "Running tests :%s\n" % (cmd)
#subprocess.call(cmd, shell=True, stdout=fnull, stderr=fnull)
cmd
=
"./jpts.py -s
%
s
%
s"
%
(
sn1
,
sn2
)
cmd
=
"xterm -e ./jpts.py -s
%
s
%
s"
%
(
sn1
,
sn2
)
print
"Running tests :
%
s
\n
"
%
(
cmd
)
subprocess
.
call
(
cmd
,
shell
=
True
,
stdout
=
sys
.
stderr
,
stderr
=
sys
.
stderr
)
subprocess
.
call
(
cmd
,
shell
=
True
,
stdout
=
fnull
,
stderr
=
fnull
)
# # After JPTS has finished, download release bitstream to EEPROM chip if none of the tests has failed
# print "Loading CONV-TTL-RS485 release bitstream\n"
...
...
@@ -196,21 +193,21 @@ if __name__ == '__main__':
# # .. and run the flash test
# cmd = "cd /home/pts/ubuntu/ttlbl/pyts; python flash_test.py"
# subprocess.call(cmd, shell=True, stdout=sys.stdout, stderr=sys.stderr)
#
#
# After all testing has finished, grep the log files for PASS and FAIL messages and print the outcomes to the console
# subprocess.call("grep PASS /home/pts/ubuntu/ttlbl/
log/*.log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
# subprocess.call("grep FAIL /home/pts/ubuntu/ttlbl/
log/*.log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
#
#
# Save results on USB key...
#
print "\nSaving test results on USB key"
#
try:
#
subprocess.call("mkdir -p /media/pts/log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
# subprocess.call("cp /home/pts/ubuntu/ttlbl/
log/*.log /media/pts/log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
# subprocess.call("cp /home/pts/ubuntu/ttlbl/
log/*.inf /media/pts/log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
#
except e:
#
print "ERROR: No access to USB key at /media/pts"
#
print e
#
# After all testing has finished, grep the log files for PASS and FAIL messages and print the outcomes to the console
subprocess
.
call
(
"grep PASS
log/*.log"
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
subprocess
.
call
(
"grep FAIL
log/*.log"
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
# Save results on USB key...
print
"
\n
Saving test results on USB key"
try
:
subprocess
.
call
(
"mkdir -p /media/pts/log"
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
subprocess
.
call
(
"cp
log/*.log /media/pts/log"
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
subprocess
.
call
(
"cp
log/*.inf /media/pts/log"
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
except
e
:
print
"ERROR: No access to USB key at /media/pts"
print
e
# We're done, turn off the VME crate
print
"
\n
Testing completed!"
print
"---Turn off ELMA!!"
...
...
@@ -226,7 +223,7 @@ if __name__ == '__main__':
subprocess
.
call
(
"grep WARNING log/*.inf"
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
print
""
print
"--> You may now unplug the CONV-TTL-
BLO
board
%
s-
%
s
\n
"
%
(
sn1
,
sn2
)
print
"--> You may now unplug the CONV-TTL-
RS485
board
%
s-
%
s
\n
"
%
(
sn1
,
sn2
)
msg
=
"--> To exit PTS, type 'ok': "
ok
=
raw_input
(
msg
)
...
...
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