Daynivo names for the files on the SD card and the command line tool
- daynivo-config.json, daynivo-authorized_keys and daynivo-network-reset on the boot partition; errors go to daynivo-config.error.txt. - daynivo-kiosk-ctl, with voxip-kiosk-ctl as a symlink to it. - The voxip-* names keep working, so existing SD cards and instructions stay valid; when both config files are present the Daynivo one is applied last. - Internal names (services, /etc/voxip-kiosk, user voxip) are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
348644a48a
commit
b0840d240e
17 files changed
+108
-76
No files matched your search
+28
-9
@@ -169,35 +169,54 @@ def test_boot_guard_rolls_back_and_honours_reset(helper, paths, boot):
|
||||
assert not any(c[0] == "nmcli" for c in helper.run.commands), "NetworkManager is not running yet at boot"
|
||||
|
||||
(paths.nm_connections_dir / "voxip-wlan0.nmconnection").write_text("x")
|
||||
(boot / "voxip-network-reset").write_text("")
|
||||
(boot / "daynivo-network-reset").write_text("")
|
||||
assert helper.network_boot_guard() == {"reset": True}
|
||||
assert not (paths.nm_connections_dir / "voxip-wlan0.nmconnection").exists()
|
||||
assert not (boot / "voxip-network-reset").exists()
|
||||
assert not (boot / "daynivo-network-reset").exists()
|
||||
assert old.exists()
|
||||
|
||||
|
||||
def test_boot_guard_still_honours_the_old_reset_name(helper, paths, boot):
|
||||
(paths.nm_connections_dir / "voxip-eth0.nmconnection").write_text("x")
|
||||
(boot / "voxip-network-reset").write_text("")
|
||||
assert helper.network_boot_guard() == {"reset": True}
|
||||
assert not (paths.nm_connections_dir / "voxip-eth0.nmconnection").exists()
|
||||
assert not (boot / "voxip-network-reset").exists()
|
||||
|
||||
|
||||
def test_boot_import_applies_config(helper, paths, boot):
|
||||
(boot / "voxip-config.json").write_text(json.dumps({"device_name": "Hal", "url": "https://klant.example.nl/display/hal?token=x",
|
||||
"hostname": "hal", "rotation": 90}))
|
||||
assert helper.boot_import() == {"imported": ["voxip-config.json"]}
|
||||
(boot / "daynivo-config.json").write_text(json.dumps({"device_name": "Hal", "url": "https://klant.example.nl/display/hal?token=x",
|
||||
"hostname": "hal", "rotation": 90}))
|
||||
assert helper.boot_import() == {"imported": ["daynivo-config.json"]}
|
||||
conf = load_config(paths.config_file)
|
||||
assert conf["device_name"] == "Hal" and conf["rotation"] == 90 and conf["url"].startswith("https://klant")
|
||||
assert (helper.etc / "hostname").read_text() == "hal\n"
|
||||
assert (boot / "daynivo-config.json.applied").exists()
|
||||
|
||||
|
||||
def test_boot_import_still_accepts_the_old_names(helper, paths, boot):
|
||||
(boot / "voxip-config.json").write_text(json.dumps({"device_name": "Oud", "rotation": 180}))
|
||||
(boot / "daynivo-config.json").write_text(json.dumps({"device_name": "Nieuw"}))
|
||||
assert helper.boot_import() == {"imported": ["voxip-config.json", "daynivo-config.json"]}
|
||||
conf = load_config(paths.config_file)
|
||||
assert conf["device_name"] == "Nieuw" and conf["rotation"] == 180 # the Daynivo file is applied last
|
||||
assert (boot / "voxip-config.json.applied").exists()
|
||||
|
||||
|
||||
def test_boot_import_rejects_invalid_config(helper, paths, boot):
|
||||
before = paths.config_file.read_text()
|
||||
(boot / "voxip-config.json").write_text(json.dumps({"url": "http://onveilig.example"}))
|
||||
(boot / "daynivo-config.json").write_text(json.dumps({"url": "http://onveilig.example"}))
|
||||
helper.boot_import()
|
||||
assert paths.config_file.read_text() == before
|
||||
assert (boot / "voxip-config.json.rejected").exists()
|
||||
assert "HTTPS" in (boot / "voxip-config.error.txt").read_text()
|
||||
assert (boot / "daynivo-config.json.rejected").exists()
|
||||
assert "HTTPS" in (boot / "daynivo-config.error.txt").read_text()
|
||||
|
||||
|
||||
def test_boot_import_rejects_non_key_lines(helper, boot):
|
||||
(boot / "voxip-authorized_keys").write_text("dit is geen sleutel\n")
|
||||
(boot / "daynivo-authorized_keys").write_text("dit is geen sleutel\n")
|
||||
(boot / "voxip-authorized_keys").write_text("ook geen sleutel\n")
|
||||
helper.boot_import()
|
||||
assert (boot / "daynivo-authorized_keys.rejected").exists()
|
||||
assert (boot / "voxip-authorized_keys.rejected").exists()
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user