diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index b583e3b390c3..05b83af64526 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -1303,7 +1303,7 @@ in { yggdrasil = handleTest ./yggdrasil.nix {}; your_spotify = handleTest ./your_spotify.nix {}; zammad = handleTest ./zammad.nix {}; - zenohd = handleTest ./zenohd.nix {}; + zenohd = runTest ./zenohd.nix; zeronet-conservancy = runTest ./zeronet-conservancy.nix; zfs = handleTest ./zfs.nix {}; zigbee2mqtt_1 = runTest { diff --git a/nixos/tests/zenohd.nix b/nixos/tests/zenohd.nix index 0aeca6b61818..ee1959e86c48 100644 --- a/nixos/tests/zenohd.nix +++ b/nixos/tests/zenohd.nix @@ -1,71 +1,68 @@ -import ./make-test-python.nix ( - { pkgs, lib, ... }: +{ pkgs, lib, ... }: - { - name = "zenohd"; - meta.maintainers = [ lib.maintainers.markuskowa ]; +{ + name = "zenohd"; + meta.maintainers = [ lib.maintainers.markuskowa ]; - nodes = { - router = - { - pkgs, - lib, - config, - ... - }: - { - networking.firewall.allowedTCPPorts = [ - 7447 # zenohd default port - config.services.zenohd.settings.plugins.mqtt.port - config.services.zenohd.settings.plugins.webserver.http_port + nodes = { + router = + { + pkgs, + config, + ... + }: + { + networking.firewall.allowedTCPPorts = [ + 7447 # zenohd default port + config.services.zenohd.settings.plugins.mqtt.port + config.services.zenohd.settings.plugins.webserver.http_port + ]; + + services.zenohd = { + enable = true; + + plugins = with pkgs; [ + zenoh-plugin-mqtt + zenoh-plugin-webserver ]; - services.zenohd = { - enable = true; + backends = with pkgs; [ + zenoh-backend-filesystem + zenoh-backend-rocksdb + ]; - plugins = with pkgs; [ - zenoh-plugin-mqtt - zenoh-plugin-webserver - ]; - - backends = with pkgs; [ - zenoh-backend-filesystem - zenoh-backend-rocksdb - ]; - - settings = { - plugins = { - mqtt = { - port = 1883; - allow = ".*"; + settings = { + plugins = { + mqtt = { + port = 1883; + allow = ".*"; + }; + webserver.http_port = 8000; + storage_manager = { + volumes = { + fs = { }; + rocksdb = { }; }; - webserver.http_port = 8000; - storage_manager = { - volumes = { - fs = { }; - rocksdb = { }; + storages = { + mem = { + key_expr = "mem/**"; + volume = "memory"; }; - storages = { - mem = { - key_expr = "mem/**"; - volume = "memory"; + fs = { + key_expr = "fs/**"; + volume = { + id = "fs"; + dir = "zenoh-fs"; + strip_prefix = "fs"; }; - fs = { - key_expr = "fs/**"; - volume = { - id = "fs"; - dir = "zenoh-fs"; - strip_prefix = "fs"; - }; - }; - rocksdb = { - key_expr = "rocksdb/**"; - volume = { - id = "rocksdb"; - dir = "zenoh-rocksdb"; - strip_prefix = "rocksdb"; - create_db = true; - }; + }; + rocksdb = { + key_expr = "rocksdb/**"; + volume = { + id = "rocksdb"; + dir = "zenoh-rocksdb"; + strip_prefix = "rocksdb"; + create_db = true; }; }; }; @@ -73,21 +70,21 @@ import ./make-test-python.nix ( }; }; }; - - client = { - environment.systemPackages = [ - pkgs.mosquitto - ]; }; + + client = { + environment.systemPackages = [ + pkgs.mosquitto + ]; }; + }; - testScript = '' - router.wait_for_unit("zenohd.service") - client.wait_for_unit("multi-user.target") + testScript = '' + router.wait_for_unit("zenohd.service") + client.wait_for_unit("multi-user.target") - for be in ["fs", "rocksdb", "mem" ]: - client.succeed(f"mosquitto_pub -h router -t {be}/test -m hello") - client.succeed(f"curl router:8000/{be}/test | grep hello") - ''; - } -) + for be in ["fs", "rocksdb", "mem" ]: + client.succeed(f"mosquitto_pub -h router -t {be}/test -m hello") + client.succeed(f"curl router:8000/{be}/test | grep hello") + ''; +}