1 import ./make-test-python.nix ({ pkgs, lib, ...} :
4 chipVersion = pkgs.python311Packages.home-assistant-chip-core.version;
8 name = "matter-server";
9 meta.maintainers = with lib.maintainers; [ leonm1 ];
12 machine = { config, ... }: {
13 services.matter-server = {
20 testScript = /* python */ ''
23 machine.wait_for_unit("matter-server.service")
24 machine.wait_for_open_port(1234)
26 with subtest("Check websocket server initialized"):
27 output = machine.succeed("echo \"\" | ${pkgs.websocat}/bin/websocat ws://localhost:1234/ws")
30 assert '"sdk_version": "${chipVersion}"' in output, (
31 'CHIP version \"${chipVersion}\" not present in websocket message'
34 assert '"fabric_id": 1' in output, (
35 "fabric_id not propagated to server"
38 with subtest("Check storage directory is created"):
39 machine.succeed("ls /var/lib/matter-server/chip.json")
41 with subtest("Check systemd hardening"):
42 _, output = machine.execute("systemd-analyze security matter-server.service | grep -v '✓'")