feat: allow talkingq OTA domains
This commit is contained in:
@@ -23,6 +23,7 @@ BUILD_MACRO = ROOT / "ql-application/threadx/interface/custom_app/lib/hal/build_
|
||||
APP_MAKEFILE = ROOT / "ql-application/threadx/interface/custom_app/Makefile"
|
||||
MQTT_SOURCE = ROOT / "ql-application/threadx/interface/custom_app/mqtt.c"
|
||||
FULLOTA2_SOURCE = ROOT / "ql-application/threadx/interface/custom_app/ota_fullfota2.c"
|
||||
URL_POLICY_SOURCE = ROOT / "ql-application/threadx/interface/custom_app/ota_url_policy.c"
|
||||
LEGACY_HTTP_SOURCE = ROOT / "ql-application/threadx/interface/custom_app/http_aofei.c"
|
||||
|
||||
FLASH_SIZE = 0x400000
|
||||
@@ -146,11 +147,18 @@ def verify_fota_contract() -> None:
|
||||
makefile = APP_MAKEFILE.read_text(encoding="utf-8", errors="replace")
|
||||
if "ota_fullfota2.c" not in makefile:
|
||||
fail("minimal FULLOTA2 implementation is not part of the application build")
|
||||
if "ota_url_policy.c" not in makefile:
|
||||
fail("OTA URL policy is not part of the application build")
|
||||
mqtt = MQTT_SOURCE.read_text(encoding="utf-8", errors="replace")
|
||||
if "banban_fullfota2_start" not in mqtt:
|
||||
fail("MQTT OTA command does not start the local-staging FULLOTA2 path")
|
||||
if "ql_fullfota_app_start(cmd->params.ota.url)" in mqtt:
|
||||
fail("MQTT OTA command still invokes the legacy FULLOTA1 path")
|
||||
if "banban_ota_url_is_allowed" not in mqtt:
|
||||
fail("MQTT OTA command does not enforce the shared URL policy")
|
||||
url_policy = URL_POLICY_SOURCE.read_text(encoding="utf-8", errors="replace")
|
||||
if 'BANBAN_OTA_BASE_DOMAIN "talkingq.com"' not in url_policy:
|
||||
fail("OTA URL policy no longer allows the talkingq.com domain family")
|
||||
legacy_http = LEGACY_HTTP_SOURCE.read_text(encoding="utf-8", errors="replace")
|
||||
if "return ql_fullfota_app_start(url)" in legacy_http:
|
||||
fail("legacy HTTP polling path can still invoke FULLOTA1")
|
||||
|
||||
Reference in New Issue
Block a user