From 75cfa31b9d5ef8cd1a89e8609ef09c9853113910 Mon Sep 17 00:00:00 2001 From: Collin Date: Mon, 25 May 2026 15:58:04 -0500 Subject: [PATCH 01/19] changed rtc tests to assert --- .../test/int/rtc_test.py | 24 ++++++++++++------- lib/zephyr-workspace/zephyr | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/PROVESFlightControllerReference/test/int/rtc_test.py b/PROVESFlightControllerReference/test/int/rtc_test.py index ff40c16f..b42d26d0 100644 --- a/PROVESFlightControllerReference/test/int/rtc_test.py +++ b/PROVESFlightControllerReference/test/int/rtc_test.py @@ -274,11 +274,13 @@ def test_05_rtc_alarm_set_and_trigger(fprime_test_api: IntegrationTestAPI, start fprime_test_api.send_command(f"{rtcManager}.ALARM_SET", [alarm_time_data_str]) # Assert that we receive an AlarmTriggered event within 10 seconds - fprime_test_api.await_event(f"{rtcManager}.AlarmTriggered", timeout=10) + fprime_test_api.assert_event( + f"{rtcManager}.AlarmTriggered", start="NOW", timeout=10 + ) # make sure the alarm is gone fprime_test_api.send_command(f"{rtcManager}.ALARM_LIST") - fprime_test_api.await_event(f"{rtcManager}.AlarmNotSet", timeout=10) + fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start="NOW", timeout=10) # cancellation test @@ -304,7 +306,9 @@ def test_06_rtc_alarm_cancellation(fprime_test_api: IntegrationTestAPI, start_gd # Cancel the alarm immediately fprime_test_api.send_command(f"{rtcManager}.ALARM_CANCEL") - fprime_test_api.await_event(f"{rtcManager}.AlarmTriggered", timeout=10) + fprime_test_api.assert_event( + f"{rtcManager}.AlarmTriggered", start="NOW", timeout=10 + ) # validation test @@ -318,7 +322,9 @@ def test_07_rtc_alarm_cancel_no_alarm_set( # validate that cancel doesn't work without an alarm being present fprime_test_api.send_command(f"{rtcManager}.ALARM_CANCEL", [0]) - fprime_test_api.await_event(f"{rtcManager}.AlarmNotCanceled", timeout=10) + fprime_test_api.assert_event( + f"{rtcManager}.AlarmNotCanceled", start="NOW", timeout=10 + ) # list test @@ -329,7 +335,7 @@ def test_08_rtc_alarm_list(fprime_test_api: IntegrationTestAPI, start_gds): fprime_test_api.clear_histories() fprime_test_api.send_command(f"{rtcManager}.ALARM_LIST") - fprime_test_api.await_event(f"{rtcManager}.AlarmNotSet", timeout=10) + fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start="NOW", timeout=10) # Set an alarm for 5 seconds in the future alarm_time = datetime.now(timezone.utc) + timedelta(seconds=5) @@ -345,7 +351,7 @@ def test_08_rtc_alarm_list(fprime_test_api: IntegrationTestAPI, start_gds): fprime_test_api.send_command(f"{rtcManager}.ALARM_SET", [alarm_time_data_str]) fprime_test_api.send_command(f"{rtcManager}.ALARM_LIST") - fprime_test_api.await_event(f"{rtcManager}.AlarmSet", timeout=10) + fprime_test_api.assert_event(f"{rtcManager}.AlarmSet", start="NOW", timeout=10) def test_09_set_alarm_in_past(fprime_test_api: IntegrationTestAPI, start_gds): @@ -364,7 +370,7 @@ def test_09_set_alarm_in_past(fprime_test_api: IntegrationTestAPI, start_gds): fprime_test_api.send_command(f"{rtcManager}.ALARM_SET", [alarm_time_data_str]) # Assert that we receive an AlarmNotSet event within 10 seconds - fprime_test_api.await_event(f"{rtcManager}.AlarmNotSet", timeout=10) + fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start="NOW", timeout=10) def test_10_double_set_test(fprime_test_api: IntegrationTestAPI, start_gds): @@ -382,11 +388,11 @@ def test_10_double_set_test(fprime_test_api: IntegrationTestAPI, start_gds): alarm_time_data_str = json.dumps(alarm_time_data) fprime_test_api.send_command(f"{rtcManager}.ALARM_SET", [alarm_time_data_str]) # Assert that we receive an AlarmSet event within 10 seconds - fprime_test_api.await_event(f"{rtcManager}.AlarmSet", timeout=10) + fprime_test_api.assert_event(f"{rtcManager}.AlarmSet", start="NOW", timeout=10) # Double set the alarm alarm_time = datetime.now(timezone.utc) + timedelta(seconds=5) alarm_time_data_str = json.dumps(alarm_time_data) fprime_test_api.send_command(f"{rtcManager}.ALARM_SET", [alarm_time_data_str]) # Assert that we receive an AlarmNotSet event within 10 seconds - fprime_test_api.await_event(f"{rtcManager}.AlarmNotSet", timeout=10) + fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start="NOW", timeout=10) diff --git a/lib/zephyr-workspace/zephyr b/lib/zephyr-workspace/zephyr index 3568e1b6..684c9e8f 160000 --- a/lib/zephyr-workspace/zephyr +++ b/lib/zephyr-workspace/zephyr @@ -1 +1 @@ -Subproject commit 3568e1b6d5cdd51a6b964a2a1d6d29200fea2056 +Subproject commit 684c9e8f32e4373a21098559f748f06915f950c9 From f385b3a27b29efdc3804db251b9197ad8c8c0d19 Mon Sep 17 00:00:00 2001 From: Collin Date: Mon, 25 May 2026 16:02:27 -0500 Subject: [PATCH 02/19] updated rtc tests to use assert --- lib/zephyr-workspace/zephyr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/zephyr-workspace/zephyr b/lib/zephyr-workspace/zephyr index 3568e1b6..684c9e8f 160000 --- a/lib/zephyr-workspace/zephyr +++ b/lib/zephyr-workspace/zephyr @@ -1 +1 @@ -Subproject commit 3568e1b6d5cdd51a6b964a2a1d6d29200fea2056 +Subproject commit 684c9e8f32e4373a21098559f748f06915f950c9 From bfc9356c9156c8943bbe7f4ffedce91768618e90 Mon Sep 17 00:00:00 2001 From: Collin Date: Mon, 25 May 2026 16:39:44 -0500 Subject: [PATCH 03/19] Updated code --- .../test/int/rtc_test.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/PROVESFlightControllerReference/test/int/rtc_test.py b/PROVESFlightControllerReference/test/int/rtc_test.py index b42d26d0..7d1e4fb8 100644 --- a/PROVESFlightControllerReference/test/int/rtc_test.py +++ b/PROVESFlightControllerReference/test/int/rtc_test.py @@ -375,8 +375,8 @@ def test_09_set_alarm_in_past(fprime_test_api: IntegrationTestAPI, start_gds): def test_10_double_set_test(fprime_test_api: IntegrationTestAPI, start_gds): """Ensure that double setting an alarm will result in a rejection from the system""" - # Set an alarm for 5 seconds in the future - alarm_time = datetime.now(timezone.utc) + timedelta(seconds=5) + # Set an alarm for 60 seconds in the future + alarm_time = datetime.now(timezone.utc) + timedelta(seconds=60) alarm_time_data = dict( Year=alarm_time.year, Month=alarm_time.month, @@ -391,8 +391,19 @@ def test_10_double_set_test(fprime_test_api: IntegrationTestAPI, start_gds): fprime_test_api.assert_event(f"{rtcManager}.AlarmSet", start="NOW", timeout=10) # Double set the alarm - alarm_time = datetime.now(timezone.utc) + timedelta(seconds=5) + alarm_time = datetime.now(timezone.utc) + timedelta(seconds=60) + alarm_time_data = dict( + Year=alarm_time.year, + Month=alarm_time.month, + Day=alarm_time.day, + Hour=alarm_time.hour, + Minute=alarm_time.minute, + Second=alarm_time.second, + ) alarm_time_data_str = json.dumps(alarm_time_data) fprime_test_api.send_command(f"{rtcManager}.ALARM_SET", [alarm_time_data_str]) # Assert that we receive an AlarmNotSet event within 10 seconds fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start="NOW", timeout=10) + + # Clean up: cancel the alarm + fprime_test_api.send_command(f"{rtcManager}.ALARM_CANCEL") From 4d14cf5799e0aa8e9c2c3e8ce9c88621442a0fde Mon Sep 17 00:00:00 2001 From: Michael Pham <61564344+Mikefly123@users.noreply.github.com> Date: Thu, 28 May 2026 18:34:29 -0700 Subject: [PATCH 04/19] Revert Zephyr to What's on Main --- lib/zephyr-workspace/zephyr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/zephyr-workspace/zephyr b/lib/zephyr-workspace/zephyr index 684c9e8f..3568e1b6 160000 --- a/lib/zephyr-workspace/zephyr +++ b/lib/zephyr-workspace/zephyr @@ -1 +1 @@ -Subproject commit 684c9e8f32e4373a21098559f748f06915f950c9 +Subproject commit 3568e1b6d5cdd51a6b964a2a1d6d29200fea2056 From 435ce42fdcaed197cf0558642360a9579aa591b7 Mon Sep 17 00:00:00 2001 From: Michael Pham <61564344+Mikefly123@users.noreply.github.com> Date: Thu, 28 May 2026 18:52:34 -0700 Subject: [PATCH 05/19] Change order of TMP112 to Run Last --- .../test/int/{tmp112_test.py => z-tmp112_test.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename PROVESFlightControllerReference/test/int/{tmp112_test.py => z-tmp112_test.py} (100%) diff --git a/PROVESFlightControllerReference/test/int/tmp112_test.py b/PROVESFlightControllerReference/test/int/z-tmp112_test.py similarity index 100% rename from PROVESFlightControllerReference/test/int/tmp112_test.py rename to PROVESFlightControllerReference/test/int/z-tmp112_test.py From a10dd96874935697ee29c9a2d81a319beed202bf Mon Sep 17 00:00:00 2001 From: Collin Date: Mon, 20 Jul 2026 02:48:08 -0500 Subject: [PATCH 06/19] fix test #6 --- .../test/int/rtc_test.py | 13 ++++++++++--- lib/fprime-zephyr | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/PROVESFlightControllerReference/test/int/rtc_test.py b/PROVESFlightControllerReference/test/int/rtc_test.py index 432c9127..28def1a2 100644 --- a/PROVESFlightControllerReference/test/int/rtc_test.py +++ b/PROVESFlightControllerReference/test/int/rtc_test.py @@ -340,9 +340,16 @@ def test_06_rtc_alarm_cancellation(fprime_test_api: IntegrationTestAPI, start_gd # Cancel the alarm immediately fprime_test_api.send_command(f"{rtcManager}.ALARM_CANCEL") - fprime_test_api.assert_event( - f"{rtcManager}.AlarmTriggered", start="NOW", timeout=10 - ) + with pytest.raises(AssertionError): + fprime_test_api.assert_event( + f"{rtcManager}.AlarmTriggered", start="NOW", timeout=10 + ) + + fprime_test_api.assert_event(f"{rtcManager}.AlarmCanceled", start="NOW", timeout=10) + + # make sure the alarm is gone + fprime_test_api.send_command(f"{rtcManager}.ALARM_LIST") + fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start="NOW", timeout=10) # validation test diff --git a/lib/fprime-zephyr b/lib/fprime-zephyr index 31399714..1e6a1a77 160000 --- a/lib/fprime-zephyr +++ b/lib/fprime-zephyr @@ -1 +1 @@ -Subproject commit 313997144363ea930af66e86b52d43537cf7f489 +Subproject commit 1e6a1a7736ea77d6a080e56e65f849899771efb0 From 9a031e78f6e55388eaeae85bef658230b31b2da7 Mon Sep 17 00:00:00 2001 From: Collin Date: Mon, 20 Jul 2026 02:55:28 -0500 Subject: [PATCH 07/19] Submodule branch switch --- lib/fprime-zephyr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fprime-zephyr b/lib/fprime-zephyr index 1e6a1a77..171c8cce 160000 --- a/lib/fprime-zephyr +++ b/lib/fprime-zephyr @@ -1 +1 @@ -Subproject commit 1e6a1a7736ea77d6a080e56e65f849899771efb0 +Subproject commit 171c8cce7800c8d20cc5f49cdd562023cf6cc098 From 12478c0dcb50df688877315ce0e72c4cde02bb5d Mon Sep 17 00:00:00 2001 From: Collin Date: Mon, 20 Jul 2026 14:19:43 -0500 Subject: [PATCH 08/19] test bug fix --- PROVESFlightControllerReference/test/int/rtc_test.py | 4 ++-- lib/fprime-zephyr | 2 +- lib/zephyr-workspace/zephyr | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PROVESFlightControllerReference/test/int/rtc_test.py b/PROVESFlightControllerReference/test/int/rtc_test.py index 28def1a2..f79b6e1f 100644 --- a/PROVESFlightControllerReference/test/int/rtc_test.py +++ b/PROVESFlightControllerReference/test/int/rtc_test.py @@ -340,13 +340,13 @@ def test_06_rtc_alarm_cancellation(fprime_test_api: IntegrationTestAPI, start_gd # Cancel the alarm immediately fprime_test_api.send_command(f"{rtcManager}.ALARM_CANCEL") + fprime_test_api.assert_event(f"{rtcManager}.AlarmCanceled", start="NOW", timeout=10) + with pytest.raises(AssertionError): fprime_test_api.assert_event( f"{rtcManager}.AlarmTriggered", start="NOW", timeout=10 ) - fprime_test_api.assert_event(f"{rtcManager}.AlarmCanceled", start="NOW", timeout=10) - # make sure the alarm is gone fprime_test_api.send_command(f"{rtcManager}.ALARM_LIST") fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start="NOW", timeout=10) diff --git a/lib/fprime-zephyr b/lib/fprime-zephyr index 76435099..171c8cce 160000 --- a/lib/fprime-zephyr +++ b/lib/fprime-zephyr @@ -1 +1 @@ -Subproject commit 7643509983ecf853818a4f4fd6188b83d1e8293f +Subproject commit 171c8cce7800c8d20cc5f49cdd562023cf6cc098 diff --git a/lib/zephyr-workspace/zephyr b/lib/zephyr-workspace/zephyr index 1f6485ec..3568e1b6 160000 --- a/lib/zephyr-workspace/zephyr +++ b/lib/zephyr-workspace/zephyr @@ -1 +1 @@ -Subproject commit 1f6485eca25431b5ff27ce9a754218c9e559bbbb +Subproject commit 3568e1b6d5cdd51a6b964a2a1d6d29200fea2056 From 0d02d0b1ecc91de9457cba96d23b529d8f7e3c2f Mon Sep 17 00:00:00 2001 From: Collin Date: Sun, 2 Aug 2026 00:50:31 -0500 Subject: [PATCH 09/19] cleanup --- .../test/int/{z-tmp112_test.py => tmp112_test.py} | 0 lib/fprime | 2 +- lib/fprime-extras | 2 +- lib/fprime-zephyr | 2 +- lib/zephyr-workspace/zephyr | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename PROVESFlightControllerReference/test/int/{z-tmp112_test.py => tmp112_test.py} (100%) diff --git a/PROVESFlightControllerReference/test/int/z-tmp112_test.py b/PROVESFlightControllerReference/test/int/tmp112_test.py similarity index 100% rename from PROVESFlightControllerReference/test/int/z-tmp112_test.py rename to PROVESFlightControllerReference/test/int/tmp112_test.py diff --git a/lib/fprime b/lib/fprime index f67b68fd..8a62e455 160000 --- a/lib/fprime +++ b/lib/fprime @@ -1 +1 @@ -Subproject commit f67b68fdb611dd900922939b8a0404ab1008f957 +Subproject commit 8a62e455a90b6d4f498c332d45d65a2a819988d8 diff --git a/lib/fprime-extras b/lib/fprime-extras index 982139f9..f4d4924f 160000 --- a/lib/fprime-extras +++ b/lib/fprime-extras @@ -1 +1 @@ -Subproject commit 982139f94ed833a5b3b97bab903b97e05f385b26 +Subproject commit f4d4924f0b9bd472b52f310041516dd309f9b26f diff --git a/lib/fprime-zephyr b/lib/fprime-zephyr index 171c8cce..60d395ed 160000 --- a/lib/fprime-zephyr +++ b/lib/fprime-zephyr @@ -1 +1 @@ -Subproject commit 171c8cce7800c8d20cc5f49cdd562023cf6cc098 +Subproject commit 60d395edfcca61843045962d1c262674e815008b diff --git a/lib/zephyr-workspace/zephyr b/lib/zephyr-workspace/zephyr index 3568e1b6..1f6485ec 160000 --- a/lib/zephyr-workspace/zephyr +++ b/lib/zephyr-workspace/zephyr @@ -1 +1 @@ -Subproject commit 3568e1b6d5cdd51a6b964a2a1d6d29200fea2056 +Subproject commit 1f6485eca25431b5ff27ce9a754218c9e559bbbb From 3cd67a9eb7fa15c651fcb8e0f5d396a950fce538 Mon Sep 17 00:00:00 2001 From: Collin Date: Sun, 2 Aug 2026 00:58:54 -0500 Subject: [PATCH 10/19] fixed sub --- lib/RadioLib | 2 +- lib/fprime | 2 +- lib/fprime-extras | 2 +- lib/zephyr-workspace/zephyr | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/RadioLib b/lib/RadioLib index 3a5dac09..0795caa4 160000 --- a/lib/RadioLib +++ b/lib/RadioLib @@ -1 +1 @@ -Subproject commit 3a5dac095d9f4c823fdc8a9e8f8e427244134981 +Subproject commit 0795caa41c6350a2f862137cfc22528c2aaad2bc diff --git a/lib/fprime b/lib/fprime index 8a62e455..264bb83c 160000 --- a/lib/fprime +++ b/lib/fprime @@ -1 +1 @@ -Subproject commit 8a62e455a90b6d4f498c332d45d65a2a819988d8 +Subproject commit 264bb83c96ef65c693c687fce50e94af942905f0 diff --git a/lib/fprime-extras b/lib/fprime-extras index f4d4924f..1d82b88c 160000 --- a/lib/fprime-extras +++ b/lib/fprime-extras @@ -1 +1 @@ -Subproject commit f4d4924f0b9bd472b52f310041516dd309f9b26f +Subproject commit 1d82b88c11c40136988586c9b55e7b597ff98095 diff --git a/lib/zephyr-workspace/zephyr b/lib/zephyr-workspace/zephyr index 1f6485ec..e201b84b 160000 --- a/lib/zephyr-workspace/zephyr +++ b/lib/zephyr-workspace/zephyr @@ -1 +1 @@ -Subproject commit 1f6485eca25431b5ff27ce9a754218c9e559bbbb +Subproject commit e201b84b04e4fab1844658e71da0b7e340f1cc82 From 16468ad680c785ce8e27e94899dd6f36641831f1 Mon Sep 17 00:00:00 2001 From: Nate Gay Date: Sun, 2 Aug 2026 08:20:03 +0200 Subject: [PATCH 11/19] Replace usages of start=NOW --- .../test/int/rtc_test.py | 46 ++++++++++++++----- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/PROVESFlightControllerReference/test/int/rtc_test.py b/PROVESFlightControllerReference/test/int/rtc_test.py index 91b416ca..dd120450 100644 --- a/PROVESFlightControllerReference/test/int/rtc_test.py +++ b/PROVESFlightControllerReference/test/int/rtc_test.py @@ -302,16 +302,19 @@ def test_05_rtc_alarm_set_and_trigger(fprime_test_api: IntegrationTestAPI, start Second=alarm_time.second, ) alarm_time_data_str = json.dumps(alarm_time_data) + start: TimeType = TimeType().set_datetime( + datetime.now(), time_base=TimeType.TimeBase("TB_DONT_CARE") + ) fprime_test_api.send_command(f"{rtcManager}.ALARM_SET", [alarm_time_data_str]) # Assert that we receive an AlarmTriggered event within 10 seconds fprime_test_api.assert_event( - f"{rtcManager}.AlarmTriggered", start="NOW", timeout=10 + f"{rtcManager}.AlarmTriggered", start=start, timeout=10 ) # make sure the alarm is gone fprime_test_api.send_command(f"{rtcManager}.ALARM_LIST") - fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start="NOW", timeout=10) + fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start=start, timeout=10) # cancellation test @@ -335,21 +338,24 @@ def test_06_rtc_alarm_cancellation(fprime_test_api: IntegrationTestAPI, start_gd Second=alarm_time.second, ) alarm_time_data_str = json.dumps(alarm_time_data) + start: TimeType = TimeType().set_datetime( + datetime.now(), time_base=TimeType.TimeBase("TB_DONT_CARE") + ) fprime_test_api.send_command(f"{rtcManager}.ALARM_SET", [alarm_time_data_str]) # Cancel the alarm immediately fprime_test_api.send_command(f"{rtcManager}.ALARM_CANCEL") - fprime_test_api.assert_event(f"{rtcManager}.AlarmCanceled", start="NOW", timeout=10) + fprime_test_api.assert_event(f"{rtcManager}.AlarmCanceled", start=start, timeout=10) with pytest.raises(AssertionError): fprime_test_api.assert_event( - f"{rtcManager}.AlarmTriggered", start="NOW", timeout=10 + f"{rtcManager}.AlarmTriggered", start=start, timeout=10 ) # make sure the alarm is gone fprime_test_api.send_command(f"{rtcManager}.ALARM_LIST") - fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start="NOW", timeout=10) + fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start=start, timeout=10) # validation test @@ -365,9 +371,12 @@ def test_07_rtc_alarm_cancel_no_alarm_set( fprime_test_api.clear_histories() # validate that cancel doesn't work without an alarm being present + start: TimeType = TimeType().set_datetime( + datetime.now(), time_base=TimeType.TimeBase("TB_DONT_CARE") + ) fprime_test_api.send_command(f"{rtcManager}.ALARM_CANCEL", [0]) fprime_test_api.assert_event( - f"{rtcManager}.AlarmNotCanceled", start="NOW", timeout=10 + f"{rtcManager}.AlarmNotCanceled", start=start, timeout=10 ) @@ -381,8 +390,11 @@ def test_08_rtc_alarm_list(fprime_test_api: IntegrationTestAPI, start_gds): # Clear histories fprime_test_api.clear_histories() + start: TimeType = TimeType().set_datetime( + datetime.now(), time_base=TimeType.TimeBase("TB_DONT_CARE") + ) fprime_test_api.send_command(f"{rtcManager}.ALARM_LIST") - fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start="NOW", timeout=10) + fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start=start, timeout=10) # Set an alarm for 5 seconds in the future alarm_time = datetime.now(timezone.utc) + timedelta(seconds=5) @@ -397,8 +409,11 @@ def test_08_rtc_alarm_list(fprime_test_api: IntegrationTestAPI, start_gds): alarm_time_data_str = json.dumps(alarm_time_data) fprime_test_api.send_command(f"{rtcManager}.ALARM_SET", [alarm_time_data_str]) + start = TimeType().set_datetime( + datetime.now(), time_base=TimeType.TimeBase("TB_DONT_CARE") + ) fprime_test_api.send_command(f"{rtcManager}.ALARM_LIST") - fprime_test_api.assert_event(f"{rtcManager}.AlarmSet", start="NOW", timeout=10) + fprime_test_api.assert_event(f"{rtcManager}.AlarmSet", start=start, timeout=10) @pytest.mark.uart_only( @@ -417,10 +432,13 @@ def test_09_set_alarm_in_past(fprime_test_api: IntegrationTestAPI, start_gds): Second=alarm_time.second, ) alarm_time_data_str = json.dumps(alarm_time_data) + start: TimeType = TimeType().set_datetime( + datetime.now(), time_base=TimeType.TimeBase("TB_DONT_CARE") + ) fprime_test_api.send_command(f"{rtcManager}.ALARM_SET", [alarm_time_data_str]) # Assert that we receive an AlarmNotSet event within 10 seconds - fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start="NOW", timeout=10) + fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start=start, timeout=10) @pytest.mark.uart_only( @@ -439,9 +457,12 @@ def test_10_double_set_test(fprime_test_api: IntegrationTestAPI, start_gds): Second=alarm_time.second, ) alarm_time_data_str = json.dumps(alarm_time_data) + start: TimeType = TimeType().set_datetime( + datetime.now(), time_base=TimeType.TimeBase("TB_DONT_CARE") + ) fprime_test_api.send_command(f"{rtcManager}.ALARM_SET", [alarm_time_data_str]) # Assert that we receive an AlarmSet event within 10 seconds - fprime_test_api.assert_event(f"{rtcManager}.AlarmSet", start="NOW", timeout=10) + fprime_test_api.assert_event(f"{rtcManager}.AlarmSet", start=start, timeout=10) # Double set the alarm alarm_time = datetime.now(timezone.utc) + timedelta(seconds=60) @@ -454,9 +475,12 @@ def test_10_double_set_test(fprime_test_api: IntegrationTestAPI, start_gds): Second=alarm_time.second, ) alarm_time_data_str = json.dumps(alarm_time_data) + start = TimeType().set_datetime( + datetime.now(), time_base=TimeType.TimeBase("TB_DONT_CARE") + ) fprime_test_api.send_command(f"{rtcManager}.ALARM_SET", [alarm_time_data_str]) # Assert that we receive an AlarmNotSet event within 10 seconds - fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start="NOW", timeout=10) + fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start=start, timeout=10) # Clean up: cancel the alarm fprime_test_api.send_command(f"{rtcManager}.ALARM_CANCEL") From 6803ab74506e97595c5b03bd0e95015b2ed3976a Mon Sep 17 00:00:00 2001 From: Collin Date: Sun, 2 Aug 2026 20:29:24 -0500 Subject: [PATCH 12/19] Eliminate test 6 race condition --- .../test/int/rtc_test.py | 42 +++++++++++++------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/PROVESFlightControllerReference/test/int/rtc_test.py b/PROVESFlightControllerReference/test/int/rtc_test.py index dd120450..703dffd9 100644 --- a/PROVESFlightControllerReference/test/int/rtc_test.py +++ b/PROVESFlightControllerReference/test/int/rtc_test.py @@ -317,10 +317,7 @@ def test_05_rtc_alarm_set_and_trigger(fprime_test_api: IntegrationTestAPI, start fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start=start, timeout=10) -# cancellation test -@pytest.mark.uart_only( - reason="This test sets the RTC time which triggers the #402 / #404 bugs on PROVES Core Reference" -) +# Cancellation test def test_06_rtc_alarm_cancellation(fprime_test_api: IntegrationTestAPI, start_gds): """Test that we can cancel an RTC alarm and that it does not trigger""" @@ -338,25 +335,46 @@ def test_06_rtc_alarm_cancellation(fprime_test_api: IntegrationTestAPI, start_gd Second=alarm_time.second, ) alarm_time_data_str = json.dumps(alarm_time_data) + start: TimeType = TimeType().set_datetime( datetime.now(), time_base=TimeType.TimeBase("TB_DONT_CARE") ) + + # Send ALARM_SET and await AlarmSet to get the concrete alarm ID fprime_test_api.send_command(f"{rtcManager}.ALARM_SET", [alarm_time_data_str]) + alarm_set_evt: EventData = fprime_test_api.assert_event( + f"{rtcManager}.AlarmSet", start=start, timeout=5 + ) - # Cancel the alarm immediately - fprime_test_api.send_command(f"{rtcManager}.ALARM_CANCEL") + # Extract the alarm id from the AlarmSet event (first arg assumed to be the ID) + alarm_id = None + if alarm_set_evt and len(alarm_set_evt.args) > 0: + alarm_id = alarm_set_evt.args[0].val + + assert alarm_id is not None, "Failed to obtain alarm id from AlarmSet event" - fprime_test_api.assert_event(f"{rtcManager}.AlarmCanceled", start=start, timeout=10) + # Cancel the alarm by ID + fprime_test_api.send_command(f"{rtcManager}.ALARM_CANCEL", [alarm_id]) + # Assert AlarmCanceled references the same ID + alarm_canceled_evt: EventData = fprime_test_api.assert_event( + f"{rtcManager}.AlarmCanceled", start=start, timeout=5 + ) + assert alarm_canceled_evt.args and alarm_canceled_evt.args[0].val == alarm_id, ( + f"AlarmCanceled id {alarm_canceled_evt.args[0].val} did not match expected {alarm_id}" + ) + + # Wait until after the scheduled alarm time to ensure it would have fired if not canceled + remaining = (alarm_time - datetime.now(timezone.utc)).total_seconds() + if remaining > 0: + time.sleep(remaining + 1) + + # Verify no AlarmTriggered for this alarm id (assert that assert_event times out) with pytest.raises(AssertionError): fprime_test_api.assert_event( - f"{rtcManager}.AlarmTriggered", start=start, timeout=10 + f"{rtcManager}.AlarmTriggered", start=start, timeout=3 ) - # make sure the alarm is gone - fprime_test_api.send_command(f"{rtcManager}.ALARM_LIST") - fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start=start, timeout=10) - # validation test @pytest.mark.uart_only( From 6c9a18144eb18efc0045c38d9fe38d729bf7fd8e Mon Sep 17 00:00:00 2001 From: Collin Date: Sun, 2 Aug 2026 21:25:08 -0500 Subject: [PATCH 13/19] mark uart --- PROVESFlightControllerReference/test/int/rtc_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PROVESFlightControllerReference/test/int/rtc_test.py b/PROVESFlightControllerReference/test/int/rtc_test.py index 703dffd9..d7736fd5 100644 --- a/PROVESFlightControllerReference/test/int/rtc_test.py +++ b/PROVESFlightControllerReference/test/int/rtc_test.py @@ -318,6 +318,9 @@ def test_05_rtc_alarm_set_and_trigger(fprime_test_api: IntegrationTestAPI, start # Cancellation test +@pytest.mark.uart_only( + reason="This test sets the RTC time which triggers the #402 / #404 bugs on PROVES Core Reference" +) def test_06_rtc_alarm_cancellation(fprime_test_api: IntegrationTestAPI, start_gds): """Test that we can cancel an RTC alarm and that it does not trigger""" From 6243eaabbc48fa8067eb41dbb3f5e7436e57a785 Mon Sep 17 00:00:00 2001 From: Collin Date: Sun, 2 Aug 2026 21:41:07 -0500 Subject: [PATCH 14/19] increased buffer time --- PROVESFlightControllerReference/test/int/rtc_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PROVESFlightControllerReference/test/int/rtc_test.py b/PROVESFlightControllerReference/test/int/rtc_test.py index d7736fd5..7957aad1 100644 --- a/PROVESFlightControllerReference/test/int/rtc_test.py +++ b/PROVESFlightControllerReference/test/int/rtc_test.py @@ -328,7 +328,7 @@ def test_06_rtc_alarm_cancellation(fprime_test_api: IntegrationTestAPI, start_gd fprime_test_api.clear_histories() # Set an alarm for 5 seconds in the future - alarm_time = datetime.now(timezone.utc) + timedelta(seconds=5) + alarm_time = datetime.now(timezone.utc) + timedelta(seconds=10) alarm_time_data = dict( Year=alarm_time.year, Month=alarm_time.month, From ae116fcd1ed677038fdb73bc0ad5fff79b5581a7 Mon Sep 17 00:00:00 2001 From: Collin Date: Sun, 2 Aug 2026 23:10:26 -0500 Subject: [PATCH 15/19] big buffer --- PROVESFlightControllerReference/test/int/rtc_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PROVESFlightControllerReference/test/int/rtc_test.py b/PROVESFlightControllerReference/test/int/rtc_test.py index 7957aad1..ababe648 100644 --- a/PROVESFlightControllerReference/test/int/rtc_test.py +++ b/PROVESFlightControllerReference/test/int/rtc_test.py @@ -328,7 +328,7 @@ def test_06_rtc_alarm_cancellation(fprime_test_api: IntegrationTestAPI, start_gd fprime_test_api.clear_histories() # Set an alarm for 5 seconds in the future - alarm_time = datetime.now(timezone.utc) + timedelta(seconds=10) + alarm_time = datetime.now(timezone.utc) + timedelta(seconds=60) alarm_time_data = dict( Year=alarm_time.year, Month=alarm_time.month, From fe0dc4788c8cdd33ceb9f382047af04a1d14e246 Mon Sep 17 00:00:00 2001 From: Collin Date: Tue, 4 Aug 2026 00:28:20 -0500 Subject: [PATCH 16/19] RTC time assured --- PROVESFlightControllerReference/test/int/rtc_test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PROVESFlightControllerReference/test/int/rtc_test.py b/PROVESFlightControllerReference/test/int/rtc_test.py index ababe648..42f66c10 100644 --- a/PROVESFlightControllerReference/test/int/rtc_test.py +++ b/PROVESFlightControllerReference/test/int/rtc_test.py @@ -288,6 +288,12 @@ def test_04_sequence_cancellation_on_time_set( def test_05_rtc_alarm_set_and_trigger(fprime_test_api: IntegrationTestAPI, start_gds): """Test that we can set an RTC alarm and that it triggers at the correct time""" + # Ensure that we are not using proc time + proves_send_and_assert_command( + fprime_test_api, f"{rtcManager}.TIMEBASE_PRM_SET", ["TB_SC_TIME"] + ) + fprime_test_api.await_event(f"{rtcManager}.TimeBaseChanged", timeout=10) + # Clear histories fprime_test_api.clear_histories() From 02a605a87385311d7c464d258e48a67d62f37677 Mon Sep 17 00:00:00 2001 From: Collin Date: Tue, 4 Aug 2026 13:20:15 -0500 Subject: [PATCH 17/19] blocking added for 497 --- .../Components/Drv/RtcManager/RtcManager.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/PROVESFlightControllerReference/Components/Drv/RtcManager/RtcManager.cpp b/PROVESFlightControllerReference/Components/Drv/RtcManager/RtcManager.cpp index 0f1ec5d0..d0470e09 100644 --- a/PROVESFlightControllerReference/Components/Drv/RtcManager/RtcManager.cpp +++ b/PROVESFlightControllerReference/Components/Drv/RtcManager/RtcManager.cpp @@ -185,12 +185,29 @@ void RtcManager ::parameterUpdated(FwPrmIdType id) { this->cancelSequences_out(i); } + // Cancel pending alarm, as switching the timebase causes undefined behavior + uint16_t mask = 0; + int rc = rtc_alarm_set_time(this->m_dev, 0, mask, &this->m_alarm_time); + if (rc != 0) { + // log failure + this->log_WARNING_HI_AlarmHardwareError(0, rc); + return; + } + this->log_ACTIVITY_HI_TimeBaseChanged(timeBase); } void RtcManager ::ALARM_SET_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Drv::TimeData t) { - // retrieve info about current alarm + // Check the TimeBase parameter to ensure that we are using RTC time + Fw::ParamValid valid; + const Rtc::TimeBase timeBase = this->paramGet_TIMEBASE(valid); + if (timeBase == Rtc::TimeBase::TB_PROC_TIME) { + this->log_WARNING_HI_AlarmNotSet(t, EINVAL); + this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::EXECUTION_ERROR); + return; + } + // retrieve info about current alarm uint16_t mask = this->m_curr_mask; int rc = rtc_alarm_get_time(this->m_dev, 0, &mask, &this->m_alarm_time); From 081d2b0116efcb53f5636bc7b1358ff723b150d0 Mon Sep 17 00:00:00 2001 From: Collin Date: Tue, 4 Aug 2026 20:19:11 -0500 Subject: [PATCH 18/19] updated tests --- .../Components/Drv/RtcManager/RtcManager.cpp | 1 - .../test/int/rtc_test.py | 66 ++++++++++++++++++- 2 files changed, 64 insertions(+), 3 deletions(-) diff --git a/PROVESFlightControllerReference/Components/Drv/RtcManager/RtcManager.cpp b/PROVESFlightControllerReference/Components/Drv/RtcManager/RtcManager.cpp index d0470e09..388d20b4 100644 --- a/PROVESFlightControllerReference/Components/Drv/RtcManager/RtcManager.cpp +++ b/PROVESFlightControllerReference/Components/Drv/RtcManager/RtcManager.cpp @@ -191,7 +191,6 @@ void RtcManager ::parameterUpdated(FwPrmIdType id) { if (rc != 0) { // log failure this->log_WARNING_HI_AlarmHardwareError(0, rc); - return; } this->log_ACTIVITY_HI_TimeBaseChanged(timeBase); diff --git a/PROVESFlightControllerReference/test/int/rtc_test.py b/PROVESFlightControllerReference/test/int/rtc_test.py index 42f66c10..ae5f7b12 100644 --- a/PROVESFlightControllerReference/test/int/rtc_test.py +++ b/PROVESFlightControllerReference/test/int/rtc_test.py @@ -517,16 +517,78 @@ def test_10_double_set_test(fprime_test_api: IntegrationTestAPI, start_gds): def test_11_proc_toggle(fprime_test_api: IntegrationTestAPI, start_gds): """Test for events emitted by the timebase parameter""" + start: TimeType = TimeType().set_datetime( + datetime.now(), time_base=TimeType.TimeBase("TB_DONT_CARE") + ) + try: # Test that we can set timebase to proc time proves_send_and_assert_command( fprime_test_api, f"{rtcManager}.TIMEBASE_PRM_SET", ["TB_PROC_TIME"] ) # Assert that we receive a TimeBaseChanged event within 10 seconds - fprime_test_api.await_event(f"{rtcManager}.TimeBaseChanged", timeout=10) + fprime_test_api.assert_event( + f"{rtcManager}.TimeBaseChanged", start=start, timeout=10 + ) finally: # Restore spacecraft time so subsequent tests see RTC-backed timestamps proves_send_and_assert_command( fprime_test_api, f"{rtcManager}.TIMEBASE_PRM_SET", ["TB_SC_TIME"] ) - fprime_test_api.await_event(f"{rtcManager}.TimeBaseChanged", timeout=10) + fprime_test_api.assert_event( + f"{rtcManager}.TimeBaseChanged", start=start, timeout=10 + ) + + +@pytest.mark.uart_only(reason="Test functionality of the timebase parameter") +def test_12_param_update_conflict_check(fprime_test_api: IntegrationTestAPI, start_gds): + """Test for that RTC alarms no longer conflict with parameter updates and function properly""" + + start: TimeType = TimeType().set_datetime( + datetime.now(), time_base=TimeType.TimeBase("TB_DONT_CARE") + ) + + # Ensure that we are not using proc time + proves_send_and_assert_command( + fprime_test_api, f"{rtcManager}.TIMEBASE_PRM_SET", ["TB_SC_TIME"] + ) + fprime_test_api.assert_event( + f"{rtcManager}.TimeBaseChanged", start=start, timeout=10 + ) + + # Set an alarm for 60 seconds in the future + alarm_time = datetime.now(timezone.utc) + timedelta(seconds=60) + alarm_time_data = dict( + Year=alarm_time.year, + Month=alarm_time.month, + Day=alarm_time.day, + Hour=alarm_time.hour, + Minute=alarm_time.minute, + Second=alarm_time.second, + ) + alarm_time_data_str = json.dumps(alarm_time_data) + start: TimeType = TimeType().set_datetime( + datetime.now(), time_base=TimeType.TimeBase("TB_DONT_CARE") + ) + fprime_test_api.send_command(f"{rtcManager}.ALARM_SET", [alarm_time_data_str]) + + # Switch to proc time to make sure it is canceled + proves_send_and_assert_command( + fprime_test_api, f"{rtcManager}.TIMEBASE_PRM_SET", ["TB_SC_TIME"] + ) + + # make sure that it is gone + fprime_test_api.send_command(f"{rtcManager}.ALARM_LIST") + fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start=start, timeout=10) + + # Make sure we cannot set while in proc time + fprime_test_api.send_command(f"{rtcManager}.ALARM_SET", [alarm_time_data_str]) + fprime_test_api.assert_event(f"{rtcManager}.AlarmNotSet", start=start, timeout=10) + + # Set time back to RTC to avoid ruining other tests + proves_send_and_assert_command( + fprime_test_api, f"{rtcManager}.TIMEBASE_PRM_SET", ["TB_SC_TIME"] + ) + fprime_test_api.assert_event( + f"{rtcManager}.TimeBaseChanged", start=start, timeout=10 + ) From 0ac06b07a49ddbf423b35c62ccaacaf16fc66109 Mon Sep 17 00:00:00 2001 From: Collin Date: Tue, 4 Aug 2026 20:25:51 -0500 Subject: [PATCH 19/19] functionality --- PROVESFlightControllerReference/test/int/rtc_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PROVESFlightControllerReference/test/int/rtc_test.py b/PROVESFlightControllerReference/test/int/rtc_test.py index ae5f7b12..edb5110e 100644 --- a/PROVESFlightControllerReference/test/int/rtc_test.py +++ b/PROVESFlightControllerReference/test/int/rtc_test.py @@ -570,7 +570,10 @@ def test_12_param_update_conflict_check(fprime_test_api: IntegrationTestAPI, sta start: TimeType = TimeType().set_datetime( datetime.now(), time_base=TimeType.TimeBase("TB_DONT_CARE") ) + + # Set an alarm fprime_test_api.send_command(f"{rtcManager}.ALARM_SET", [alarm_time_data_str]) + fprime_test_api.assert_event(f"{rtcManager}.AlarmSet", start=start, timeout=10) # Switch to proc time to make sure it is canceled proves_send_and_assert_command(