Record Safe Mode in the route settings snapshot

This commit is contained in:
firestar5683
2026-11-23 11:06:35 -06:00
parent 1c087154ae
commit ec4c158e20
9 changed files with 7 additions and 4 deletions
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -365,7 +365,7 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
{"TeslaPreAPPedalStartup", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION | DONT_LOG, BYTES}},
{"NAPRadarEnabled", {PERSISTENT, BOOL, "0"}},
{"NAPRadarBehindNosecone", {PERSISTENT, BOOL, "0"}},
{"SafeMode", {PERSISTENT | DONT_LOG, BOOL, "0"}},
{"SafeMode", {PERSISTENT, BOOL, "0"}},
{"CurveSpeedController", {PERSISTENT | DONT_LOG, BOOL, "0"}},
{"CurveSpeedControllerNoLead", {PERSISTENT | DONT_LOG, BOOL, "0"}},
{"ShowCSCStatus", {PERSISTENT | DONT_LOG, BOOL, "0"}},
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -159,7 +159,8 @@ class TestLoggerd(OpenpilotTestCase):
managed_processes["loggerd"].stop()
managed_processes["encoderd"].stop()
def test_init_data_values(self):
@parameterized.expand([(False,), (True,)])
def test_init_data_values(self, safe_mode):
os.environ["CLEAN"] = random.choice(["0", "1"])
dongle = ''.join(random.choice(string.printable) for n in range(random.randint(1, 100)))
@@ -175,6 +176,7 @@ class TestLoggerd(OpenpilotTestCase):
for k, _, v in fake_params:
params.put(k, v, block=True)
params.put("AccessToken", "abc", block=True)
params.put_bool("SafeMode", safe_mode, block=True)
lr = list(LogReader(str(self._gen_bootlog())))
initData = lr[0].initData
@@ -191,8 +193,9 @@ class TestLoggerd(OpenpilotTestCase):
# check params
logged_params = {entry.key: entry.value for entry in initData.params.entries}
expected_params = {k for k, _, __ in fake_params} | {'AccessToken', 'BootCount'}
expected_params = {k for k, _, __ in fake_params} | {'AccessToken', 'BootCount', 'SafeMode'}
assert set(logged_params.keys()) == expected_params, set(logged_params.keys()) ^ expected_params
assert logged_params['SafeMode'] == (b'1' if safe_mode else b'0')
assert logged_params['AccessToken'] == b'', f"DONT_LOG param value was logged: {repr(logged_params['AccessToken'])}"
for param_key, initData_key, v in fake_params:
assert getattr(initData, initData_key) == v
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "ed91c336a0b596acecd4dec0513b1cfab1e064e1e4c0774762777ec3fd632c7c", "schema_version": 1}
{"protected_inventory_sha256": "3dc50858b5c21512322e7fd153ab36d68e535f5bba17e873340a3fa73f441ad8", "schema_version": 1}