CANopen diagnostics and map data over HTTPS: /can.html (interfaces, nodes with heartbeat state and last EMCY, decoded signals, every COB-ID with role, count, rate and last data); signals can mark an invalid raw value (esphome-canopen's unknown) and NaN gives no value; the CAN reader never dies and a broken can.json only turns CAN off; the GNSS node mcu-stm32-xiao-c5-2 (0x21) and host networking for the car's server in docs; bin/pull-maps.sh pulls map data from GET /api/sync/maps(/file) with SYNC_TOKEN instead of rsync over SSH, resuming cut-off downloads
This commit is contained in:
1 parent
a3e5fefaf1
commit
6a0d6194fe
9 files changed
+365
-43
No files matched your search
+15
-1
@@ -144,6 +144,20 @@ class AppTest < Minitest::Test
|
||||
assert_equal 401, request.get("/api/sync/source/x").status
|
||||
assert_equal 401, request.post("/api/sync/apply", input: "{}").status
|
||||
assert_equal 401, request.put("/api/sync/source/x", input: "x").status
|
||||
assert_equal 401, request.get("/api/sync/maps", **logged_in_env).status
|
||||
assert_equal 401, request.get("/api/sync/maps/file", params: { "path" => "offline.pmtiles" }).status
|
||||
end
|
||||
|
||||
def test_map_data_offered_to_clients_is_only_the_map_files
|
||||
data = Maptool::App::DATA_DIR
|
||||
files = %w[terrain.pmtiles places/SK.sqlite places/.rsync-partial/SK.sqlite routing/tiles.tar.part routing/service.sh can.json]
|
||||
files.each { |f| FileUtils.mkdir_p(File.dirname(File.join(data, f))); File.write(File.join(data, f), "x") }
|
||||
offered = Maptool::App.map_sync_files
|
||||
assert_includes offered.keys, "terrain.pmtiles"
|
||||
assert_includes offered.keys, "places/SK.sqlite"
|
||||
refute(offered.keys.any? { |f| f.include?(".rsync-partial") || f.end_with?(".part") || %w[can.json routing/service.sh].include?(f) })
|
||||
ensure
|
||||
files.each { |f| FileUtils.rm_f(File.join(data, f)) }
|
||||
end
|
||||
|
||||
def test_the_sync_button_is_only_a_clients
|
||||
@@ -154,7 +168,7 @@ class AppTest < Minitest::Test
|
||||
|
||||
def test_can_requires_login_and_is_off_without_a_config
|
||||
assert_equal 401, request.get("/api/can").status
|
||||
assert_equal({ "interfaces" => {}, "nodes" => {}, "signals" => {}, "available" => false }, json_body(request.get("/api/can", **logged_in_env)))
|
||||
assert_equal({ "interfaces" => {}, "nodes" => {}, "signals" => {}, "frames" => [], "available" => false }, json_body(request.get("/api/can", **logged_in_env)))
|
||||
end
|
||||
|
||||
# MQTT messages land in the tracker / ITS-G5 parts of /api/live.
|
||||
|
||||
Reference in new issue
Block a user