Commit 28038958 authored by unknown's avatar unknown

Modifies lof file save location to pts-admin home directory instead of usb key.…

Modifies lof file save location to pts-admin home directory instead of usb key. Adds second log file to record serial numbers against bar codes for each board
parent 417095ec
......@@ -66,7 +66,7 @@ def main(bus,tname,inf,log):
"""
tests : Flash chip IC20
uses : golden-v0.2_release-v4.0.bin and flashtest.py
uses : golden-v0.3_release-v4.1.bin and flashtest.py
"""
GWVERS_RELEASE = 4.1
......
......@@ -63,6 +63,7 @@ import re
sys.path.append('.')
sys.path.append("pyts/")
# Import here ptsdefine.py, to avoid "uncaught" exceptions later on
from ptsdefine import *
......@@ -185,15 +186,55 @@ if __name__ == '__main__':
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"
print "\nSaving test results in /home/pts-administrator/pts/log"
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)
subprocess.call("mkdir -p /home/pts-administrator/pts/log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
subprocess.call("cp log/*.log /home/pts-administrator/pts/log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
subprocess.call("cp log/*.inf /home/pts-administrator/pts/log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
except e:
print "ERROR: No access to USB key at /media/pts"
print "ERROR: No access to directory /home/pts-administrator/pts"
print e
#-------------------------------------------------------------------------------
# Reading board unique ID and storing to separate log file
#-------------------------------------------------------------------------------
#Read unique board ID
IDMS = testelma.read(ELMASLOT, UIDREGMS)
IDLS = testelma.read(ELMASLOT, 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 | grep " + fname], shell=True, stdout=None, stderr=None)
#print ("%d" % ret)
if (ret != 0):
f = open("/home/pts-administrator/pts/log" + fname, "w")
print(" File not found ... Create new one \n ")
f.write("\n")
f.write("CONV-TTL-XXX Upgrade log created on %s \n" % time.strftime("%Y-%m-%d-%Hh%Mm%Ss", time.localtime()))
f.write("--------------------------------------------------------------------------------- \n")
f.write("* Target version is (v%2.1f)\n" % gwvers_target)
f.write("* Hardware (v0.0) means board is (v3.0) or earlier \n")
f.write("\n")
f.write("--------------------------------------------------------------------------------- \n")
f.write("Barcode 1 | Barcode 2 | PCB ID | HW version | Old gw version | New gw version\n")
f.write("--------------------------------------------------------------------------------- \n")
f.close()
print("Upgrade log can be found in /home/pts-administrator/pts/log/%s \n" % fname)
print ("Board unique ID can be found in /home/pts-administrator/pts/log/%s \n" % fname)
f = open("/home/pts-administrator/pts/log/" + fname, "a")
f.write("%s \t %s \t %x%x\n" % (sn1, sn2, IDMS, IDLS) )
f.close()
#-------------------------------------------------------------------------------
# We're done, turn off the VME crate
print "\nTesting completed!"
men_off()
......
......@@ -76,6 +76,11 @@ LSR_REAR_OFS = 10
# 1-Wire base address, used in therm_id.py
TEMP_1WIRE_BASE = 0x010
# 1-Wire unique ID
UIDREGLS = 0xac # 1-wire chip Unique ID - LSB
UIDREGMS = 0xb0 # 1-wire chip Unique ID - MSB
# DAC and clock info registers and offsets, used in dac_vcxo_pll.py
PLL_DAC_BASE = 0X020
VCXO_DAC_BASE = 0x080
......
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