From 2078b3ae0994063909c995db03232010baffeafd Mon Sep 17 00:00:00 2001 From: Gary Yendell Date: Mon, 2 May 2022 18:54:17 +0100 Subject: [PATCH 01/10] Increase logging in GitHub actions unit tests --- .github/workflows/test_odin_data.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_odin_data.yml b/.github/workflows/test_odin_data.yml index a60016a9..5a938b1e 100644 --- a/.github/workflows/test_odin_data.yml +++ b/.github/workflows/test_odin_data.yml @@ -34,13 +34,13 @@ jobs: INSTALL_PREFIX: ${{ env.INSTALL_PREFIX }} run: | cd build - bin/frameReceiverTest + bin/frameReceiverTest --log_level=test_suite - name: Run frame processor unit tests env: INSTALL_PREFIX: ${{ env.INSTALL_PREFIX }} run: | cd build - bin/frameProcessorTest + bin/frameProcessorTest --log_level=test_suite - name: Run odin-data frame integration test env: INSTALL_PREFIX: ${{ env.INSTALL_PREFIX }} From 8007ce50b8f0c3b2c60f33f50115cc96bf22c1ff Mon Sep 17 00:00:00 2001 From: Gary Yendell Date: Thu, 17 Mar 2022 01:14:08 +0000 Subject: [PATCH 02/10] Update test configs and fix CI integration test - Add path and timeout period - udp_packets_per_frame doesn't seem to matter, but that is the right number according to the debug logging in the fp (as is 8000 for size) - Add frames config so fp and fr shut down - Add packet-gap to make the test run reliably --- .github/workflows/test_odin_data.yml | 11 +- cpp/config/CMakeLists.txt | 19 +-- .../integrationTest/config/dummyUDP-fp.json | 143 ++++++++---------- .../integrationTest/config/dummyUDP-fr.json | 6 +- cpp/test/integrationTest/config/dummyUDP.json | 43 +++--- cpp/test/integrationTest/config/testUDP.json | 2 +- 6 files changed, 96 insertions(+), 128 deletions(-) diff --git a/.github/workflows/test_odin_data.yml b/.github/workflows/test_odin_data.yml index 5a938b1e..0015fb7c 100644 --- a/.github/workflows/test_odin_data.yml +++ b/.github/workflows/test_odin_data.yml @@ -3,7 +3,7 @@ name: Test odin-data on: [push, pull_request] env: - INSTALL_PREFIX: ${{ github.workspace }}/../install + INSTALL_PREFIX: ${{ github.workspace }}/prefix jobs: test: @@ -33,20 +33,17 @@ jobs: env: INSTALL_PREFIX: ${{ env.INSTALL_PREFIX }} run: | - cd build - bin/frameReceiverTest --log_level=test_suite + $INSTALL_PREFIX/bin/frameReceiverTest --log_level=test_suite - name: Run frame processor unit tests env: INSTALL_PREFIX: ${{ env.INSTALL_PREFIX }} run: | - cd build - bin/frameProcessorTest --log_level=test_suite + $INSTALL_PREFIX/bin/frameProcessorTest --log_level=test_suite - name: Run odin-data frame integration test env: INSTALL_PREFIX: ${{ env.INSTALL_PREFIX }} run: | - cd build - bin/odinDataTest --json=$INSTALL_PREFIX/test_config/dummyUDP.json + $INSTALL_PREFIX/bin/odinDataTest --json=$INSTALL_PREFIX/test_config/dummyUDP.json - name: Slack Notification uses: rtCamp/action-slack-notify@v2 env: diff --git a/cpp/config/CMakeLists.txt b/cpp/config/CMakeLists.txt index b7cf500d..8c133a56 100644 --- a/cpp/config/CMakeLists.txt +++ b/cpp/config/CMakeLists.txt @@ -1,19 +1,4 @@ -set(TEST_CONFIGS - fp_log4cxx.xml - fr_log4cxx.xml -) - -foreach(test_config ${TEST_CONFIGS}) - add_custom_command( - OUTPUT "${CMAKE_CONFIG_OUTPUT_DIRECTORY}/${test_config}" - COMMAND ${CMAKE_COMMAND} -E copy - "${CMAKE_CURRENT_SOURCE_DIR}/${test_config}" - "${CMAKE_CONFIG_OUTPUT_DIRECTORY}/${test_config}" - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${test_config}" - ) - list(APPEND TEST_CONFIGS_DEST "${CMAKE_CONFIG_OUTPUT_DIRECTORY}/${test_config}") -endforeach(test_config) - -add_custom_target(CopyTestConfigs ALL DEPENDS ${TEST_CONFIGS_DEST} ) +file(GLOB LOG_CONFIGS ${CMAKE_CURRENT_SOURCE_DIR}/*log4cxx.xml) +install(PROGRAMS ${LOG_CONFIGS} DESTINATION test_config) add_subdirectory(client_msgs) diff --git a/cpp/test/integrationTest/config/dummyUDP-fp.json b/cpp/test/integrationTest/config/dummyUDP-fp.json index fcf076b8..7ff7e9f8 100644 --- a/cpp/test/integrationTest/config/dummyUDP-fp.json +++ b/cpp/test/integrationTest/config/dummyUDP-fp.json @@ -1,88 +1,77 @@ [ - { - "fr_setup": { - "fr_ready_cnxn":"tcp://127.0.0.1:5001", - "fr_release_cnxn":"tcp://127.0.0.1:5002" + "fr_setup": { + "fr_ready_cnxn": "tcp://127.0.0.1:5001", + "fr_release_cnxn": "tcp://127.0.0.1:5002" + }, + "meta_endpoint": "tcp://*:5008", + "frames": 10 }, - "meta_endpoint":"tcp://*:5008" - }, - - { - "plugin": { - "load": - { - "index":"hdf", - "name":"FileWriterPlugin", - "library":"${INSTALL_PREFIX}/lib/libHdf5Plugin.so" - } - } - }, - { - "plugin": + "plugin": { + "load": { + "index": "hdf", + "name": "FileWriterPlugin", + "library": "${CMAKE_INSTALL_PREFIX}/lib/libHdf5Plugin.so" + } + } + }, { - "load": - { - "index":"dummy", - "name":"DummyUDPProcessPlugin", - "library":"${INSTALL_PREFIX}/lib/libDummyUDPProcessPlugin.so" - } - } - }, - { - "plugin": + "plugin": { + "load": { + "index": "dummy", + "name": "DummyUDPProcessPlugin", + "library": "${CMAKE_INSTALL_PREFIX}/lib/libDummyUDPProcessPlugin.so" + } + } + }, { - "connect": - { - "index":"dummy", - "connection":"frame_receiver" - } - } - }, - { - "plugin": + "plugin": { + "connect": { + "index": "dummy", + "connection": "frame_receiver" + } + } + }, { - "connect": - { - "index":"hdf", - "connection":"dummy" - } - } - }, - { - "dummy": { - "width": 1024, - "height": 1400 - } - }, - - { - "hdf": + "plugin": { + "connect": { + "index": "hdf", + "connection": "dummy" + } + } + }, { - "dataset":"dummy" - } - }, - { - "hdf": + "dummy": { + "width": 1024, + "height": 1400 + } + }, + { + "hdf": { + "dataset": "dummy" + } + }, { - "dataset": - { - "dummy": - { - "datatype":"uint16", - "dims":[1400,1024], - "compression":"none" + "hdf": { + "dataset": { + "dummy": { + "datatype": "uint16", + "dims": [ + 1400, + 1024 + ], + "compression": "none" + } + }, + "file": { + "path": "/tmp", + "first_number": 1 + }, + "frames": 10, + "acquisition_id": "test_1", + "timeout_timer_period": 3000, + "write": true } - }, - "file": - { - "path":"", - "first_number":1 - }, - "frames":10, - "acquisition_id":"test_1", - "write":true } - } -] +] \ No newline at end of file diff --git a/cpp/test/integrationTest/config/dummyUDP-fr.json b/cpp/test/integrationTest/config/dummyUDP-fr.json index 61ee1d74..09b6d996 100644 --- a/cpp/test/integrationTest/config/dummyUDP-fr.json +++ b/cpp/test/integrationTest/config/dummyUDP-fr.json @@ -1,14 +1,14 @@ [ { "decoder_type": "DummyUDP", - "decoder_path": "${INSTALL_PREFIX}/lib", + "decoder_path": "${CMAKE_INSTALL_PREFIX}/lib", "rx_ports": "61649", "max_buffer_mem": 840000000, "decoder_config": { "enable_packet_logging": false, "frame_timeout_ms": 1000, - "udp_packets_per_frame": 263, + "udp_packets_per_frame": 359, "udp_packet_size": 8000 } } -] +] \ No newline at end of file diff --git a/cpp/test/integrationTest/config/dummyUDP.json b/cpp/test/integrationTest/config/dummyUDP.json index 256a9096..a755ee29 100644 --- a/cpp/test/integrationTest/config/dummyUDP.json +++ b/cpp/test/integrationTest/config/dummyUDP.json @@ -1,48 +1,45 @@ { - "Main": - { + "Main": { "receiver": { - "process" : true, - "command": "${INSTALL_PREFIX}\/bin\/frameReceiver", + "process": true, + "command": "${CMAKE_INSTALL_PREFIX}/bin/frameReceiver", "pos-args": "", "sleep": "1" }, "processor": { "process": true, - "command": "${INSTALL_PREFIX}\/bin\/frameProcessor", + "command": "${CMAKE_INSTALL_PREFIX}/bin/frameProcessor", "pos-args": "", "sleep": "1" }, "simulator": { - "process" : false, - "command": "${INSTALL_PREFIX}\/bin\/frameSimulator", + "process": false, + "command": "${CMAKE_INSTALL_PREFIX}/bin/frameSimulator", "pos-args": "DummyUDP", "sleep": "10" }, "test": { - "process" : false, - "command": "${INSTALL_PREFIX}\/bin\/frameTests --log_level=all -- ", + "process": false, + "command": "${CMAKE_INSTALL_PREFIX}/bin/frameTests --log_level=all -- ", "pos-args": "", "sleep": "1" } }, - "simulator": - { - "lib-path": "${INSTALL_PREFIX}\/lib", + "simulator": { + "lib-path": "${CMAKE_INSTALL_PREFIX}/lib", "frames": "10", "dest-ip": "127.0.0.1", - "ports": "61649" + "ports": "61649", + "packet-gap": 10 }, - "receiver": - { - "json_file": "${INSTALL_PREFIX}\/test_config\/dummyUDP-fr.json" + "receiver": { + "json_file": "${CMAKE_INSTALL_PREFIX}/test_config/dummyUDP-fr.json", + "frames": 10 }, - "processor": - { - "json_file": "${INSTALL_PREFIX}\/test_config\/dummyUDP-fp.json" + "processor": { + "json_file": "${CMAKE_INSTALL_PREFIX}/test_config/dummyUDP-fp.json" }, - "test": - { - "json": "${INSTALL_PREFIX}\/test_config\/testUDP.json" + "test": { + "json": "${CMAKE_INSTALL_PREFIX}/test_config/testUDP.json" } -} +} \ No newline at end of file diff --git a/cpp/test/integrationTest/config/testUDP.json b/cpp/test/integrationTest/config/testUDP.json index da0fdb54..5023fd62 100644 --- a/cpp/test/integrationTest/config/testUDP.json +++ b/cpp/test/integrationTest/config/testUDP.json @@ -1,7 +1,7 @@ { "Test": { - "output_file": "test_1_000001.h5", + "output_file": "/tmp/test_1_000001.h5", "frames": "10", "dimensions": "3", "width": "1400", From 2e939da02e823fbc2a90dca90fe63805be2ca31d Mon Sep 17 00:00:00 2001 From: Gary Yendell Date: Tue, 19 Apr 2022 13:04:26 +0100 Subject: [PATCH 03/10] Fix macro substitution of installed config files --- cpp/test/integrationTest/config/CMakeLists.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cpp/test/integrationTest/config/CMakeLists.txt b/cpp/test/integrationTest/config/CMakeLists.txt index 121f51f9..f67c28cd 100644 --- a/cpp/test/integrationTest/config/CMakeLists.txt +++ b/cpp/test/integrationTest/config/CMakeLists.txt @@ -1,4 +1,9 @@ -install(FILES dummyUDP.json DESTINATION test_config) -install(FILES dummyUDP-fp.json DESTINATION test_config) -install(FILES dummyUDP-fr.json DESTINATION test_config) -install(FILES testUDP.json DESTINATION test_config) +# Copy files to build and substitute macros +configure_file(dummyUDP.json .) +configure_file(dummyUDP-fp.json .) +configure_file(dummyUDP-fr.json .) +configure_file(testUDP.json .) + +# Install files generated in build by above commands, *not* directly from source +file(GLOB CONFIG_FILES ${CMAKE_CURRENT_BINARY_DIR}/*json) +install(FILES ${CONFIG_FILES} DESTINATION test_config) From adb4f60964734c7e375c3a93074e2f4d5dea0838 Mon Sep 17 00:00:00 2001 From: Gary Yendell Date: Fri, 7 Jul 2023 12:53:31 +0100 Subject: [PATCH 04/10] Clear maps after iterating rather during This seemed to cause seg faults in some cases --- cpp/frameProcessor/src/DataBlockPool.cpp | 2 +- cpp/frameProcessor/src/FrameProcessorController.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/frameProcessor/src/DataBlockPool.cpp b/cpp/frameProcessor/src/DataBlockPool.cpp index 50373e4f..0a55aa7f 100644 --- a/cpp/frameProcessor/src/DataBlockPool.cpp +++ b/cpp/frameProcessor/src/DataBlockPool.cpp @@ -269,8 +269,8 @@ void DataBlockPool::tearDownClass() std::map::iterator it; for (it = instance_map_.begin(); it != instance_map_.end(); it++) { delete it->second; - instance_map_.erase(it); } + instance_map_.clear(); } } /* namespace FrameProcessor */ diff --git a/cpp/frameProcessor/src/FrameProcessorController.cpp b/cpp/frameProcessor/src/FrameProcessorController.cpp index 3a61f1ce..7ebe9813 100644 --- a/cpp/frameProcessor/src/FrameProcessorController.cpp +++ b/cpp/frameProcessor/src/FrameProcessorController.cpp @@ -741,8 +741,8 @@ void FrameProcessorController::shutdown() { for (it = plugins_.begin(); it != plugins_.end(); it++) { LOG4CXX_DEBUG_LEVEL(1, logger_, "Removing " << it->first); while(it->second->isWorking()); - plugins_.erase(it); } + plugins_.clear(); // Stop worker thread (for IFrameCallback) and reactor LOG4CXX_DEBUG_LEVEL(1, logger_, "Stopping FrameProcessorController worker thread and IPCReactor"); From 26dd8b5962474e36fabbf1a822e7bb668b9698e8 Mon Sep 17 00:00:00 2001 From: Gary Yendell Date: Mon, 2 May 2022 18:53:47 +0100 Subject: [PATCH 05/10] Add MetaMessage unit tests to build --- cpp/frameProcessor/test/CMakeLists.txt | 7 ++++++- .../MetaMessageUnitTest.cpp => test/MetaMessageTest.cpp} | 0 2 files changed, 6 insertions(+), 1 deletion(-) rename cpp/frameProcessor/{src/MetaMessageUnitTest.cpp => test/MetaMessageTest.cpp} (100%) diff --git a/cpp/frameProcessor/test/CMakeLists.txt b/cpp/frameProcessor/test/CMakeLists.txt index 93495756..704a3acf 100644 --- a/cpp/frameProcessor/test/CMakeLists.txt +++ b/cpp/frameProcessor/test/CMakeLists.txt @@ -5,7 +5,12 @@ ADD_DEFINITIONS(-DBUILD_DIR="${CMAKE_BINARY_DIR}") include_directories(${FRAMEPROCESSOR_DIR}/include ${HDF5_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${LOG4CXX_INCLUDE_DIRS}/.. ${ZEROMQ_INCLUDE_DIRS}) add_definitions(${HDF5_DEFINITIONS}) -file(GLOB TEST_SOURCES FrameProcessorUnitTestMain.cpp FrameProcessorTest.cpp GapFillPluginTest.cpp) +file(GLOB TEST_SOURCES + FrameProcessorUnitTestMain.cpp + FrameProcessorTest.cpp + GapFillPluginTest.cpp + MetaMessageTest.cpp +) # Add tests for BloscPlugin if Blosc is present if (${BLOSC_FOUND}) list(APPEND TEST_SOURCES BloscPluginTest.cpp) diff --git a/cpp/frameProcessor/src/MetaMessageUnitTest.cpp b/cpp/frameProcessor/test/MetaMessageTest.cpp similarity index 100% rename from cpp/frameProcessor/src/MetaMessageUnitTest.cpp rename to cpp/frameProcessor/test/MetaMessageTest.cpp From a68f07c5b27010bdfec8856ccc16647570eab2e9 Mon Sep 17 00:00:00 2001 From: Gary Yendell Date: Thu, 22 Sep 2022 00:12:19 +0100 Subject: [PATCH 06/10] Rename CI workflow --- .github/workflows/{test_odin_data.yml => code.yml} | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) rename .github/workflows/{test_odin_data.yml => code.yml} (98%) diff --git a/.github/workflows/test_odin_data.yml b/.github/workflows/code.yml similarity index 98% rename from .github/workflows/test_odin_data.yml rename to .github/workflows/code.yml index 0015fb7c..7b400713 100644 --- a/.github/workflows/test_odin_data.yml +++ b/.github/workflows/code.yml @@ -1,5 +1,4 @@ -name: Test odin-data - +name: Code CI on: [push, pull_request] env: From b672838b61abd123baa43a7a07c67c55b6f57688 Mon Sep 17 00:00:00 2001 From: Gary Yendell Date: Mon, 19 Sep 2022 13:06:44 +0100 Subject: [PATCH 07/10] Extract FrameSimulatorPlugin REGISTER call into Lib.cpp --- .../include/DummyUDPFrameSimulatorPlugin.h | 2 -- cpp/frameSimulator/src/CMakeLists.txt | 2 +- .../src/DummyUDPFrameSimulatorPluginLib.cpp | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 cpp/frameSimulator/src/DummyUDPFrameSimulatorPluginLib.cpp diff --git a/cpp/frameSimulator/include/DummyUDPFrameSimulatorPlugin.h b/cpp/frameSimulator/include/DummyUDPFrameSimulatorPlugin.h index e3559017..f1759b2b 100644 --- a/cpp/frameSimulator/include/DummyUDPFrameSimulatorPlugin.h +++ b/cpp/frameSimulator/include/DummyUDPFrameSimulatorPlugin.h @@ -56,8 +56,6 @@ namespace FrameSimulator { }; - REGISTER(FrameSimulatorPlugin, DummyUDPFrameSimulatorPlugin, "DummyUDPFrameSimulatorPlugin"); - } #endif //FRAMESIMULATOR_DUMMYUDPSIMULATORPLUGIN_H diff --git a/cpp/frameSimulator/src/CMakeLists.txt b/cpp/frameSimulator/src/CMakeLists.txt index bdb29e80..bc75e9cf 100644 --- a/cpp/frameSimulator/src/CMakeLists.txt +++ b/cpp/frameSimulator/src/CMakeLists.txt @@ -26,7 +26,7 @@ add_executable(frameSimulator ${APP_SOURCES} FrameSimulatorApp.cpp) target_link_libraries(frameSimulator ${LIB_PROCESSOR} ${Boost_LIBRARIES} ${LOG4CXX_LIBRARIES} ${PCAP_LIBRARY} ${COMMON_LIBRARY}) -file(GLOB DUMMY_LIB_SOURCES DummyUDPFrameSimulatorPlugin.cpp DummyUDPFrame.cpp) +file(GLOB DUMMY_LIB_SOURCES DummyUDPFrameSimulatorPlugin.cpp DummyUDPFrame.cpp DummyUDPFrameSimulatorPluginLib.cpp) # Add library for DummyUDP plugin add_library(DummyUDPFrameSimulatorPlugin SHARED ${DUMMY_LIB_SOURCES}) diff --git a/cpp/frameSimulator/src/DummyUDPFrameSimulatorPluginLib.cpp b/cpp/frameSimulator/src/DummyUDPFrameSimulatorPluginLib.cpp new file mode 100644 index 00000000..d952554d --- /dev/null +++ b/cpp/frameSimulator/src/DummyUDPFrameSimulatorPluginLib.cpp @@ -0,0 +1,19 @@ +/* + * DummyUDPFrameSimulatorPluginLib.cpp + * + * Created on: 19 Sep 2022 + * Author: Gary Yendell + */ + +#include "DummyUDPFrameSimulatorPlugin.h" +#include "ClassLoader.h" + +namespace FrameSimulator +{ + /** + * Registration of this decoder through the ClassLoader. This macro + * registers the class without needing to worry about name mangling + */ + REGISTER(FrameSimulatorPlugin, DummyUDPFrameSimulatorPlugin, "DummyUDPFrameSimulatorPlugin"); + +} From de41be6367ec0e3644f79fde2c08436163716c46 Mon Sep 17 00:00:00 2001 From: Gary Yendell Date: Thu, 22 Sep 2022 01:36:28 +0100 Subject: [PATCH 08/10] Install frameReceiverTest --- cpp/frameReceiver/test/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/frameReceiver/test/CMakeLists.txt b/cpp/frameReceiver/test/CMakeLists.txt index bca4d6b9..4aedea18 100644 --- a/cpp/frameReceiver/test/CMakeLists.txt +++ b/cpp/frameReceiver/test/CMakeLists.txt @@ -32,3 +32,4 @@ if ( ${CMAKE_SYSTEM_NAME} MATCHES Linux ) target_link_libraries(frameReceiverTest ${PTHREAD_LIBRARY} ${REALTIME_LIBRARY}) endif() +install(TARGETS frameReceiverTest RUNTIME DESTINATION bin) From 644b3bd5ed8ccbde70c677a5b67ea96a092aaea0 Mon Sep 17 00:00:00 2001 From: Gary Yendell Date: Thu, 22 Sep 2022 01:37:34 +0100 Subject: [PATCH 09/10] Do parallel build in CI --- .github/workflows/code.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code.yml b/.github/workflows/code.yml index 7b400713..31e2c23a 100644 --- a/.github/workflows/code.yml +++ b/.github/workflows/code.yml @@ -26,7 +26,7 @@ jobs: mkdir -p $INSTALL_PREFIX mkdir build && cd build cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX ../cpp - make install VERBOSE=1 + make -j8 VERBOSE=1 && make install VERBOSE=1 ls -la $INSTALL_PREFIX - name: Run frame receiver unit tests env: From 6fb31856cf4b9b51286e6d5ab42d14215162794c Mon Sep 17 00:00:00 2001 From: Gary Yendell Date: Thu, 17 Mar 2022 01:14:08 +0000 Subject: [PATCH 10/10] Update test configs and fix CI integration test - Add path and timeout period - udp_packets_per_frame doesn't seem to matter, but that is the right number according to the debug logging in the fp (as is 8000 for size) - Add frames config so fp and fr shut down - Add packet-gap to make the test run reliably - Remove unused logconfig from FrameTestApp --- cpp/test/integrationTest/README.md | 4 ++-- cpp/test/integrationTest/config/dummyUDP-fr.json | 3 ++- cpp/test/integrationTest/config/dummyUDP.json | 7 +++---- cpp/test/integrationTest/src/FrameTestApp.cpp | 12 +----------- cpp/test/integrationTest/src/PropertyTreeUtility.cpp | 8 ++++---- 5 files changed, 12 insertions(+), 22 deletions(-) diff --git a/cpp/test/integrationTest/README.md b/cpp/test/integrationTest/README.md index 18699634..0f01097e 100644 --- a/cpp/test/integrationTest/README.md +++ b/cpp/test/integrationTest/README.md @@ -20,10 +20,10 @@ dest-ip=127.0.0.1 ports=61649 interval=1 [Receiver-args] -json_file=/scratch/odin-data/configs/excalibur-fr.json +config=/scratch/odin-data/configs/excalibur-fr.json m=500000000 [Processor-args] -json_file=/scratch/odin-data/configs/excalibur-fp.json +config=/scratch/odin-data/configs/excalibur-fp.json ``` Launches: diff --git a/cpp/test/integrationTest/config/dummyUDP-fr.json b/cpp/test/integrationTest/config/dummyUDP-fr.json index 09b6d996..006c8e03 100644 --- a/cpp/test/integrationTest/config/dummyUDP-fr.json +++ b/cpp/test/integrationTest/config/dummyUDP-fr.json @@ -9,6 +9,7 @@ "frame_timeout_ms": 1000, "udp_packets_per_frame": 359, "udp_packet_size": 8000 - } + }, + "frames": 10 } ] \ No newline at end of file diff --git a/cpp/test/integrationTest/config/dummyUDP.json b/cpp/test/integrationTest/config/dummyUDP.json index a755ee29..258bdc60 100644 --- a/cpp/test/integrationTest/config/dummyUDP.json +++ b/cpp/test/integrationTest/config/dummyUDP.json @@ -20,7 +20,7 @@ }, "test": { "process": false, - "command": "${CMAKE_INSTALL_PREFIX}/bin/frameTests --log_level=all -- ", + "command": "${CMAKE_INSTALL_PREFIX}/bin/frameTests -- ", "pos-args": "", "sleep": "1" } @@ -33,11 +33,10 @@ "packet-gap": 10 }, "receiver": { - "json_file": "${CMAKE_INSTALL_PREFIX}/test_config/dummyUDP-fr.json", - "frames": 10 + "config": "${CMAKE_INSTALL_PREFIX}/test_config/dummyUDP-fr.json" }, "processor": { - "json_file": "${CMAKE_INSTALL_PREFIX}/test_config/dummyUDP-fp.json" + "config": "${CMAKE_INSTALL_PREFIX}/test_config/dummyUDP-fp.json" }, "test": { "json": "${CMAKE_INSTALL_PREFIX}/test_config/testUDP.json" diff --git a/cpp/test/integrationTest/src/FrameTestApp.cpp b/cpp/test/integrationTest/src/FrameTestApp.cpp index 7a28cd15..e3ea54a9 100644 --- a/cpp/test/integrationTest/src/FrameTestApp.cpp +++ b/cpp/test/integrationTest/src/FrameTestApp.cpp @@ -88,17 +88,7 @@ int parse_arguments(int argc, // Setup logging - if (vm.count("logconfig")) { - std::string logconf_fname = vm["logconfig"].as(); - if (has_suffix(logconf_fname, ".xml")) { - log4cxx::xml::DOMConfigurator::configure(logconf_fname); - } else { - PropertyConfigurator::configure(logconf_fname); - } - LOG4CXX_DEBUG(logger, "log4cxx config file is set to " << logconf_fname); - } else { - BasicConfigurator::configure(); - } + BasicConfigurator::configure(); // Read configuration file; store as boost::property_tree::ptree diff --git a/cpp/test/integrationTest/src/PropertyTreeUtility.cpp b/cpp/test/integrationTest/src/PropertyTreeUtility.cpp index af91dc6c..b7a1ba1f 100644 --- a/cpp/test/integrationTest/src/PropertyTreeUtility.cpp +++ b/cpp/test/integrationTest/src/PropertyTreeUtility.cpp @@ -41,9 +41,9 @@ namespace FrameSimulatorTest { args.push_back("--" + vc.first); PropertyTreeUtility::expandEnvVars(vc.second.data()); args.push_back(vc.second.data()); - if (vc.first == "json_file") { - std::string json_file = vc.second.data(); - std::ifstream file(json_file.c_str()); + if (vc.first == "config") { + std::string config = vc.second.data(); + std::ifstream file(config.c_str()); std::string json; std::string new_json; while(std::getline(file, json)) { @@ -51,7 +51,7 @@ namespace FrameSimulatorTest { new_json += json; } std::ofstream updated_file; - updated_file.open(json_file.c_str(), std::ios::trunc); + updated_file.open(config.c_str(), std::ios::trunc); updated_file << new_json; updated_file.close(); }