1 import ./make-test-python.nix ({ lib, ...} : {
4 meta = with lib.maintainers; {
5 maintainers = [ offline ];
9 flannelConfig = { pkgs, ... } : {
16 network = "10.1.0.0/16";
18 etcd.endpoints = ["http://etcd:2379"];
21 networking.firewall.allowedUDPPorts = [ 8285 ];
28 listenClientUrls = ["http://0.0.0.0:2379"]; # requires ip-address for binding
29 listenPeerUrls = ["http://0.0.0.0:2380"]; # requires ip-address for binding
30 advertiseClientUrls = ["http://etcd:2379"];
31 initialAdvertisePeerUrls = ["http://etcd:2379"];
32 initialCluster = ["etcd=http://etcd:2379"];
36 networking.firewall.allowedTCPPorts = [ 2379 ];
39 node1 = flannelConfig;
40 node2 = flannelConfig;
46 node1.wait_for_unit("flannel.service")
47 node2.wait_for_unit("flannel.service")
49 node1.wait_until_succeeds("ip l show dev flannel0")
50 ip1 = node1.succeed("ip -4 addr show flannel0 | grep -oP '(?<=inet).*(?=/)'")
51 node2.wait_until_succeeds("ip l show dev flannel0")
52 ip2 = node2.succeed("ip -4 addr show flannel0 | grep -oP '(?<=inet).*(?=/)'")
54 node1.wait_until_succeeds(f"ping -c 1 {ip2}")
55 node2.wait_until_succeeds(f"ping -c 1 {ip1}")