From 3ad8c0a6c3bada062c43e990a01014714a7d81ac Mon Sep 17 00:00:00 2001 From: Arno Schoenmakers <schoenmakers@astron.nl> Date: Wed, 27 May 2009 11:15:10 +0000 Subject: [PATCH] Bug 1319: Yet another few changes --- .gitattributes | 1 + StationTest/gold/Makefile.am | 9 +- StationTest/subrackplustest.sh | 112 +++--- StationTest/subracktest.sh | 380 ++++++++++---------- StationTest/tbb_memory.sh | 62 ++-- StationTest/tbb_prbs_tester.sh | 96 ++--- StationTest/tbb_size.sh | 32 +- StationTest/tbb_version.sh | 32 +- StationTest/test/Makefile.am | 3 +- StationTest/test/envcontroltest/Makefile.am | 5 + 10 files changed, 368 insertions(+), 364 deletions(-) create mode 100644 StationTest/test/envcontroltest/Makefile.am diff --git a/.gitattributes b/.gitattributes index 9b904c2c99f..76053c5bf40 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1368,6 +1368,7 @@ StationTest/test/beamformertest/beamformertest_HBA_RCU96.sh -text StationTest/test/beamformertest/beamformertest_LBA_RCU192.sh -text StationTest/test/beamformertest/beamformertest_LBA_RCU96.sh -text StationTest/test/beamformertest/beamformertest_LBHLBL_RCU96.sh -text +StationTest/test/envcontroltest/Makefile.am -text StationTest/test/envcontroltest/power_ctrl.py -text StationTest/test/envcontroltest/tempctrl_V100.py -text StationTest/test/hbatest/Makefile.am -text diff --git a/StationTest/gold/Makefile.am b/StationTest/gold/Makefile.am index 46aa24695c7..26223749baa 100644 --- a/StationTest/gold/Makefile.am +++ b/StationTest/gold/Makefile.am @@ -1,9 +1,6 @@ testdir = $(prefix)/stationtest/gold -test_SCRIPTS = prbs_dir_test.gold \ - rsp_version.gold \ - tbb_version.gold \ - xst_160.gold \ - xst_200_even.gold \ - xst_200_odd.gold + +test_SCRIPTS = $(srcdir)/*.gold +test_SCRIPTS += $(srcdir)/*.m include $(top_srcdir)/Makefile.common diff --git a/StationTest/subrackplustest.sh b/StationTest/subrackplustest.sh index 72421aeea0e..cac50659d2b 100644 --- a/StationTest/subrackplustest.sh +++ b/StationTest/subrackplustest.sh @@ -1,56 +1,56 @@ -# !/bin/bash -# subrackplustest.sh, version 1.0, date 16-01-2009, M.J.Norden - - -#export PYTHONPATH=/home/lofartest/subracktest/modules - -######## definieeren en printen van de variabelen #################### -page=1 -tbbpage=1 -station=`hostname -s` -let rspboards=`sed -n 's/^\s*RS\.N_RSPBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf` -let tbboards=`sed -n 's/^\s*RS\.N_TBBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf` - -echo "This station is "$station -echo "The number of rspboards is "$rspboards -echo "The number of tbboards is "$tbboards -echo "The selected image page is "$page - -######## het resetten van RSP borden #################### -# in de nieuwe swlevel is dit niet meer nodig - -if [ $page != 0 ] ; then - for ((ind=0; ind < $rspboards; ind++)) do - MACadr=$(printf "10:FA:00:00:%02x:00" $ind) - sudo rsuctl3_reset -m $MACadr -p $page -x -q; - done - else - echo "When the RSP flash action was sucessful please" - echo "set page to page=0 and reset the RSP boards" - echo "with ./restart_images.sh" -fi - -######## het opstarten van de RSP en TBBDriver ########################### - -eval "swlevel 2" - -####### terwijl RSPDriver opstart, start image 1 op in de TBB borden ### - -if [ $tbbpage != 0 ] ; then - tbbctl --config=$tbbpage - else - echo "When the TBB flash action was sucessful please" - echo "set page to page=0 and reset the TBB boards" - echo "with ./restart_tbb.sh" -fi - -echo "wacht hier 50 seconden voor opstarten TBB en RSP borden" -sleep 50 - -######## het starten van de subrack test #################### -cd /opt/stationtest -python station_production.py -r $rspboards -t $tbboards - - - - +# !/bin/bash +# subrackplustest.sh, version 1.0, date 16-01-2009, M.J.Norden + + +#export PYTHONPATH=/home/lofartest/subracktest/modules + +######## definieeren en printen van de variabelen #################### +page=1 +tbbpage=1 +station=`hostname -s` +let rspboards=`sed -n 's/^\s*RS\.N_RSPBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf` +let tbboards=`sed -n 's/^\s*RS\.N_TBBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf` + +echo "This station is "$station +echo "The number of rspboards is "$rspboards +echo "The number of tbboards is "$tbboards +echo "The selected image page is "$page + +######## het resetten van RSP borden #################### +# in de nieuwe swlevel is dit niet meer nodig + +if [ $page != 0 ] ; then + for ((ind=0; ind < $rspboards; ind++)) do + MACadr=$(printf "10:FA:00:00:%02x:00" $ind) + sudo rsuctl3_reset -m $MACadr -p $page -x -q; + done + else + echo "When the RSP flash action was sucessful please" + echo "set page to page=0 and reset the RSP boards" + echo "with ./restart_images.sh" +fi + +######## het opstarten van de RSP en TBBDriver ########################### + +eval "swlevel 2" + +####### terwijl RSPDriver opstart, start image 1 op in de TBB borden ### + +if [ $tbbpage != 0 ] ; then + tbbctl --config=$tbbpage + else + echo "When the TBB flash action was sucessful please" + echo "set page to page=0 and reset the TBB boards" + echo "with ./restart_tbb.sh" +fi + +echo "wacht hier 50 seconden voor opstarten TBB en RSP borden" +sleep 50 + +######## het starten van de subrack test #################### +cd /opt/stationtest +python station_production.py -r $rspboards -t $tbboards + + + + diff --git a/StationTest/subracktest.sh b/StationTest/subracktest.sh index 2c2c6682637..58e720dc2de 100644 --- a/StationTest/subracktest.sh +++ b/StationTest/subracktest.sh @@ -1,190 +1,190 @@ -#!/bin/bash -# version 1.4, date 12-02-2009, M.J.Norden - - -#export PYTHONPATH=/home/lofartest/subracktest/modules - -######## vragen subrack, batchnr en serienr #################### -declare offset1 -declare offset2 -declare offset3 -declare offset4 - - -vraag1="welk subrack ga je testen [0, 1, 2, 3, 4, of 5] " -echo -n "$vraag1" -read subracknr - -vraag2="welk batchnummer staat er op het subrack " -echo -n "$vraag2" -read batchnr - -vraag3="welk serienummer staat er op het subrack " -echo -n "$vraag3" -read serienr - -case $subracknr in -[0]*) - offset1="00" - offset2="01" - offset3="02" - offset4="03" - ;; -[1]*) - offset1="04" - offset2="05" - offset3="06" - offset4="07" - ;; -[2]*) - offset1="08" - offset2="09" - offset3="0A" - offset4="0B" - ;; -[3]*) - offset1="0C" - offset2="0D" - offset3="0E" - offset4="0F" - ;; -[4]*) - offset1="10" - offset2="11" - offset3="12" - offset4="13" - ;; -[5]*) - offset1="14" - offset2="15" - offset3="16" - offset4="17" - ;; -esac -######## definieeren en printen van de variabelen #################### -page=1 -station=`hostname -s` -let rspboards=`sed -n 's/^\s*RS\.N_RSPBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf` -let tbboards=`sed -n 's/^\s*RS\.N_TBBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf` -bphexfile=/localhome/firmware/images/bp3b_v5_5.hex -aphexfile=/localhome/firmware/images/ap3b_v5_3.hex -tphexfile=/localhome/firmware/images/tp10_12.hex -mphexfile=/localhome/firmware/images/mp2_9.hex -mplphexfile=/localhome/firmware/images/mp_lp.hex - -echo "This station is "$station -echo "The number of rspboards is "$rspboards -echo "The number of tbboards is "$tbboards -echo "The selected image page is "$page -echo "Het subrack nummer= "$subracknr -echo "Het batch nummer= "$batchnr -echo "Het serie nummer= "$serienr -echo "The bp hex file is "$bphexfile -echo "The ap hex file is "$aphexfile -echo "The offset 1 is "$offset1 -echo "The offset 3 is "$offset3 - -######## het flashen en resetten van RSP borden #################### - -eval "swlevel 1" -for ((ind=$subracknr*4; ind < ($subracknr+1)*4; ind++)) do - MACadr=$(printf "10:FA:00:00:%02x:00" $ind) - #sudo rsuctl3 -w -q -p $page -b $bphexfile -a $aphexfile -m $MACadr -F - echo " rsp board = "$ind -done - -if [ $page != 0 ] ; then - for ((ind=$subracknr*4; ind < ($subracknr+1)*4; ind++)) do - MACadr=$(printf "10:FA:00:00:%02x:00" $ind) - sudo rsuctl3_reset -m $MACadr -p $page -x -q; - #echo " rsp board = "$ind - done - else - echo "When the RSP flash action was sucessful please" - echo "set page to page=0 and reset the RSP boards" - echo "with ./restart_images.sh" -fi - -######## het aanpassen van RSPDriver.conf ######################### - -sed -i "s/MAC_ADDR_0=10:FA:00:00:..:00/MAC_ADDR_0=10:FA:00:00:$offset1:00/g" /opt/lofar/etc/RSPDriver.conf -sed -i "s/MAC_ADDR_1=10:FA:00:00:..:00/MAC_ADDR_1=10:FA:00:00:$offset2:00/g" /opt/lofar/etc/RSPDriver.conf -sed -i "s/MAC_ADDR_2=10:FA:00:00:..:00/MAC_ADDR_2=10:FA:00:00:$offset3:00/g" /opt/lofar/etc/RSPDriver.conf -sed -i "s/MAC_ADDR_3=10:FA:00:00:..:00/MAC_ADDR_3=10:FA:00:00:$offset4:00/g" /opt/lofar/etc/RSPDriver.conf - -######## het aanpassen van TBBDriver.conf ######################### - -sed -i "s/MAC_ADDR_0=10:FA:00:00:..:02/MAC_ADDR_0=10:FA:00:00:$offset1:02/g" /opt/lofar/etc/TBBDriver.conf -sed -i "s/MAC_ADDR_1=10:FA:00:00:..:02/MAC_ADDR_1=10:FA:00:00:$offset3:02/g" /opt/lofar/etc/TBBDriver.conf - -let bn0=$subracknr*2 -let bn1=$bn0+1 -let bn2=$bn0*2 -let bn3=$bn1*2 - -sed -i "s/MAC_ADDR_$bn0=10:FA:00:00:..:02/MAC_ADDR_$bn0=10:FA:00:00:00:02/g" /opt/lofar/etc/TBBDriver.conf -sed -i "s/MAC_ADDR_$bn1=10:FA:00:00:..:02/MAC_ADDR_$bn1=10:FA:00:00:02:02/g" /opt/lofar/etc/TBBDriver.conf - -######## het opstarten van de TBBDriver ########################### - -sed -i "s/2:u:d:r::RSPDriver/#2:u:d:r::RSPDriver/g" /opt/lofar/etc/swlevel.conf - -eval "swlevel 2" - -echo "wacht even 50 seconden voor het opstarten van de TBB borden" -sleep 50 - -######## het flashen en resetten van TBB borden #################### - -if [ $tbboards != 0 ] ; then -tbbctl --writeimage=0,$page,3.2,$tphexfile,$mphexfile -tbbctl --writeimage=1,$page,3.2,$tphexfile,$mphexfile -tbbctl --writeimage=0,0,3.0,$tphexfile,$mplphexfile -tbbctl --writeimage=1,0,3.0,$tphexfile,$mplphexfile - -######## het opstarten van de RSPDriver en TBBDriver ############### - - -sed -i "s/#2:u:d:r::RSPDriver/2:u:d:r::RSPDriver/g" /opt/lofar/etc/swlevel.conf -sed -i "s/##2:u:d:r::RSPDriver/2:u:d:r::RSPDriver/g" /opt/lofar/etc/swlevel.conf - -eval "swlevel 2" - -######## het terugzetten van TBBDriver.conf ######################### - -sed -i "s/MAC_ADDR_0=10:FA:00:00:..:00/MAC_ADDR_0=10:FA:00:00:00:00/g" /opt/lofar/etc/RSPDriver.conf -sed -i "s/MAC_ADDR_1=10:FA:00:00:..:00/MAC_ADDR_1=10:FA:00:00:01:00/g" /opt/lofar/etc/RSPDriver.conf -sed -i "s/MAC_ADDR_2=10:FA:00:00:..:00/MAC_ADDR_2=10:FA:00:00:02:00/g" /opt/lofar/etc/RSPDriver.conf -sed -i "s/MAC_ADDR_3=10:FA:00:00:..:00/MAC_ADDR_3=10:FA:00:00:03:00/g" /opt/lofar/etc/RSPDriver.conf - -sed -i "s/MAC_ADDR_0=10:FA:00:00:..:02/MAC_ADDR_0=10:FA:00:00:00:02/g" /opt/lofar/etc/TBBDriver.conf -sed -i "s/MAC_ADDR_1=10:FA:00:00:..:02/MAC_ADDR_1=10:FA:00:00:02:02/g" /opt/lofar/etc/TBBDriver.conf - -sed -i "s/MAC_ADDR_$bn0=10:FA:00:00:..:02/MAC_ADDR_$bn0=10:FA:00:00:$offset1:02/g" /opt/lofar/etc/TBBDriver.conf -sed -i "s/MAC_ADDR_$bn1=10:FA:00:00:..:02/MAC_ADDR_$bn1=10:FA:00:00:$offset3:02/g" /opt/lofar/etc/TBBDriver.conf - -######### het setten van de juiste ID in tbb_version.gold ##################### -sed -i "s/0.......V/0 $bn2 V/g" /opt/stationtest/gold/tbb_version.gold -sed -i "s/1.......V/1 $bn3 V/g" /opt/stationtest/gold/tbb_version.gold - -####### terwijl RSPDriver opstart, start image 1 op in de TBB borden ### - -if [ $page != 0 ] ; then - tbbctl --config=$page - #tbbctl --config=9 --sel=0,1 - else - echo "When the TBB flash action was sucessful please" - echo "set page to page=0 and reset the TBB boards" - echo "with ./restart_tbb.sh" -fi - -else - echo "No TBB boards are placed in the SUBRACK" -fi - -echo "wacht hier 50 seconden voor opstarten TBB en RSP borden" -sleep 50 - -######## het starten van de subrack test #################### -python subrack_production.py -b $batchnr -s $serienr - +#!/bin/bash +# version 1.4, date 12-02-2009, M.J.Norden + + +#export PYTHONPATH=/home/lofartest/subracktest/modules + +######## vragen subrack, batchnr en serienr #################### +declare offset1 +declare offset2 +declare offset3 +declare offset4 + + +vraag1="welk subrack ga je testen [0, 1, 2, 3, 4, of 5] " +echo -n "$vraag1" +read subracknr + +vraag2="welk batchnummer staat er op het subrack " +echo -n "$vraag2" +read batchnr + +vraag3="welk serienummer staat er op het subrack " +echo -n "$vraag3" +read serienr + +case $subracknr in +[0]*) + offset1="00" + offset2="01" + offset3="02" + offset4="03" + ;; +[1]*) + offset1="04" + offset2="05" + offset3="06" + offset4="07" + ;; +[2]*) + offset1="08" + offset2="09" + offset3="0A" + offset4="0B" + ;; +[3]*) + offset1="0C" + offset2="0D" + offset3="0E" + offset4="0F" + ;; +[4]*) + offset1="10" + offset2="11" + offset3="12" + offset4="13" + ;; +[5]*) + offset1="14" + offset2="15" + offset3="16" + offset4="17" + ;; +esac +######## definieeren en printen van de variabelen #################### +page=1 +station=`hostname -s` +let rspboards=`sed -n 's/^\s*RS\.N_RSPBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf` +let tbboards=`sed -n 's/^\s*RS\.N_TBBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf` +bphexfile=/localhome/firmware/images/bp3b_v5_5.hex +aphexfile=/localhome/firmware/images/ap3b_v5_3.hex +tphexfile=/localhome/firmware/images/tp10_12.hex +mphexfile=/localhome/firmware/images/mp2_9.hex +mplphexfile=/localhome/firmware/images/mp_lp.hex + +echo "This station is "$station +echo "The number of rspboards is "$rspboards +echo "The number of tbboards is "$tbboards +echo "The selected image page is "$page +echo "Het subrack nummer= "$subracknr +echo "Het batch nummer= "$batchnr +echo "Het serie nummer= "$serienr +echo "The bp hex file is "$bphexfile +echo "The ap hex file is "$aphexfile +echo "The offset 1 is "$offset1 +echo "The offset 3 is "$offset3 + +######## het flashen en resetten van RSP borden #################### + +eval "swlevel 1" +for ((ind=$subracknr*4; ind < ($subracknr+1)*4; ind++)) do + MACadr=$(printf "10:FA:00:00:%02x:00" $ind) + #sudo rsuctl3 -w -q -p $page -b $bphexfile -a $aphexfile -m $MACadr -F + echo " rsp board = "$ind +done + +if [ $page != 0 ] ; then + for ((ind=$subracknr*4; ind < ($subracknr+1)*4; ind++)) do + MACadr=$(printf "10:FA:00:00:%02x:00" $ind) + sudo rsuctl3_reset -m $MACadr -p $page -x -q; + #echo " rsp board = "$ind + done + else + echo "When the RSP flash action was sucessful please" + echo "set page to page=0 and reset the RSP boards" + echo "with ./restart_images.sh" +fi + +######## het aanpassen van RSPDriver.conf ######################### + +sed -i "s/MAC_ADDR_0=10:FA:00:00:..:00/MAC_ADDR_0=10:FA:00:00:$offset1:00/g" /opt/lofar/etc/RSPDriver.conf +sed -i "s/MAC_ADDR_1=10:FA:00:00:..:00/MAC_ADDR_1=10:FA:00:00:$offset2:00/g" /opt/lofar/etc/RSPDriver.conf +sed -i "s/MAC_ADDR_2=10:FA:00:00:..:00/MAC_ADDR_2=10:FA:00:00:$offset3:00/g" /opt/lofar/etc/RSPDriver.conf +sed -i "s/MAC_ADDR_3=10:FA:00:00:..:00/MAC_ADDR_3=10:FA:00:00:$offset4:00/g" /opt/lofar/etc/RSPDriver.conf + +######## het aanpassen van TBBDriver.conf ######################### + +sed -i "s/MAC_ADDR_0=10:FA:00:00:..:02/MAC_ADDR_0=10:FA:00:00:$offset1:02/g" /opt/lofar/etc/TBBDriver.conf +sed -i "s/MAC_ADDR_1=10:FA:00:00:..:02/MAC_ADDR_1=10:FA:00:00:$offset3:02/g" /opt/lofar/etc/TBBDriver.conf + +let bn0=$subracknr*2 +let bn1=$bn0+1 +let bn2=$bn0*2 +let bn3=$bn1*2 + +sed -i "s/MAC_ADDR_$bn0=10:FA:00:00:..:02/MAC_ADDR_$bn0=10:FA:00:00:00:02/g" /opt/lofar/etc/TBBDriver.conf +sed -i "s/MAC_ADDR_$bn1=10:FA:00:00:..:02/MAC_ADDR_$bn1=10:FA:00:00:02:02/g" /opt/lofar/etc/TBBDriver.conf + +######## het opstarten van de TBBDriver ########################### + +sed -i "s/2:u:d:r::RSPDriver/#2:u:d:r::RSPDriver/g" /opt/lofar/etc/swlevel.conf + +eval "swlevel 2" + +echo "wacht even 50 seconden voor het opstarten van de TBB borden" +sleep 50 + +######## het flashen en resetten van TBB borden #################### + +if [ $tbboards != 0 ] ; then +tbbctl --writeimage=0,$page,3.2,$tphexfile,$mphexfile +tbbctl --writeimage=1,$page,3.2,$tphexfile,$mphexfile +tbbctl --writeimage=0,0,3.0,$tphexfile,$mplphexfile +tbbctl --writeimage=1,0,3.0,$tphexfile,$mplphexfile + +######## het opstarten van de RSPDriver en TBBDriver ############### + + +sed -i "s/#2:u:d:r::RSPDriver/2:u:d:r::RSPDriver/g" /opt/lofar/etc/swlevel.conf +sed -i "s/##2:u:d:r::RSPDriver/2:u:d:r::RSPDriver/g" /opt/lofar/etc/swlevel.conf + +eval "swlevel 2" + +######## het terugzetten van TBBDriver.conf ######################### + +sed -i "s/MAC_ADDR_0=10:FA:00:00:..:00/MAC_ADDR_0=10:FA:00:00:00:00/g" /opt/lofar/etc/RSPDriver.conf +sed -i "s/MAC_ADDR_1=10:FA:00:00:..:00/MAC_ADDR_1=10:FA:00:00:01:00/g" /opt/lofar/etc/RSPDriver.conf +sed -i "s/MAC_ADDR_2=10:FA:00:00:..:00/MAC_ADDR_2=10:FA:00:00:02:00/g" /opt/lofar/etc/RSPDriver.conf +sed -i "s/MAC_ADDR_3=10:FA:00:00:..:00/MAC_ADDR_3=10:FA:00:00:03:00/g" /opt/lofar/etc/RSPDriver.conf + +sed -i "s/MAC_ADDR_0=10:FA:00:00:..:02/MAC_ADDR_0=10:FA:00:00:00:02/g" /opt/lofar/etc/TBBDriver.conf +sed -i "s/MAC_ADDR_1=10:FA:00:00:..:02/MAC_ADDR_1=10:FA:00:00:02:02/g" /opt/lofar/etc/TBBDriver.conf + +sed -i "s/MAC_ADDR_$bn0=10:FA:00:00:..:02/MAC_ADDR_$bn0=10:FA:00:00:$offset1:02/g" /opt/lofar/etc/TBBDriver.conf +sed -i "s/MAC_ADDR_$bn1=10:FA:00:00:..:02/MAC_ADDR_$bn1=10:FA:00:00:$offset3:02/g" /opt/lofar/etc/TBBDriver.conf + +######### het setten van de juiste ID in tbb_version.gold ##################### +sed -i "s/0.......V/0 $bn2 V/g" /opt/stationtest/gold/tbb_version.gold +sed -i "s/1.......V/1 $bn3 V/g" /opt/stationtest/gold/tbb_version.gold + +####### terwijl RSPDriver opstart, start image 1 op in de TBB borden ### + +if [ $page != 0 ] ; then + tbbctl --config=$page + #tbbctl --config=9 --sel=0,1 + else + echo "When the TBB flash action was sucessful please" + echo "set page to page=0 and reset the TBB boards" + echo "with ./restart_tbb.sh" +fi + +else + echo "No TBB boards are placed in the SUBRACK" +fi + +echo "wacht hier 50 seconden voor opstarten TBB en RSP borden" +sleep 50 + +######## het starten van de subrack test #################### +python subrack_production.py -b $batchnr -s $serienr + diff --git a/StationTest/tbb_memory.sh b/StationTest/tbb_memory.sh index 15254ce18e7..fcd0f60a6ff 100644 --- a/StationTest/tbb_memory.sh +++ b/StationTest/tbb_memory.sh @@ -1,31 +1,31 @@ -#!/bin/bash - -# -# Get version info from the TBB boards and compare this with the expected golden result. -# - -rm -f tbb_memory*.log -rm -f tbb_memory*.diff - -if [ -e /opt/lofar/etc/RemoteStation.conf ]; then - let tbboards=`sed -n 's/^\s*RS\.N_TBBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf` -else - echo "Could not find /opt/lofar/etc/RemoteStation.conf" - exit 1 -fi - - -for ((ind=0; ind < $tbboards; ind++)) do - tbbctl --testddr=$ind > tbb_memory$ind.log - done - -for ((ind=0; ind < $tbboards; ind++)) do - diff tbb_memory$ind.log gold/tbb_memory$ind.gold > tbb_memory$ind.diff - if [ -e tbb_memory$ind.log ] && [ -e gold/tbb_memory$ind.gold ] && [ -e tbb_memory$ind.diff ] && ! [ -s tbb_memory$ind.diff ]; then - # The files exists AND has the diff size 0 - echo "TBB memory ($ind) test went OK" - else - echo "TBB memory ($ind) test went wrong" - fi - done - +#!/bin/bash + +# +# Get version info from the TBB boards and compare this with the expected golden result. +# + +rm -f tbb_memory*.log +rm -f tbb_memory*.diff + +if [ -e /opt/lofar/etc/RemoteStation.conf ]; then + let tbboards=`sed -n 's/^\s*RS\.N_TBBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf` +else + echo "Could not find /opt/lofar/etc/RemoteStation.conf" + exit 1 +fi + + +for ((ind=0; ind < $tbboards; ind++)) do + tbbctl --testddr=$ind > tbb_memory$ind.log + done + +for ((ind=0; ind < $tbboards; ind++)) do + diff tbb_memory$ind.log gold/tbb_memory$ind.gold > tbb_memory$ind.diff + if [ -e tbb_memory$ind.log ] && [ -e gold/tbb_memory$ind.gold ] && [ -e tbb_memory$ind.diff ] && ! [ -s tbb_memory$ind.diff ]; then + # The files exists AND has the diff size 0 + echo "TBB memory ($ind) test went OK" + else + echo "TBB memory ($ind) test went wrong" + fi + done + diff --git a/StationTest/tbb_prbs_tester.sh b/StationTest/tbb_prbs_tester.sh index 5b30e1022d0..df1addc5716 100644 --- a/StationTest/tbb_prbs_tester.sh +++ b/StationTest/tbb_prbs_tester.sh @@ -1,48 +1,48 @@ -#!/bin/bash - -# -# Test the LVDS interfaces between RCU -> RSP -> TBB using the Pseudo Random generator in the RCUs. -# - -let rspboards=`sed -n 's/^\s*RS\.N_RSPBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf` -let nof_rcu=8*$rspboards - -rm -f *.log -rm -f *.diff -rm -f ./prbs/*.* - - -# Set up RCU and RSP, make sure waveform generator is off -rspctl --rcuprsg=1 -sleep 1 -rspctl --tbbmode=transient - -sleep 5 -# set up TBB -nof_slices=10 # one slice contains 1024 transient (raw data) samples - -tbbctl --free -tbbctl --alloc -tbbctl --rec - -sleep 0.1 - -# Freeze and get the captured data from TBB -cd ./prbs -tbbctl --stop -for ((i = 0; i < $nof_rcu; i++)) do - tbbctl --readpage=$i,0,$nof_slices -done -cd .. -# Verify the PRBS -python prbs_dir_test.py - - -echo "" -diff prbs_dir_test.log ./gold/prbs_dir_test.gold > prbs_dir_test.diff -if [ -e prbs_dir_test.log ] && [ -e ./gold/prbs_dir_test.gold ] && [ -e prbs_dir_test.diff ] && ! [ -s prbs_dir_test.diff ]; then - # The files exists AND has the diff size 0 - echo "RCU -> RSP -> TBB interfaces test went OK" -else - echo "RCU -> RSP -> TBB interfaces test went wrong" -fi +#!/bin/bash + +# +# Test the LVDS interfaces between RCU -> RSP -> TBB using the Pseudo Random generator in the RCUs. +# + +let rspboards=`sed -n 's/^\s*RS\.N_RSPBOARDS\s*=\s*\([0-9][0-9]*\).*$/\1/p' /opt/lofar/etc/RemoteStation.conf` +let nof_rcu=8*$rspboards + +rm -f *.log +rm -f *.diff +rm -f ./prbs/*.* + + +# Set up RCU and RSP, make sure waveform generator is off +rspctl --rcuprsg=1 +sleep 1 +rspctl --tbbmode=transient + +sleep 5 +# set up TBB +nof_slices=10 # one slice contains 1024 transient (raw data) samples + +tbbctl --free +tbbctl --alloc +tbbctl --rec + +sleep 0.1 + +# Freeze and get the captured data from TBB +cd ./prbs +tbbctl --stop +for ((i = 0; i < $nof_rcu; i++)) do + tbbctl --readpage=$i,0,$nof_slices +done +cd .. +# Verify the PRBS +python prbs_dir_test.py + + +echo "" +diff prbs_dir_test.log ./gold/prbs_dir_test.gold > prbs_dir_test.diff +if [ -e prbs_dir_test.log ] && [ -e ./gold/prbs_dir_test.gold ] && [ -e prbs_dir_test.diff ] && ! [ -s prbs_dir_test.diff ]; then + # The files exists AND has the diff size 0 + echo "RCU -> RSP -> TBB interfaces test went OK" +else + echo "RCU -> RSP -> TBB interfaces test went wrong" +fi diff --git a/StationTest/tbb_size.sh b/StationTest/tbb_size.sh index 89950d40c88..bb54250a43a 100644 --- a/StationTest/tbb_size.sh +++ b/StationTest/tbb_size.sh @@ -1,16 +1,16 @@ -#!/bin/bash - -# -# Get version info from the TBB boards and compare this with the expected golden result. -# - -rm -f tbb_size.log -rm -f tbb_size.diff -tbbctl --size > tbb_size.log -diff tbb_size.log gold/tbb_size.gold > tbb_size.diff -if [ -e tbb_size.log ] && [ -e gold/tbb_size.gold ] && [ -e tbb_size.diff ] && ! [ -s tbb_size.diff ]; then - # The files exists AND has the diff size 0 - echo "TBB memory size test went OK" -else - echo "TBB memory size test went wrong" -fi +#!/bin/bash + +# +# Get version info from the TBB boards and compare this with the expected golden result. +# + +rm -f tbb_size.log +rm -f tbb_size.diff +tbbctl --size > tbb_size.log +diff tbb_size.log gold/tbb_size.gold > tbb_size.diff +if [ -e tbb_size.log ] && [ -e gold/tbb_size.gold ] && [ -e tbb_size.diff ] && ! [ -s tbb_size.diff ]; then + # The files exists AND has the diff size 0 + echo "TBB memory size test went OK" +else + echo "TBB memory size test went wrong" +fi diff --git a/StationTest/tbb_version.sh b/StationTest/tbb_version.sh index 3f8e8063442..0295338c4e8 100644 --- a/StationTest/tbb_version.sh +++ b/StationTest/tbb_version.sh @@ -1,16 +1,16 @@ -#!/bin/bash - -# -# Get version info from the TBB boards and compare this with the expected golden result. -# - -rm -f tbb_version.log -rm -f tbb_version.diff -tbbctl --version > tbb_version.log -diff tbb_version.log gold/tbb_version.gold > tbb_version.diff -if [ -e tbb_version.log ] && [ -e gold/tbb_version.gold ] && [ -e tbb_version.diff ] && ! [ -s tbb_version.diff ]; then - # The files exists AND has the diff size 0 - echo "TBB version test went OK" -else - echo "TBB version test went wrong" -fi +#!/bin/bash + +# +# Get version info from the TBB boards and compare this with the expected golden result. +# + +rm -f tbb_version.log +rm -f tbb_version.diff +tbbctl --version > tbb_version.log +diff tbb_version.log gold/tbb_version.gold > tbb_version.diff +if [ -e tbb_version.log ] && [ -e gold/tbb_version.gold ] && [ -e tbb_version.diff ] && ! [ -s tbb_version.diff ]; then + # The files exists AND has the diff size 0 + echo "TBB version test went OK" +else + echo "TBB version test went wrong" +fi diff --git a/StationTest/test/Makefile.am b/StationTest/test/Makefile.am index 3e5492f55f0..6a781a30143 100644 --- a/StationTest/test/Makefile.am +++ b/StationTest/test/Makefile.am @@ -1,3 +1,4 @@ -SUBDIRS = beamformertest hbatest hbatest/gold subbandstatistics systemnoise timing xcstatistics +SUBDIRS = beamformertest hbatest hbatest/gold subbandstatistics \ + systemnoise timing xcstatistics envcontroltest include $(top_srcdir)/Makefile.common diff --git a/StationTest/test/envcontroltest/Makefile.am b/StationTest/test/envcontroltest/Makefile.am new file mode 100644 index 00000000000..200e0b31f37 --- /dev/null +++ b/StationTest/test/envcontroltest/Makefile.am @@ -0,0 +1,5 @@ +testdir = $(prefix)/stationtest/envcontroltest + +test_SCRIPTS = $(srcdir)/*.py + +include $(top_srcdir)/Makefile.common -- GitLab