Commit 644df85b authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana

sw: Added grepping log files for PASS/FAIL

parent a8ec8a03
......@@ -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 "\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 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 "\nTesting 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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment