Commit 145b3156 authored by Dimitris Lampridis's avatar Dimitris Lampridis

Make pts.py a bit more robust and verbose

parent 8e8168eb
......@@ -154,9 +154,9 @@ if __name__ == '__main__':
print "ERROR: Bitstream download fail. Check JTAG connectivity."
else:
# Run JPTS in another shell script; JPTS will handle running each of the test scripts
cmd = "xterm -e ./jpts -s %s %s" % (sn1, sn2)
cmd = "xterm -e ./jpts -d -s %s %s" % (sn1, sn2)
print "Running tests :%s\n" % (cmd)
subprocess.call(cmd, shell=True, stdout=fnull, stderr=fnull)
subprocess.call(cmd, shell=True)
ret = subprocess.call("grep FAIL log/*.log", shell=True, stdout=fnull, stderr=fnull)
......@@ -211,35 +211,37 @@ if __name__ == '__main__':
time.sleep(10)
#Read unique board ID
try:
IDMS = bus.vv_read(UIDREGMS)
IDLS = bus.vv_read(UIDREGLS)
IDMS = bus.vv_read(UIDREGMS)
IDLS = bus.vv_read(UIDREGLS)
#Generate log file
# Generate output file named according to current time
fname = time.strftime("serial-num-CTDAH-%Y-%m-%d", time.localtime()) + ".txt"
ret = subprocess.call(["ls /home/pts-administrator/pts/log/tblo | grep " + fname], shell=True, stdout=None, stderr=None)
#print ("%d" % ret)
if (ret != 0):
f = open("/home/pts-administrator/pts/log/tblo/" + fname, "w")
print(" File not found ... Create new one \n ")
f.write("\n")
f.write("CONV-TTL-BLO Upgrade log created on %s \n" % time.strftime("%Y-%m-%d-%Hh%Mm%Ss", time.localtime()))
f.write("--------------------------------------------------------------------------------- \n")
f.write("Barcode 1 | Barcode 2 | PCB ID |\n")
f.write("--------------------------------------------------------------------------------- \n")
f.close()
print("Upgrade log can be found in /home/pts-administrator/pts/log/tblo/%s \n" % fname)
print ("Board unique ID can be found in /home/pts-administrator/pts/log/tblo/%s \n" % fname)
f = open("/home/pts-administrator/pts/log/tblo/" + fname, "a")
f.write("%s \t %s \t %x%x\n" % (sn1, sn2, IDMS, IDLS) )
#Generate log file
f.close()
# Generate output file named according to current time
fname = time.strftime("serial-num-CTDAH-%Y-%m-%d", time.localtime()) + ".txt"
ret = subprocess.call(["ls /home/pts-administrator/pts/log/tblo | grep " + fname], shell=True, stdout=None, stderr=None)
#print ("%d" % ret)
if (ret != 0):
f = open("/home/pts-administrator/pts/log/tblo/" + fname, "w")
print(" File not found ... Create new one \n ")
f.write("\n")
f.write("CONV-TTL-BLO Upgrade log created on %s \n" % time.strftime("%Y-%m-%d-%Hh%Mm%Ss", time.localtime()))
f.write("--------------------------------------------------------------------------------- \n")
f.write("Barcode 1 | Barcode 2 | PCB ID |\n")
f.write("--------------------------------------------------------------------------------- \n")
f.close()
print("Upgrade log can be found in /home/pts-administrator/pts/log/tblo/%s \n" % fname)
print ("Board unique ID can be found in /home/pts-administrator/pts/log/tblo/%s \n" % fname)
f = open("/home/pts-administrator/pts/log/tblo/" + fname, "a")
f.write("%s \t %s \t %x%x\n" % (sn1, sn2, IDMS, IDLS) )
f.close()
except:
print ""
print "BOARD FAILED..."
#-------------------------------------------------------------------------------
# We're done, turn off the VME crate
......
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