From 672538de32d4546005c3f8c2e84aa795209b1319 Mon Sep 17 00:00:00 2001 From: Justine West <35715959+jwest115@users.noreply.github.com> Date: Wed, 4 Sep 2024 14:48:25 -0700 Subject: [PATCH] Update Ref and RPI for compatibility with FPP #349 (fully qualified component instance names) (#2823) * updated ref and rpi integration tests * fix component qualifiers * FPP v2.2.0a1 * fix py file formatting * add new line * remove newline * file py file formatting * fprime-gds v3.4.4a3 * fix typo in integration test command name --------- Co-authored-by: jawest --- RPI/Top/RPITopologyDefs.hpp | 18 +++--- RPI/Top/instances.fpp | 94 ++++++++++++++-------------- RPI/test/int/rpi_integration_test.py | 24 ++++--- RPI/test/int/test_seq.seq | 4 +- Ref/Top/RefTopology.cpp | 28 ++++----- Ref/Top/RefTopologyDefs.hpp | 28 ++++----- Ref/test/int/ref_integration_test.py | 49 ++++++++------- Ref/test/int/test_seq.seq | 4 +- requirements.txt | 28 ++++----- 9 files changed, 142 insertions(+), 135 deletions(-) diff --git a/RPI/Top/RPITopologyDefs.hpp b/RPI/Top/RPITopologyDefs.hpp index f434f2e9b0..50ec1d1c84 100644 --- a/RPI/Top/RPITopologyDefs.hpp +++ b/RPI/Top/RPITopologyDefs.hpp @@ -46,15 +46,15 @@ namespace RPI { // Health ping entries namespace PingEntries { - namespace rateGroup10HzComp { enum { WARN = 3, FATAL = 5 }; } - namespace rateGroup1HzComp { enum { WARN = 3, FATAL = 5 }; } - namespace cmdDisp { enum { WARN = 3, FATAL = 5 }; } - namespace cmdSeq { enum { WARN = 3, FATAL = 5 }; } - namespace chanTlm { enum { WARN = 3, FATAL = 5 }; } - namespace eventLogger { enum { WARN = 3, FATAL = 5 }; } - namespace prmDb { enum { WARN = 3, FATAL = 5 }; } - namespace fileDownlink { enum { WARN = 3, FATAL = 5 }; } - namespace fileUplink { enum { WARN = 3, FATAL = 5 }; } + namespace RPI_rateGroup10HzComp { enum { WARN = 3, FATAL = 5 }; } + namespace RPI_rateGroup1HzComp { enum { WARN = 3, FATAL = 5 }; } + namespace RPI_cmdDisp { enum { WARN = 3, FATAL = 5 }; } + namespace RPI_cmdSeq { enum { WARN = 3, FATAL = 5 }; } + namespace RPI_chanTlm { enum { WARN = 3, FATAL = 5 }; } + namespace RPI_eventLogger { enum { WARN = 3, FATAL = 5 }; } + namespace RPI_prmDb { enum { WARN = 3, FATAL = 5 }; } + namespace RPI_fileDownlink { enum { WARN = 3, FATAL = 5 }; } + namespace RPI_fileUplink { enum { WARN = 3, FATAL = 5 }; } } } diff --git a/RPI/Top/instances.fpp b/RPI/Top/instances.fpp index 992aced0cc..79b7531fe1 100644 --- a/RPI/Top/instances.fpp +++ b/RPI/Top/instances.fpp @@ -27,9 +27,9 @@ module RPI { """ phase Fpp.ToCpp.Phases.configComponents """ - rateGroup10HzComp.configure( - ConfigObjects::rateGroup10HzComp::context, - FW_NUM_ARRAY_ELEMENTS(ConfigObjects::rateGroup10HzComp::context) + RPI::rateGroup10HzComp.configure( + ConfigObjects::RPI_rateGroup10HzComp::context, + FW_NUM_ARRAY_ELEMENTS(ConfigObjects::RPI_rateGroup10HzComp::context) ); """ @@ -51,8 +51,8 @@ module RPI { priority 20 \ { phase Fpp.ToCpp.Phases.readParameters """ - prmDb.configure("PrmDb.dat"); - prmDb.readParamFile(); + RPI::prmDb.configure("PrmDb.dat"); + RPI::prmDb.readParamFile(); """ } @@ -72,18 +72,18 @@ module RPI { phase Fpp.ToCpp.Phases.configComponents """ { - using namespace ConfigConstants::cmdSeq; - cmdSeq.allocateBuffer( + using namespace ConfigConstants::RPI_cmdSeq; + RPI::cmdSeq.allocateBuffer( 0, Allocation::mallocator, - ConfigConstants::cmdSeq::BUFFER_SIZE + ConfigConstants::RPI_cmdSeq::BUFFER_SIZE ); - cmdSeq.setTimeout(TIMEOUT); + RPI::cmdSeq.setTimeout(TIMEOUT); } """ phase Fpp.ToCpp.Phases.tearDownComponents """ - cmdSeq.deallocateBuffer(Allocation::mallocator); + RPI::cmdSeq.deallocateBuffer(Allocation::mallocator); """ } @@ -104,9 +104,9 @@ module RPI { """ phase Fpp.ToCpp.Phases.configComponents """ - rateGroup1HzComp.configure( - ConfigObjects::rateGroup1HzComp::context, - FW_NUM_ARRAY_ELEMENTS(ConfigObjects::rateGroup1HzComp::context) + RPI::rateGroup1HzComp.configure( + ConfigObjects::RPI_rateGroup1HzComp::context, + FW_NUM_ARRAY_ELEMENTS(ConfigObjects::RPI_rateGroup1HzComp::context) ); """ @@ -133,11 +133,11 @@ module RPI { """ phase Fpp.ToCpp.Phases.configComponents """ - fileDownlink.configure( - ConfigConstants::fileDownlink::TIMEOUT, - ConfigConstants::fileDownlink::COOLDOWN, - ConfigConstants::fileDownlink::CYCLE_TIME, - ConfigConstants::fileDownlink::FILE_QUEUE_DEPTH + RPI::fileDownlink.configure( + ConfigConstants::RPI_fileDownlink::TIMEOUT, + ConfigConstants::RPI_fileDownlink::COOLDOWN, + ConfigConstants::RPI_fileDownlink::CYCLE_TIME, + ConfigConstants::RPI_fileDownlink::FILE_QUEUE_DEPTH ); """ @@ -163,10 +163,10 @@ module RPI { """ phase Fpp.ToCpp.Phases.configComponents """ - health.setPingEntries( - ConfigObjects::health::pingEntries, - FW_NUM_ARRAY_ELEMENTS(ConfigObjects::health::pingEntries), - ConfigConstants::health::WATCHDOG_CODE + RPI::health.setPingEntries( + ConfigObjects::RPI_health::pingEntries, + FW_NUM_ARRAY_ELEMENTS(ConfigObjects::RPI_health::pingEntries), + ConfigConstants::RPI_health::WATCHDOG_CODE ); """ @@ -193,10 +193,10 @@ module RPI { { Svc::BufferManager::BufferBins bufferBins; memset(&bufferBins, 0, sizeof(bufferBins)); - using namespace ConfigConstants::fileUplinkBufferManager; + using namespace ConfigConstants::RPI_fileUplinkBufferManager; bufferBins.bins[0].bufferSize = STORE_SIZE; bufferBins.bins[0].numBuffers = QUEUE_SIZE; - fileUplinkBufferManager.setup( + RPI::fileUplinkBufferManager.setup( MGR_ID, 0, Allocation::mallocator, @@ -207,7 +207,7 @@ module RPI { """ phase Fpp.ToCpp.Phases.tearDownComponents """ - fileUplinkBufferManager.cleanup(); + RPI::fileUplinkBufferManager.cleanup(); """ } @@ -224,7 +224,7 @@ module RPI { """ phase Fpp.ToCpp.Phases.configComponents """ - downlink.setup(ConfigObjects::downlink::framing); + RPI::downlink.setup(ConfigObjects::RPI_downlink::framing); """ } @@ -237,7 +237,7 @@ module RPI { """ phase Fpp.ToCpp.Phases.configComponents """ - uplink.setup(ConfigObjects::uplink::deframing); + RPI::uplink.setup(ConfigObjects::RPI_uplink::deframing); """ } @@ -257,21 +257,21 @@ module RPI { if (state.hostName != nullptr && state.portNumber != 0) { Os::TaskString name("ReceiveTask"); // Uplink is configured for receive so a socket task is started - comm.configure(state.hostName, state.portNumber); - comm.start( + RPI::comm.configure(state.hostName, state.portNumber); + RPI::comm.start( name, - ConfigConstants::comm::PRIORITY, - ConfigConstants::comm::STACK_SIZE + ConfigConstants::RPI_comm::PRIORITY, + ConfigConstants::RPI_comm::STACK_SIZE ); } """ phase Fpp.ToCpp.Phases.stopTasks """ - comm.stop(); + RPI::comm.stop(); """ phase Fpp.ToCpp.Phases.freeThreads """ - (void) comm.join(); + (void) RPI::comm.join(); """ } @@ -282,7 +282,7 @@ module RPI { { phase Fpp.ToCpp.Phases.stopTasks """ - linuxTimer.quit(); + RPI::linuxTimer.quit(); """ } @@ -295,8 +295,8 @@ module RPI { """ phase Fpp.ToCpp.Phases.configComponents """ - rateGroupDriverComp.configure( - ConfigObjects::rateGroupDriverComp::rgDivs + RPI::rateGroupDriverComp.configure( + ConfigObjects::RPI_rateGroupDriverComp::rgDivs ); """ } @@ -323,7 +323,7 @@ module RPI { phase Fpp.ToCpp.Phases.startTasks """ if (Init::status) { - uartDrv.start(); + RPI::uartDrv.start(); } else { Fw::Logger::log("[ERROR] Initialization failed; not starting UART driver\\n"); @@ -331,7 +331,7 @@ module RPI { """ phase Fpp.ToCpp.Phases.stopTasks """ - uartDrv.quitReadThread(); + RPI::uartDrv.quitReadThread(); """ } @@ -341,7 +341,7 @@ module RPI { phase Fpp.ToCpp.Phases.configComponents """ { - const bool status = ledDrv.open(21, Drv::LinuxGpioDriverComponentImpl::GPIO_OUT); + const bool status = RPI::ledDrv.open(21, Drv::LinuxGpioDriverComponentImpl::GPIO_OUT); if (!status) { Fw::Logger::log("[ERROR] Could not open LED driver\\n"); Init::status = false; @@ -356,7 +356,7 @@ module RPI { phase Fpp.ToCpp.Phases.configComponents """ { - const bool status = gpio23Drv.open(23, Drv::LinuxGpioDriverComponentImpl::GPIO_OUT); + const bool status = RPI::gpio23Drv.open(23, Drv::LinuxGpioDriverComponentImpl::GPIO_OUT); if (!status) { Fw::Logger::log("[ERROR] Could not open GPIO 23 driver\\n"); Init::status = false; @@ -371,7 +371,7 @@ module RPI { phase Fpp.ToCpp.Phases.configComponents """ { - const bool status = gpio24Drv.open(24, Drv::LinuxGpioDriverComponentImpl::GPIO_OUT); + const bool status = RPI::gpio24Drv.open(24, Drv::LinuxGpioDriverComponentImpl::GPIO_OUT); if (!status) { Fw::Logger::log("[ERROR] Could not open GPIO 24 driver\\n"); Init::status = false; @@ -386,7 +386,7 @@ module RPI { phase Fpp.ToCpp.Phases.configComponents """ { - const bool status = gpio25Drv.open(25, Drv::LinuxGpioDriverComponentImpl::GPIO_IN); + const bool status = RPI::gpio25Drv.open(25, Drv::LinuxGpioDriverComponentImpl::GPIO_IN); if (!status) { Fw::Logger::log("[ERROR] Could not open GPIO 25 driver\\n"); Init::status = false; @@ -401,7 +401,7 @@ module RPI { phase Fpp.ToCpp.Phases.configComponents """ { - const bool status = gpio17Drv.open(17, Drv::LinuxGpioDriverComponentImpl::GPIO_IN); + const bool status = RPI::gpio17Drv.open(17, Drv::LinuxGpioDriverComponentImpl::GPIO_IN); if (!status) { Fw::Logger::log("[ERROR] Could not open GPIO 17 driver\\n"); Init::status = false; @@ -416,7 +416,7 @@ module RPI { phase Fpp.ToCpp.Phases.configComponents """ { - const bool status = spiDrv.open(0, 0, Drv::SPI_FREQUENCY_1MHZ); + const bool status = RPI::spiDrv.open(0, 0, Drv::SPI_FREQUENCY_1MHZ); if (!status) { Fw::Logger::log("[ERROR] Could not open SPI driver\\n"); Init::status = false; @@ -441,10 +441,10 @@ module RPI { { Svc::BufferManager::BufferBins bufferBins; memset(&bufferBins, 0, sizeof(bufferBins)); - using namespace ConfigConstants::uartBufferManager; + using namespace ConfigConstants::RPI_uartBufferManager; bufferBins.bins[0].bufferSize = STORE_SIZE; bufferBins.bins[0].numBuffers = QUEUE_SIZE; - uartBufferManager.setup( + RPI::uartBufferManager.setup( MGR_ID, 0, Allocation::mallocator, @@ -455,7 +455,7 @@ module RPI { """ phase Fpp.ToCpp.Phases.tearDownComponents """ - uartBufferManager.cleanup(); + RPI::uartBufferManager.cleanup(); """ } diff --git a/RPI/test/int/rpi_integration_test.py b/RPI/test/int/rpi_integration_test.py index dec78dfe13..a77df6408a 100644 --- a/RPI/test/int/rpi_integration_test.py +++ b/RPI/test/int/rpi_integration_test.py @@ -33,7 +33,7 @@ def set_event_filter(fprime_test_api, severity, enabled): severity = FilterSeverity[severity].name try: fprime_test_api.send_command( - "eventLogger.SET_EVENT_FILTER", + "RPI.eventLogger.SET_EVENT_FILTER", [severity, enabled], ) return True @@ -61,21 +61,25 @@ def test_is_streaming(fprime_test_api): def test_send_command(fprime_test_api): - fprime_test_api.send_and_assert_command("cmdDisp.CMD_NO_OP", max_delay=0.1) + fprime_test_api.send_and_assert_command("RPI.cmdDisp.CMD_NO_OP", max_delay=0.1) assert fprime_test_api.get_command_test_history().size() == 1 - fprime_test_api.send_and_assert_command("cmdDisp.CMD_NO_OP", max_delay=0.1) + fprime_test_api.send_and_assert_command("RPI.cmdDisp.CMD_NO_OP", max_delay=0.1) assert fprime_test_api.get_command_test_history().size() == 2 def test_send_and_assert_no_op(fprime_test_api): length = 100 failed = 0 - evr_seq = ["OpCodeDispatched", "NoOpReceived", "OpCodeCompleted"] + evr_seq = [ + "RPI.cmdDisp.OpCodeDispatched", + "RPI.cmdDisp.NoOpReceived", + "RPI.cmdDisp.OpCodeCompleted", + ] any_reordered = False dropped = False for i in range(0, length): results = fprime_test_api.send_and_await_event( - "cmdDisp.CMD_NO_OP", events=evr_seq, timeout=25 + "RPI.cmdDisp.CMD_NO_OP", events=evr_seq, timeout=25 ) msg = "Send and assert NO_OP Trial #{}".format(i) if not fprime_test_api.test_assert(len(results) == 3, msg, True): @@ -129,8 +133,8 @@ def test_active_logger_filter(fprime_test_api): # Drain time for dispatch events time.sleep(10) - fprime_test_api.send_and_assert_command("cmdDisp.CMD_NO_OP") - fprime_test_api.send_and_assert_command("cmdDisp.CMD_NO_OP") + fprime_test_api.send_and_assert_command("RPI.cmdDisp.CMD_NO_OP") + fprime_test_api.send_and_assert_command("RPI.cmdDisp.CMD_NO_OP") time.sleep(0.5) @@ -141,8 +145,8 @@ def test_active_logger_filter(fprime_test_api): # Drain time for dispatch events time.sleep(10) fprime_test_api.clear_histories() - fprime_test_api.send_command("cmdDisp.CMD_NO_OP") - fprime_test_api.send_command("cmdDisp.CMD_NO_OP") + fprime_test_api.send_command("RPI.cmdDisp.CMD_NO_OP") + fprime_test_api.send_command("RPI.cmdDisp.CMD_NO_OP") time.sleep(0.5) @@ -168,5 +172,5 @@ def test_seqgen(fprime_test_api): == 0 ), "Failed to run fprime-seqgen" fprime_test_api.send_and_assert_command( - "cmdSeq.CS_RUN", args=["/tmp/ref_test_int.bin", "BLOCK"], max_delay=5 + "RPI.cmdSeq.CS_RUN", args=["/tmp/ref_test_int.bin", "BLOCK"], max_delay=5 ) diff --git a/RPI/test/int/test_seq.seq b/RPI/test/int/test_seq.seq index 480ef0b32f..bda0e6df23 100644 --- a/RPI/test/int/test_seq.seq +++ b/RPI/test/int/test_seq.seq @@ -1,6 +1,6 @@ ; A test sequence ; -R00:00:00 cmdDisp.CMD_NO_OP +R00:00:00 RPI.cmdDisp.CMD_NO_OP ; Let's try out some commands with arguments -R00:00:01.050 cmdDisp.CMD_NO_OP_STRING "Awesome string!"; \ No newline at end of file +R00:00:01.050 RPI.cmdDisp.CMD_NO_OP_STRING "Awesome string!"; \ No newline at end of file diff --git a/Ref/Top/RefTopology.cpp b/Ref/Top/RefTopology.cpp index 9cfd30cffd..07d6434981 100644 --- a/Ref/Top/RefTopology.cpp +++ b/Ref/Top/RefTopology.cpp @@ -64,20 +64,20 @@ enum TopologyConstants { // Ping entries are autocoded, however; this code is not properly exported. Thus, it is copied here. Svc::Health::PingEntry pingEntries[] = { - {PingEntries::blockDrv::WARN, PingEntries::blockDrv::FATAL, "blockDrv"}, - {PingEntries::tlmSend::WARN, PingEntries::tlmSend::FATAL, "chanTlm"}, - {PingEntries::cmdDisp::WARN, PingEntries::cmdDisp::FATAL, "cmdDisp"}, - {PingEntries::cmdSeq::WARN, PingEntries::cmdSeq::FATAL, "cmdSeq"}, - {PingEntries::eventLogger::WARN, PingEntries::eventLogger::FATAL, "eventLogger"}, - {PingEntries::fileDownlink::WARN, PingEntries::fileDownlink::FATAL, "fileDownlink"}, - {PingEntries::fileManager::WARN, PingEntries::fileManager::FATAL, "fileManager"}, - {PingEntries::fileUplink::WARN, PingEntries::fileUplink::FATAL, "fileUplink"}, - {PingEntries::pingRcvr::WARN, PingEntries::pingRcvr::FATAL, "pingRcvr"}, - {PingEntries::prmDb::WARN, PingEntries::prmDb::FATAL, "prmDb"}, - {PingEntries::rateGroup1Comp::WARN, PingEntries::rateGroup1Comp::FATAL, "rateGroup1Comp"}, - {PingEntries::rateGroup2Comp::WARN, PingEntries::rateGroup2Comp::FATAL, "rateGroup2Comp"}, - {PingEntries::rateGroup3Comp::WARN, PingEntries::rateGroup3Comp::FATAL, "rateGroup3Comp"}, - {PingEntries::dpCat::WARN, PingEntries::dpCat::FATAL, "rateGroup3Comp"}, + {PingEntries::Ref_blockDrv::WARN, PingEntries::Ref_blockDrv::FATAL, "blockDrv"}, + {PingEntries::Ref_tlmSend::WARN, PingEntries::Ref_tlmSend::FATAL, "chanTlm"}, + {PingEntries::Ref_cmdDisp::WARN, PingEntries::Ref_cmdDisp::FATAL, "cmdDisp"}, + {PingEntries::Ref_cmdSeq::WARN, PingEntries::Ref_cmdSeq::FATAL, "cmdSeq"}, + {PingEntries::Ref_eventLogger::WARN, PingEntries::Ref_eventLogger::FATAL, "eventLogger"}, + {PingEntries::Ref_fileDownlink::WARN, PingEntries::Ref_fileDownlink::FATAL, "fileDownlink"}, + {PingEntries::Ref_fileManager::WARN, PingEntries::Ref_fileManager::FATAL, "fileManager"}, + {PingEntries::Ref_fileUplink::WARN, PingEntries::Ref_fileUplink::FATAL, "fileUplink"}, + {PingEntries::Ref_pingRcvr::WARN, PingEntries::Ref_pingRcvr::FATAL, "pingRcvr"}, + {PingEntries::Ref_prmDb::WARN, PingEntries::Ref_prmDb::FATAL, "prmDb"}, + {PingEntries::Ref_rateGroup1Comp::WARN, PingEntries::Ref_rateGroup1Comp::FATAL, "rateGroup1Comp"}, + {PingEntries::Ref_rateGroup2Comp::WARN, PingEntries::Ref_rateGroup2Comp::FATAL, "rateGroup2Comp"}, + {PingEntries::Ref_rateGroup3Comp::WARN, PingEntries::Ref_rateGroup3Comp::FATAL, "rateGroup3Comp"}, + {PingEntries::Ref_dpCat::WARN, PingEntries::Ref_dpCat::FATAL, "rateGroup3Comp"}, }; /** diff --git a/Ref/Top/RefTopologyDefs.hpp b/Ref/Top/RefTopologyDefs.hpp index 20ad9bd5d8..ede301899c 100644 --- a/Ref/Top/RefTopologyDefs.hpp +++ b/Ref/Top/RefTopologyDefs.hpp @@ -53,46 +53,46 @@ struct TopologyState { * ``` */ namespace PingEntries { -namespace blockDrv { +namespace Ref_blockDrv { enum { WARN = 3, FATAL = 5 }; } -namespace tlmSend { +namespace Ref_tlmSend { enum { WARN = 3, FATAL = 5 }; } -namespace cmdDisp { +namespace Ref_cmdDisp { enum { WARN = 3, FATAL = 5 }; } -namespace cmdSeq { +namespace Ref_cmdSeq { enum { WARN = 3, FATAL = 5 }; } -namespace eventLogger { +namespace Ref_eventLogger { enum { WARN = 3, FATAL = 5 }; } -namespace fileDownlink { +namespace Ref_fileDownlink { enum { WARN = 3, FATAL = 5 }; } -namespace fileManager { +namespace Ref_fileManager { enum { WARN = 3, FATAL = 5 }; } -namespace fileUplink { +namespace Ref_fileUplink { enum { WARN = 3, FATAL = 5 }; } -namespace pingRcvr { +namespace Ref_pingRcvr { enum { WARN = 3, FATAL = 5 }; } -namespace prmDb { +namespace Ref_prmDb { enum { WARN = 3, FATAL = 5 }; } -namespace rateGroup1Comp { +namespace Ref_rateGroup1Comp { enum { WARN = 3, FATAL = 5 }; } -namespace rateGroup2Comp { +namespace Ref_rateGroup2Comp { enum { WARN = 3, FATAL = 5 }; } -namespace rateGroup3Comp { +namespace Ref_rateGroup3Comp { enum { WARN = 3, FATAL = 5 }; } -namespace dpCat { +namespace Ref_dpCat { enum { WARN = 3, FATAL = 5 }; } } // namespace PingEntries diff --git a/Ref/test/int/ref_integration_test.py b/Ref/test/int/ref_integration_test.py index 6682fa2882..8523e42e01 100644 --- a/Ref/test/int/ref_integration_test.py +++ b/Ref/test/int/ref_integration_test.py @@ -2,6 +2,7 @@ A set of integration tests to apply to the Ref app. This is intended to be a reference of integration testing. """ + import subprocess import time from enum import Enum @@ -24,14 +25,14 @@ def test_is_streaming(fprime_test_api): """Test flight software is streaming Tests that the flight software is streaming by looking for 5 telemetry items in 10 seconds. Additionally, - "sendBuffComp.SendState" is verified to be SEND_IDLE. + "Ref.sendBuffComp.SendState" is verified to be SEND_IDLE. """ results = fprime_test_api.assert_telemetry_count(5, timeout=10) for result in results: msg = "received channel {} update: {}".format(result.get_id(), result.get_str()) print(msg) fprime_test_api.assert_telemetry( - "sendBuffComp.SendState", value="SEND_IDLE", timeout=3 + "Ref.sendBuffComp.SendState", value="SEND_IDLE", timeout=3 ) @@ -56,7 +57,7 @@ def set_event_filter(fprime_test_api, severity, enabled): severity = FilterSeverity[severity].name try: fprime_test_api.send_command( - "eventLogger.SET_EVENT_FILTER", + "Ref.eventLogger.SET_EVENT_FILTER", [severity, enabled], ) return True @@ -79,9 +80,9 @@ def test_send_command(fprime_test_api): Tests command send, dispatch, and receipt using send_and_assert command with a pair of NO-OP commands. """ - fprime_test_api.send_and_assert_command("cmdDisp.CMD_NO_OP", max_delay=0.1) + fprime_test_api.send_and_assert_command("Ref.cmdDisp.CMD_NO_OP", max_delay=0.1) assert fprime_test_api.get_command_test_history().size() == 1 - fprime_test_api.send_and_assert_command("cmdDisp.CMD_NO_OP", max_delay=0.1) + fprime_test_api.send_and_assert_command("Ref.cmdDisp.CMD_NO_OP", max_delay=0.1) assert fprime_test_api.get_command_test_history().size() == 2 @@ -91,9 +92,11 @@ def test_send_command_args(fprime_test_api): Tests command send, dispatch, and receipt using send_and_assert command with a pair of NO-OP string commands. """ for count, value in enumerate(["Test String 1", "Some other string"], 1): - events = [fprime_test_api.get_event_pred("cmdDisp.NoOpStringReceived", [value])] + events = [ + fprime_test_api.get_event_pred("Ref.cmdDisp.NoOpStringReceived", [value]) + ] fprime_test_api.send_and_assert_command( - "cmdDisp.CMD_NO_OP_STRING", + "Ref.cmdDisp.CMD_NO_OP_STRING", [ value, ], @@ -112,15 +115,15 @@ def test_send_and_assert_no_op(fprime_test_api): length = 100 failed = 0 evr_seq = [ - "cmdDisp.OpCodeDispatched", - "cmdDisp.NoOpReceived", - "cmdDisp.OpCodeCompleted", + "Ref.cmdDisp.OpCodeDispatched", + "Ref.cmdDisp.NoOpReceived", + "Ref.cmdDisp.OpCodeCompleted", ] any_reordered = False dropped = False for i in range(0, length): results = fprime_test_api.send_and_await_event( - "cmdDisp.CMD_NO_OP", events=evr_seq, timeout=25 + "Ref.cmdDisp.CMD_NO_OP", events=evr_seq, timeout=25 ) msg = "Send and assert NO_OP Trial #{}".format(i) if not fprime_test_api.test_assert(len(results) == 3, msg, True): @@ -167,7 +170,7 @@ def test_bd_cycles_ascending(fprime_test_api): length = 60 count_pred = predicates.greater_than(length - 1) results = fprime_test_api.await_telemetry_count( - count_pred, "blockDrv.BD_Cycles", timeout=length + count_pred, "Ref.blockDrv.BD_Cycles", timeout=length ) last = None reordered = False @@ -227,8 +230,8 @@ def test_active_logger_filter(fprime_test_api): # Drain time for dispatch events time.sleep(10) - fprime_test_api.send_and_assert_command("cmdDisp.CMD_NO_OP") - fprime_test_api.send_and_assert_command("cmdDisp.CMD_NO_OP") + fprime_test_api.send_and_assert_command("Ref.cmdDisp.CMD_NO_OP") + fprime_test_api.send_and_assert_command("Ref.cmdDisp.CMD_NO_OP") time.sleep(0.5) @@ -239,8 +242,8 @@ def test_active_logger_filter(fprime_test_api): # Drain time for dispatch events time.sleep(10) fprime_test_api.clear_histories() - fprime_test_api.send_command("cmdDisp.CMD_NO_OP") - fprime_test_api.send_command("cmdDisp.CMD_NO_OP") + fprime_test_api.send_command("Ref.cmdDisp.CMD_NO_OP") + fprime_test_api.send_command("Ref.cmdDisp.CMD_NO_OP") time.sleep(0.5) @@ -253,17 +256,17 @@ def test_active_logger_filter(fprime_test_api): def test_signal_generation(fprime_test_api): """Tests the behavior of signal gen component""" fprime_test_api.send_and_assert_command( - "SG4.SignalGen_Settings", [1, 5, 0, "SQUARE"] + "Ref.SG4.SignalGen_Settings", [1, 5, 0, "SQUARE"] ) # First telemetry item should fill only the first slot of the history history = [0, 0, 0, 5] pair_history = [{"time": 0, "value": value} for value in history] info = {"type": "SQUARE", "history": history, "pairHistory": pair_history} - fprime_test_api.send_and_assert_command("SG4.SignalGen_Toggle") - fprime_test_api.assert_telemetry("SG4.History", history, timeout=6) - fprime_test_api.assert_telemetry("SG4.PairHistory", pair_history, timeout=1) - fprime_test_api.assert_telemetry("SG4.Info", info, timeout=1) - fprime_test_api.send_and_assert_command("SG4.SignalGen_Toggle") + fprime_test_api.send_and_assert_command("Ref.SG4.SignalGen_Toggle") + fprime_test_api.assert_telemetry("Ref.SG4.History", history, timeout=6) + fprime_test_api.assert_telemetry("Ref.SG4.PairHistory", pair_history, timeout=1) + fprime_test_api.assert_telemetry("Ref.SG4.Info", info, timeout=1) + fprime_test_api.send_and_assert_command("Ref.SG4.SignalGen_Toggle") def test_seqgen(fprime_test_api): @@ -282,5 +285,5 @@ def test_seqgen(fprime_test_api): == 0 ), "Failed to run fprime-seqgen" fprime_test_api.send_and_assert_command( - "cmdSeq.CS_RUN", args=["/tmp/ref_test_int.bin", "BLOCK"], max_delay=5 + "Ref.cmdSeq.CS_RUN", args=["/tmp/ref_test_int.bin", "BLOCK"], max_delay=5 ) diff --git a/Ref/test/int/test_seq.seq b/Ref/test/int/test_seq.seq index 480ef0b32f..c80b1f5578 100644 --- a/Ref/test/int/test_seq.seq +++ b/Ref/test/int/test_seq.seq @@ -1,6 +1,6 @@ ; A test sequence ; -R00:00:00 cmdDisp.CMD_NO_OP +R00:00:00 Ref.cmdDisp.CMD_NO_OP ; Let's try out some commands with arguments -R00:00:01.050 cmdDisp.CMD_NO_OP_STRING "Awesome string!"; \ No newline at end of file +R00:00:01.050 Ref.cmdDisp.CMD_NO_OP_STRING "Awesome string!"; \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 1915d23228..0d1607c003 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,20 +18,20 @@ fprime-fpl-convert-xml==1.0.3 fprime-fpl-extract-xml==1.0.3 fprime-fpl-layout==1.0.3 fprime-fpl-write-pic==1.0.3 -fprime-fpp-check==2.1.0 -fprime-fpp-depend==2.1.0 -fprime-fpp-filenames==2.1.0 -fprime-fpp-format==2.1.0 -fprime-fpp-from-xml==2.1.0 -fprime-fpp-locate-defs==2.1.0 -fprime-fpp-locate-uses==2.1.0 -fprime-fpp-syntax==2.1.0 -fprime-fpp-to-cpp==2.1.0 -fprime-fpp-to-dict==2.1.0 -fprime-fpp-to-json==2.1.0 -fprime-fpp-to-xml==2.1.0 -fprime-gds==v3.4.4a2 -fprime-tools==v3.4.5a1 +fprime-fpp-check==2.2.0a1 +fprime-fpp-depend==2.2.0a1 +fprime-fpp-filenames==2.2.0a1 +fprime-fpp-format==2.2.0a1 +fprime-fpp-from-xml==2.2.0a1 +fprime-fpp-locate-defs==2.2.0a1 +fprime-fpp-locate-uses==2.2.0a1 +fprime-fpp-syntax==2.2.0a1 +fprime-fpp-to-cpp==2.2.0a1 +fprime-fpp-to-dict==2.2.0a1 +fprime-fpp-to-json==2.2.0a1 +fprime-fpp-to-xml==2.2.0a1 +fprime-gds==3.4.4a3 +fprime-tools==3.4.4 fprime-visual==1.0.2 gcovr==6.0 idna==3.4