fmcdio5chttla.sh 1.61 KB
Newer Older
1 2
#!/bin/sh

3 4 5 6 7
# Copyright CERN, 2012 (Seven Solutions S.L.)
# Author: Richard Carrillo <rcarrillo(AT)sevensols.com>
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
# Website: http://www.sevensols.com
8
# Version: 1.0 (Last modifications: 29/4/2012)
9 10

LOGDIR=./log_fmcdio5chttla
11 12 13 14 15 16

mkdir -p $LOGDIR
sudo rm -fr $LOGDIR/pts*

serial=$1
if [ x$1 = x"" ]; then
17
	echo -n "Please scan CERN serial number bar-code, then press [ENTER]: "
18 19 20
        read serial
fi

21 22 23 24 25 26 27 28 29 30
if [ x$serial = x"" ]; then
	serial=0000
fi

if [ -e serial.txt ]; then
    sudo rm -f serial.txt
fi

echo $serial >> serial.txt

31 32
extra_serial=$2
if [ x$2 = x"" ]; then
33
	echo -n "If needed, input extra serial number and press [ENTER], OR just press [ENTER]: "
34 35 36 37 38 39 40
        read extra_serial
fi

if [ x$extra_serial = x"" ]; then
	extra_serial=0000
fi

41 42 43 44 45 46 47 48 49 50 51
echo " "

nb_test_limit=2
nb_test=1

while [ "$nb_test" -le "$nb_test_limit" ]
do
    echo "--------------------------------------------------------------"
    echo "Test series run $nb_test out of $nb_test_limit"
    echo " "

52
    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
53 54 55 56 57 58 59 60 61 62 63 64 65 66

    if [ "$nb_test" != "$nb_test_limit" ]
    then
        echo " "
        echo -n "Do you want to run the test series again [y,n]? "
        read reply
        if [ "$reply" != "y" ]
        then
            break
        fi
    fi
    nb_test=$(($nb_test+1))
done

67
echo "--------------------------------------------------------------"
68 69 70 71 72 73 74
echo " "
echo -n "End of the test, do you want to switch the computer OFF? [y,n]"
read reply
if [ "$reply" = "y" ]
then
    sudo halt
fi
75 76 77