diff --git a/selfdrive/test/test_onroad.py b/selfdrive/test/test_onroad.py index e4f6bccf6c..841c77f142 100755 --- a/selfdrive/test/test_onroad.py +++ b/selfdrive/test/test_onroad.py @@ -3,6 +3,8 @@ import bz2 import math import json import os +import pathlib +import psutil import shutil import subprocess import time @@ -151,6 +153,8 @@ class TestOnroad(unittest.TestCase): cls.segments = cls.segments[:-1] finally: + cls.gpu_procs = {psutil.Process(int(f.name)).name() for f in pathlib.Path('/sys/devices/virtual/kgsl/kgsl/proc/').iterdir() if f.is_dir()} + if proc is not None: proc.terminate() if proc.wait(60) is None: @@ -296,6 +300,9 @@ class TestOnroad(unittest.TestCase): # expected to go up while the MSGQ buffers fill up self.assertLessEqual(max(mems) - min(mems), 3.0) + def test_gpu_usage(self): + self.assertEqual(self.gpu_procs, {"weston", "_ui", "mapsd", "camerad", "selfdrive.modeld.modeld"}) + def test_camera_processing_time(self): result = "\n" result += "------------------------------------------------\n"