Revert "test_qcomgpsd: parametize tests" (#31441)

Revert "test_qcomgpsd: parametize tests (#31430)"

This reverts commit 29d2fa667dcb6617d947a6bc1e80479774396dc0.
old-commit-hash: 659cdec3d0
chrysler-long2
Justin Newberry 1 year ago committed by GitHub
parent 4101f3d725
commit 955508c7ab
  1. 31
      system/qcomgpsd/tests/test_qcomgpsd.py

@ -6,7 +6,6 @@ import time
import datetime
import unittest
import subprocess
from parameterized import parameterized
import cereal.messaging as messaging
from openpilot.system.qcomgpsd.qcomgpsd import at_cmd, wait_for_modem
@ -58,24 +57,24 @@ class TestRawgpsd(unittest.TestCase):
os.system("sudo systemctl restart ModemManager")
assert self._wait_for_output(30)
@parameterized.expand([(b,) for b in (True, False)])
def test_startup_time(self, internet):
if not internet:
os.system("sudo systemctl stop systemd-resolved")
with self.subTest(internet=internet):
def test_startup_time(self):
for internet in (True, False):
if not internet:
os.system("sudo systemctl stop systemd-resolved")
with self.subTest(internet=internet):
managed_processes['qcomgpsd'].start()
assert self._wait_for_output(7)
managed_processes['qcomgpsd'].stop()
def test_turns_off_gnss(self):
for s in (0.1, 1, 5):
managed_processes['qcomgpsd'].start()
assert self._wait_for_output(7)
time.sleep(s)
managed_processes['qcomgpsd'].stop()
@parameterized.expand([(t,) for t in (0.1, 1, 5)])
def test_turns_off_gnss(self, runtime):
managed_processes['qcomgpsd'].start()
time.sleep(runtime)
managed_processes['qcomgpsd'].stop()
ls = subprocess.check_output("mmcli -m any --location-status --output-json", shell=True, encoding='utf-8')
loc_status = json.loads(ls)
assert set(loc_status['modem']['location']['enabled']) <= {'3gpp-lac-ci'}
ls = subprocess.check_output("mmcli -m any --location-status --output-json", shell=True, encoding='utf-8')
loc_status = json.loads(ls)
assert set(loc_status['modem']['location']['enabled']) <= {'3gpp-lac-ci'}
def check_assistance(self, should_be_loaded):

Loading…
Cancel
Save