1 { system ? builtins.currentSystem
3 , pkgs ? import ../.. { inherit system config; }
6 with import ../lib/testing-python.nix { inherit system pkgs; };
9 minimal = { config, ... }: {
10 services.teleport.enable = true;
13 client = { config, ... }: {
19 advertise_ip = "192.168.1.20";
20 auth_token = "8d1957b2-2ded-40e6-8297-d48156a898a9";
21 auth_servers = [ "192.168.1.10:3025" ];
22 log.severity = "DEBUG";
30 proxy_service.enabled = false;
31 auth_service.enabled = false;
34 networking.interfaces.eth1.ipv4.addresses = [{
35 address = "192.168.1.20";
40 server = { config, ... }: {
46 advertise_ip = "192.168.1.10";
48 ssh_service.enabled = true;
49 proxy_service.enabled = true;
52 tokens = [ "node:8d1957b2-2ded-40e6-8297-d48156a898a9" ];
56 insecure.enable = true;
59 firewall.allowedTCPPorts = [ 3025 ];
60 interfaces.eth1.ipv4.addresses = [{
61 address = "192.168.1.10";
69 # minimal setup should always work
70 name = "teleport-minimal-setup";
71 meta.maintainers = with pkgs.lib.maintainers; [ ymatsiuk ];
72 nodes = { inherit minimal; };
75 minimal.wait_for_open_port(3025)
76 minimal.wait_for_open_port(3080)
77 minimal.wait_for_open_port(3022)
82 # basic server and client test
83 name = "teleport-server-client";
84 meta.maintainers = with pkgs.lib.maintainers; [ ymatsiuk ];
85 nodes = { inherit server client; };
88 with subtest("teleport ready"):
89 server.wait_for_open_port(3025)
90 client.wait_for_open_port(3022)
92 with subtest("check applied configuration"):
93 server.wait_until_succeeds("tctl get nodes --format=json | ${pkgs.jq}/bin/jq -e '.[] | select(.spec.hostname==\"client\") | .metadata.labels.role==\"client\"'")
94 server.wait_for_open_port(3000)
95 client.succeed("journalctl -u teleport.service --grep='DEBU'")
96 server.succeed("journalctl -u teleport.service --grep='Starting teleport in insecure mode.'")