diff --git a/.gitattributes b/.gitattributes index b51b22aed8f703afb1699326c9cb24e5e4894a90..a23636578fab28a74e15a4c9ecbdf5f970c4b70b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4624,6 +4624,7 @@ SubSystems/Online_Cobalt/test/Correlator/tCorrelate_3sec_2st_5sb.sh eol=lf SubSystems/Online_Cobalt/test/tMACfeedback.in_parset_failure_1 -text SubSystems/Online_Cobalt/test/tMACfeedback.in_parset_success_1 -text SubSystems/Online_Cobalt/test/tMACfeedback.run eol=lf +SubSystems/Online_Cobalt/test/tMACfeedback.run2.in eol=lf SubSystems/Online_Cobalt/test/tMACfeedback.sh eol=lf SubSystems/Online_Cobalt/test/tProductionParsets.in_parsets/CorrProc_173014.param -text SubSystems/Online_Cobalt/test/tProductionParsets.in_parsets/CorrProc_196344-CygAf009-225SAPS.cleaned.param -text diff --git a/SubSystems/Online_Cobalt/test/CMakeLists.txt b/SubSystems/Online_Cobalt/test/CMakeLists.txt index 67349fe148aef60bc99695d5d8e3cb4144023d35..46058d676cdfe70dabbb7e38a38e22e2e49bbafd 100644 --- a/SubSystems/Online_Cobalt/test/CMakeLists.txt +++ b/SubSystems/Online_Cobalt/test/CMakeLists.txt @@ -2,10 +2,10 @@ include(LofarCTest) -foreach(_file testFuncs runtest) +foreach(_file testFuncs.sh runtest.sh tMACfeedback.run2) configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/${_file}.sh.in - ${CMAKE_CURRENT_BINARY_DIR}/${_file}.sh @ONLY) + ${CMAKE_CURRENT_SOURCE_DIR}/${_file}.in + ${CMAKE_CURRENT_BINARY_DIR}/${_file} @ONLY) endforeach() set(_tests diff --git a/SubSystems/Online_Cobalt/test/tMACfeedback.run b/SubSystems/Online_Cobalt/test/tMACfeedback.run index 7d601ff1b37952b085f8ff105a783787a1fb2a5c..7727306af7f98b7228a527cae02e8a10bdcda76f 100755 --- a/SubSystems/Online_Cobalt/test/tMACfeedback.run +++ b/SubSystems/Online_Cobalt/test/tMACfeedback.run @@ -1,35 +1,2 @@ -#!/bin/bash - -. ./testFuncs.sh - -function test_parset { - PARSET="$1" - EXPECTED_OBSRESULT="$2" - EXTRA_PARAMS="$3" - - echo "Testing $PARSET, expecting result $EXPECTED_OBSRESULT" - - # Add the connection information for this test - echo "Cobalt.FinalMetaDataGatherer.host=localhost" >> $PARSET - - # Run the observation - runObservation.sh -B -C -l 1 $EXTRA_PARAMS $PARSET - OBSRESULT=$? - - if [ $OBSRESULT -ne $EXPECTED_OBSRESULT ]; then - echo "runObservation.sh failed (status: $OBSRESULT)" - exit 1 - fi - - # Pull the message from the status queue - qpid-receive -b 127.0.0.1 -q lofar.task.feedback.status || error 'Could not pull status message from bus' - - # Check the message against the expected result - # <TODO> -} - -test_parset $PWD/tMACfeedback.in_parset_success_1 0 "" -test_parset $PWD/tMACfeedback.in_parset_failure_1 1 "-o Cobalt.Nodes=[unreachable]" - -# Everything went ok -exit 0 +#!/bin/sh +./tMACfeedback.run2 diff --git a/SubSystems/Online_Cobalt/test/tMACfeedback.run2.in b/SubSystems/Online_Cobalt/test/tMACfeedback.run2.in new file mode 100755 index 0000000000000000000000000000000000000000..d268671a353beb245db82082e408a7ace5e38383 --- /dev/null +++ b/SubSystems/Online_Cobalt/test/tMACfeedback.run2.in @@ -0,0 +1,35 @@ +#!/bin/bash + +. ./testFuncs.sh + +function test_parset { + PARSET="$1" + EXPECTED_OBSRESULT="$2" + EXTRA_PARAMS="$3" + + echo "Testing $PARSET, expecting result $EXPECTED_OBSRESULT" + + # Add the connection information for this test + echo "Cobalt.FinalMetaDataGatherer.host=localhost" >> $PARSET + + # Run the observation + runObservation.sh -B -C -l 1 $EXTRA_PARAMS $PARSET + OBSRESULT=$? + + if [ $OBSRESULT -ne $EXPECTED_OBSRESULT ]; then + echo "runObservation.sh failed (status: $OBSRESULT)" + exit 1 + fi + + # Pull the message from the status queue + @QPID_RECEIVE_EXECUTABLE@ -b 127.0.0.1 -q lofar.task.feedback.status || error 'Could not pull status message from bus' + + # Check the message against the expected result + # <TODO> +} + +test_parset $PWD/tMACfeedback.in_parset_success_1 0 "" +test_parset $PWD/tMACfeedback.in_parset_failure_1 1 "-o Cobalt.Nodes=[unreachable]" + +# Everything went ok +exit 0