File tree Expand file tree Collapse file tree 3 files changed +53
-7
lines changed
FprimeZephyrReference/test/int Expand file tree Collapse file tree 3 files changed +53
-7
lines changed Original file line number Diff line number Diff line change 77import os
88import subprocess
99import time
10- from typing import List
1110
1211import pytest
1312from fprime_gds .common .data_types .ch_data import ChData
14- from fprime_gds .common .data_types .event_data import EventData
1513from fprime_gds .common .testing_fw .api import IntegrationTestAPI
1614
1715
@@ -20,14 +18,16 @@ def start_gds(fprime_test_api_session: IntegrationTestAPI):
2018 process = subprocess .Popen (["make" , "gds-integration" ], cwd = os .getcwd ())
2119
2220 gds_working = False
23- timeout_time = time .time () + 15
21+ timeout_time = time .time () + 30
2422 while time .time () < timeout_time :
25- data : List [ EventData ] = fprime_test_api_session . send_and_assert_command (
26- command = "CdhCore.cmdDisp.CMD_NO_OP"
27- )
28- if data != []:
23+ try :
24+ fprime_test_api_session . send_and_assert_command (
25+ command = "CdhCore.cmdDisp.CMD_NO_OP"
26+ )
2927 gds_working = True
3028 break
29+ except Exception :
30+ time .sleep (1 )
3131 assert gds_working
3232
3333 yield
Original file line number Diff line number Diff line change 55"""
66
77import json
8+ import os
9+ import subprocess
810import time
911from datetime import datetime , timezone
1012
1618from fprime_gds .common .testing_fw .api import IntegrationTestAPI
1719
1820
21+ @pytest .fixture (scope = "session" , autouse = True )
22+ def start_gds (fprime_test_api_session : IntegrationTestAPI ):
23+ process = subprocess .Popen (["make" , "gds-integration" ], cwd = os .getcwd ())
24+
25+ gds_working = False
26+ timeout_time = time .time () + 30
27+ while time .time () < timeout_time :
28+ try :
29+ fprime_test_api_session .send_and_assert_command (
30+ command = "CdhCore.cmdDisp.CMD_NO_OP"
31+ )
32+ gds_working = True
33+ break
34+ except Exception :
35+ time .sleep (1 )
36+ assert gds_working
37+
38+ yield
39+ process .kill ()
40+
41+
1942@pytest .fixture (autouse = True )
2043def set_now_time (fprime_test_api : IntegrationTestAPI ):
2144 """Fixture to set the time to test runner's time after each test"""
Original file line number Diff line number Diff line change 44Integration tests for the Watchdog component.
55"""
66
7+ import os
8+ import subprocess
79import time
810
911import pytest
1012from fprime_gds .common .data_types .ch_data import ChData
1113from fprime_gds .common .testing_fw .api import IntegrationTestAPI
1214
1315
16+ @pytest .fixture (scope = "session" , autouse = True )
17+ def start_gds (fprime_test_api_session : IntegrationTestAPI ):
18+ process = subprocess .Popen (["make" , "gds-integration" ], cwd = os .getcwd ())
19+
20+ gds_working = False
21+ timeout_time = time .time () + 30
22+ while time .time () < timeout_time :
23+ try :
24+ fprime_test_api_session .send_and_assert_command (
25+ command = "CdhCore.cmdDisp.CMD_NO_OP"
26+ )
27+ gds_working = True
28+ break
29+ except Exception :
30+ time .sleep (1 )
31+ assert gds_working
32+
33+ yield
34+ process .kill ()
35+
36+
1437@pytest .fixture (autouse = True )
1538def ensure_watchdog_running (fprime_test_api : IntegrationTestAPI ):
1639 """Fixture to ensure watchdog is started before and after each test"""
You can’t perform that action at this time.
0 commit comments