44Integration tests for the IMU Manager component.
55"""
66
7- import os
8- import subprocess
9- import time
10-
117import pytest
128from fprime_gds .common .data_types .ch_data import ChData
139from fprime_gds .common .testing_fw .api import IntegrationTestAPI
1410
1511
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-
3712@pytest .fixture (autouse = True )
3813def send_packet (fprime_test_api : IntegrationTestAPI ):
3914 """Fixture to clear histories and send the IMU packet before each test"""
@@ -43,7 +18,7 @@ def send_packet(fprime_test_api: IntegrationTestAPI):
4318 )
4419
4520
46- def test_01_acceleration_telemetry (fprime_test_api : IntegrationTestAPI ):
21+ def test_01_acceleration_telemetry (fprime_test_api : IntegrationTestAPI , start_gds ):
4722 """Test that we can get Acceleration telemetry"""
4823 result : ChData = fprime_test_api .assert_telemetry (
4924 "ReferenceDeployment.lsm6dsoManager.Acceleration" , start = "NOW" , timeout = 3
@@ -55,7 +30,7 @@ def test_01_acceleration_telemetry(fprime_test_api: IntegrationTestAPI):
5530 )
5631
5732
58- def test_02_angular_velocity_telemetry (fprime_test_api : IntegrationTestAPI ):
33+ def test_02_angular_velocity_telemetry (fprime_test_api : IntegrationTestAPI , start_gds ):
5934 """Test that we can get AngularVelocity telemetry"""
6035 result : ChData = fprime_test_api .assert_telemetry (
6136 "ReferenceDeployment.lsm6dsoManager.AngularVelocity" , start = "NOW" , timeout = 3
@@ -67,7 +42,7 @@ def test_02_angular_velocity_telemetry(fprime_test_api: IntegrationTestAPI):
6742 )
6843
6944
70- def test_03_temperature_telemetry (fprime_test_api : IntegrationTestAPI ):
45+ def test_03_temperature_telemetry (fprime_test_api : IntegrationTestAPI , start_gds ):
7146 """Test that we can get Temperature telemetry"""
7247 result : ChData = fprime_test_api .assert_telemetry (
7348 "ReferenceDeployment.lsm6dsoManager.Temperature" , start = "NOW" , timeout = 3
@@ -77,7 +52,7 @@ def test_03_temperature_telemetry(fprime_test_api: IntegrationTestAPI):
7752 assert reading != 0 , "Temperature reading should be non-zero"
7853
7954
80- def test_04_magnetic_field_telemetry (fprime_test_api : IntegrationTestAPI ):
55+ def test_04_magnetic_field_telemetry (fprime_test_api : IntegrationTestAPI , start_gds ):
8156 """Test that we can get MagneticField telemetry"""
8257 result : ChData = fprime_test_api .assert_telemetry (
8358 "ReferenceDeployment.lis2mdlManager.MagneticField" , start = "NOW" , timeout = 3
0 commit comments