fmcadc100m14b4cha.sh 1.51 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/bin/sh

# Copyright CERN, 2011
# Author: Matthieu Cattin <matthieu.cattin@cern.ch>
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org

LOGDIR=./log_fmcadc100m14b4cha

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

serial=$1
if [ x$1 = x"" ]; then
Matthieu Cattin's avatar
Matthieu Cattin committed
15
	echo -n "Please scan CERN serial number bar-code, then press [ENTER]: "
16 17 18 19 20 21 22
        read serial
fi

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

23
if [ -e serial.txt ]; then
24
    sudo rm -f serial.txt
25 26 27 28
fi

echo $serial >> serial.txt

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

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

39 40
echo " "

41 42 43 44 45 46 47
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"
48
    echo " "
49

50
    sudo ./pts/pts.py -b FmcAdc100M14b4cha -s $serial -e $extra_serial -t ./tests -l $LOGDIR 00 01 02 03 04 05 06 07 08 09 22 19 23 47 25
51 52 53 54 55 56 57 58 59 60 61

    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
62
    nb_test=$(($nb_test+1))
63 64 65 66
done

echo "--------------------------------------------------------------"
echo " "
Matthieu Cattin's avatar
Matthieu Cattin committed
67
echo -n "End of the test, do you want to switch the computer OFF? [y,n]"
68
read reply
Matthieu Cattin's avatar
Matthieu Cattin committed
69
if [ "$reply" = "y" ]
70
then
71
    sudo shutdown -h now
72
fi