|
|
@ -40,14 +40,10 @@ class TestGPS(unittest.TestCase): |
|
|
|
if ublox_available: |
|
|
|
if ublox_available: |
|
|
|
raise unittest.SkipTest |
|
|
|
raise unittest.SkipTest |
|
|
|
|
|
|
|
|
|
|
|
@unittest.skip("Skip cold start test due to time") |
|
|
|
def test_a_quectel_cold_start(self): |
|
|
|
def test_quectel_cold_start(self): |
|
|
|
|
|
|
|
# delete assistance data to enforce cold start for GNSS |
|
|
|
# delete assistance data to enforce cold start for GNSS |
|
|
|
# testing shows that this takes up to 20min |
|
|
|
# testing shows that this takes up to 20min |
|
|
|
|
|
|
|
|
|
|
|
# invalidate supl setting, cannot be reset |
|
|
|
|
|
|
|
_, err = exec_mmcli("--location-set-supl-server=unittest:1") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_, err = exec_mmcli("--command='AT+QGPSDEL=0'") |
|
|
|
_, err = exec_mmcli("--command='AT+QGPSDEL=0'") |
|
|
|
assert len(err) == 0, f"GPSDEL failed: {err}" |
|
|
|
assert len(err) == 0, f"GPSDEL failed: {err}" |
|
|
|
|
|
|
|
|
|
|
@ -55,27 +51,6 @@ class TestGPS(unittest.TestCase): |
|
|
|
start_time = time.monotonic() |
|
|
|
start_time = time.monotonic() |
|
|
|
glo = messaging.sub_sock("gpsLocation", timeout=0.1) |
|
|
|
glo = messaging.sub_sock("gpsLocation", timeout=0.1) |
|
|
|
|
|
|
|
|
|
|
|
timeout = 10*60*25 # 25 minute |
|
|
|
|
|
|
|
timedout = wait_for_location(glo, timeout) |
|
|
|
|
|
|
|
managed_processes['rawgpsd'].stop() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assert timedout is False, "Waiting for location timed out (25min)!" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
duration = time.monotonic() - start_time |
|
|
|
|
|
|
|
assert duration < 50, f"Received GPS location {duration}!" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_a_quectel_cold_start_AGPS(self): |
|
|
|
|
|
|
|
_, err = exec_mmcli("--command='AT+QGPSDEL=0'") |
|
|
|
|
|
|
|
assert len(err) == 0, f"GPSDEL failed: {err}" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# setup AGPS |
|
|
|
|
|
|
|
exec_mmcli("--location-set-supl-server=supl.google.com:7276") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
managed_processes['rawgpsd'].start() |
|
|
|
|
|
|
|
start_time = time.monotonic() |
|
|
|
|
|
|
|
glo = messaging.sub_sock("gpsLocation", timeout=0.1) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
timeout = 10*60*3 # 3 minute |
|
|
|
timeout = 10*60*3 # 3 minute |
|
|
|
timedout = wait_for_location(glo, timeout) |
|
|
|
timedout = wait_for_location(glo, timeout) |
|
|
|
managed_processes['rawgpsd'].stop() |
|
|
|
managed_processes['rawgpsd'].stop() |
|
|
@ -87,15 +62,11 @@ class TestGPS(unittest.TestCase): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_b_quectel_startup(self): |
|
|
|
def test_b_quectel_startup(self): |
|
|
|
|
|
|
|
|
|
|
|
# setup AGPS |
|
|
|
|
|
|
|
exec_mmcli("--location-set-supl-server=supl.google.com:7276") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
managed_processes['rawgpsd'].start() |
|
|
|
managed_processes['rawgpsd'].start() |
|
|
|
start_time = time.monotonic() |
|
|
|
start_time = time.monotonic() |
|
|
|
glo = messaging.sub_sock("gpsLocation", timeout=0.1) |
|
|
|
glo = messaging.sub_sock("gpsLocation", timeout=0.1) |
|
|
|
|
|
|
|
|
|
|
|
timeout = 10*60*3 # 3 minute |
|
|
|
timeout = 10*60 # 1 minute |
|
|
|
timedout = wait_for_location(glo, timeout) |
|
|
|
timedout = wait_for_location(glo, timeout) |
|
|
|
managed_processes['rawgpsd'].stop() |
|
|
|
managed_processes['rawgpsd'].stop() |
|
|
|
|
|
|
|
|
|
|
|