Skip to content
Snippets Groups Projects

reduce orbit trailer size to 512 to be compatible with new firmware

Merged Thomas Owen James requested to merge patch-orbit_trailer_size-512 into main
Compare and
9 files
+ 50
28
Compare changes
  • Side-by-side
  • Inline
Files
9
+ 45
22
#!/bin/bash
function scdaq_test {
echo "Starting scdaq test with GMT P5 capture file: check for crash"
timeout 10s src/scdaq --config test/config/scdaq-gmt.conf | uniq -uc
GMTRET="${PIPESTATUS[0]}"
echo "#############################################################################"
echo "Starting scdaq test with CALO P5 capture file: check for crash"
timeout 10s src/scdaq --config test/config/scdaq-calo.conf | uniq -uc
CALORET="${PIPESTATUS[0]}"
if [[ "$GMTRET" -ne 124 ]]; then # We expect to fail with a timeout because scdaq isn't supposed to return.
echo "SCDAQ test for GMT failed with exit code ${GMTRET}!"
GMT_FAILED=true
elif [ $(find test/data -name "*scout_GMT*" | wc -l) -eq 0 ] && [ $OUTPUT_EXPECTED = "true" ]; then
echo "SCDAQ test for GMT failed, no output files found!"
GMT_FAILED=true
fi
if [[ "$CALORET" -ne 124 ]]; then # We expect to fail with a timeout because scdaq isn't supposed to return.
echo "SCDAQ test for CALO failed with exit code ${CALORET}!"
CALO_FAILED=true
elif [ $(find test/data -name "*scout_CALO*" | wc -l) -eq 0 ] && [ $OUTPUT_EXPECTED = "true" ]; then
echo "SCDAQ test for CALO failed, no output files found!"
CALO_FAILED=true
fi
}
echo "building scdaq locally"
cd src
make all
cd -
echo "building scdaq locally"
cd test/data
tar -xzvf calo_testfile.tar.gz
tar -xzvf gmt_testfile.tar.gz
cd ../../
echo "Starting scdaq test with GMT P5 capture file: check for crash"
timeout 20s src/scdaq --config test/config/scdaq-gmt.conf | uniq
GMTRET="${PIPESTATUS[0]}"
echo "#############################################################################"
echo "Starting scdaq test with CALO P5 capture file: check for crash"
timeout 60s src/scdaq --config test/config/scdaq-calo.conf | uniq
CALORET="${PIPESTATUS[0]}"
if [[ "$GMTRET" -ne 124 ]]; then # We expect to fail with a timeout because scdaq isn't supposed to return.
echo "SCDAQ test for GMT failed with exit code ${GMTRET}!"
GMT_FAILED=true
elif [[ $(find test/data -name "*scout_GMT*" | wc -l) -eq 0 ]]; then
echo "SCDAQ test for GMT failed, no output files found!"
GMT_FAILED=true
fi
if [[ "$CALORET" -ne 124 ]]; then # We expect to fail with a timeout because scdaq isn't supposed to return.
echo "SCDAQ test for CALO failed with exit code ${CALORET}!"
CALO_FAILED=true
elif [[ $(find test/data -name "*scout_CALO*" | wc -l) -eq 0 ]]; then
echo "SCDAQ test for CALO failed, no output files found!"
CALO_FAILED=true
fi
OUTPUT_EXPECTED=false
scdaq_test
echo "Starting second set of test files"
echo $GMT_FAILED
echo $CALO_FAILED
OUTPUT_EXPECTED=true
cd test/data
rm calo_testfile.dat
rm gmt_testfile.dat
tar -xzvf calo_testfile_mod.tar.gz
tar -xzvf gmt_testfile_mod.tar.gz
rm ../test/data/run000000/in_progress/*
cd ../../
#next line needed because older GMT files were taken with 5 orbits per packet
sed -i 's/nOrbitsPerPacket:1/nOrbitsPerPacket:5/' test/config/scdaq-gmt.conf
scdaq_test
echo $GMT_FAILED
echo $CALO_FAILED
if [[ $GMT_FAILED = true || $CALO_FAILED = true ]]; then
exit 1
Loading