1 import ./make-test-python.nix ({ lib, pkgs, ... }:
4 meta.maintainers = with lib.maintainers; [ azahi ];
14 unprivileged.configuration.services.endlessh.port = 2222;
16 privileged.configuration.services.endlessh.port = 22;
20 client = { pkgs, ... }: {
21 environment.systemPackages = with pkgs; [ curl netcat ];
26 def activate_specialisation(name: str):
27 server.succeed(f"/run/booted-system/specialisation/{name}/bin/switch-to-configuration test >&2")
31 with subtest("Unprivileged"):
32 activate_specialisation("unprivileged")
33 server.wait_for_unit("endlessh.service")
34 server.wait_for_open_port(2222)
35 client.succeed("nc -dvW5 server 2222")
37 with subtest("Privileged"):
38 activate_specialisation("privileged")
39 server.wait_for_unit("endlessh.service")
40 server.wait_for_open_port(22)
41 client.succeed("nc -dvW5 server 22")