Commit 7899a84f authored by Benoit Rat's avatar Benoit Rat

dio: improve pts with return and write eeprom only if test OK

* pts.py now return the number of failures
* fmcdio5chttla.sh: parse the serial_prefic.config for default value
* Writing in EEPROM moved at the end only if all test have succeed
parent fd4ff714
......@@ -32,7 +32,8 @@ echo $serial >> serial.txt
extra_serial=$2
if [ x$2 = x"" ]; then
echo -n "If needed, input extra/batch serial number (i.e,S04) and press [ENTER], OR just press [ENTER]: "
batch_sn=$(cat ${SCRIPDIR}/test/fmcdio5chttla/serial_prefix.config | sed 's/.*\-\(S[0-9]*\)\-/\1/')
echo -n "If needed, input extra/batch serial number (i.e,$batch_sn) and press [ENTER], OR just press [ENTER]: "
read extra_serial
fi
......@@ -53,9 +54,8 @@ do
## Run the various test
sudo ./pts.py -b FMC-DIO-5chTTLa -s $serial -e $extra_serial -t./test/fmcdio5chttla/python -l $LOGDIR 00 01 02 03 04 05 06 07 08
ret=$?
## Write valid FRU in EEPROM
sudo ./test/fmcdio5chttla/python/test99_eeprom.py -s $serial -e $extra_serial -l $LOGDIR
if [ "$nb_test" != "$nb_test_limit" ]
then
......@@ -70,6 +70,15 @@ do
nb_test=$(($nb_test+1))
done
if [ "x$ret" = "x0" ]; then
echo "--------------------------------------------------------------"
echo "All Tests OK ! "
echo "Writing valid FRU in FMC EEPROM "
echo ""
sudo ./test/fmcdio5chttla/python/test99_eeprom.py -s $serial -e $extra_serial -l $LOGDIR
fi
echo "--------------------------------------------------------------"
echo " "
echo -n "End of the test, do you want to switch the computer OFF? [y,n]"
......
......@@ -307,6 +307,7 @@ class Suite(object):
log.close()
make_zip(zipfilename, ziplist)
return failures
def get_serial():
"""return serial number of current board to test
......@@ -487,7 +488,8 @@ def main():
elif options.cli:
s.cmdloop()
else:
s.run()
ret=s.run()
return len(ret)
if __name__ == '__main__':
main()
sys.exit(main())
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