Commit db87d3d1 authored by Tomasz Wlostowski's avatar Tomasz Wlostowski

test06: keep a copy of the EEPROM contents with the test report

parent 41f138d5
......@@ -10,6 +10,9 @@ from ptsexcept import *
from utilFunctions import *
import sys
import time
import subprocess
import datetime
"""
test06: Writes and validates the card's EEPROM.
......@@ -28,15 +31,34 @@ def main (card=None, default_directory='.',suite=None):
print("Programming SDB filesystem into mezzanine's EEPROM...")
os.system("./%s/gensdbfs %s/sdbfs %s/fd-eeprom.bin" % (default_directory, default_directory, default_directory))
#subprocess.call(["./%s/gensdbfs %s/sdbfs %s/fd-eeprom.bin" % (default_directory, default_directory, default_directory)])
returnval = os.system("./%s/gensdbfs %s/sdbfs %s/fd-eeprom.bin" % (default_directory, default_directory, default_directory))
if (returnval != 0):
print "swapfile not enabled, run out of memory"
raise PtsError ('An error occurred during writing the calibration EEPROM, check log for details')
else:
print("eeprom file created in %s" % (default_directory))
# run eeprom writing procedure
card.write_eeprom_from_file("%s/fd-eeprom.bin" % default_directory, 0)
# wait for file to be visible on disk
time.sleep(1)
if (card.get_return_value() == -1):
raise PtsError ('An error occurred during writing the calibration EEPROM, check log for details')
# run eeprom writing procedure
card.write_eeprom_from_file("%s/fd-eeprom.bin" % default_directory, 0)
print("eeprom file written to eeprom")
eeprom = "/home/user/pts/log_fmcdelay1ns4cha/eeprom/fd-eeprom_%s.bin" % datetime.datetime.now()
#print eeprom
os.rename("%s/fd-eeprom.bin" % default_directory, "%s" % eeprom)
print("eeprom file moved to %s" % eeprom)
#os.remove("%s/fd-eeprom.bin" % (default_directory))
if (card.get_return_value() == -1):
raise PtsError ('An error occurred during writing the calibration EEPROM, check log for details')
print("Programming OK.")
print("Programming OK.")
# restore stderr and display debug information from file
restore_stderr(new_stderr, default_directory)
......
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