Skip to content

Commit 5f042e6

Browse files
committed
added test
1 parent f98d563 commit 5f042e6

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
"""
2+
watchdog_test.py:
3+
4+
Integration tests for the Watchdog component.
5+
"""
6+
7+
from fprime_gds.common.testing_fw.api import IntegrationTestAPI
8+
9+
10+
def test_01_start_timeout_watchdog(fprime_test_api: IntegrationTestAPI):
11+
fprime_test_api.send_and_assert_command(
12+
"ReferenceDeployment.burnwire.START_BURNWIRE", max_delay=2
13+
)
14+
15+
# should be on
16+
fprime_test_api.assert_event(
17+
"ReferenceDeployment.burnwire.SetBurnwireState", timeout=2
18+
)
19+
20+
# should be on
21+
fprime_test_api.assert_event(
22+
"ReferenceDeployment.burnwire.SafetyTimerStatus", timeout=30
23+
)
24+
yield
25+
# should be off
26+
fprime_test_api.assert_event(
27+
"ReferenceDeployment.burnwire.SafetyTimerStatus", timeout=30
28+
)
29+
# shoulf be off
30+
fprime_test_api.assert_event(
31+
"ReferenceDeployment.burnwire.SetBurnwireState", timeout=30
32+
)
33+
34+
35+
def test_02_start_stop_watchdog(fprime_test_api: IntegrationTestAPI):
36+
fprime_test_api.send_and_assert_command(
37+
"ReferenceDeployment.burnwire.START_BURNWIRE", max_delay=2
38+
)
39+
40+
# should be on
41+
fprime_test_api.assert_event(
42+
"ReferenceDeployment.burnwire.SetBurnwireState", timeout=2
43+
)
44+
45+
# should be on
46+
fprime_test_api.assert_event(
47+
"ReferenceDeployment.burnwire.SafetyTimerStatus", timeout=30
48+
)
49+
50+
fprime_test_api.send_and_assert_command(
51+
"ReferenceDeployment.burnwire.STOP_BURNWIRE", max_delay=2
52+
)
53+
54+
# should be off
55+
fprime_test_api.assert_event(
56+
"ReferenceDeployment.burnwire.SetBurnwireState", timeout=2
57+
)

0 commit comments

Comments
 (0)