Loading nixos/tests/frr.nix +87 −79 Original line number Diff line number Diff line Loading @@ -5,10 +5,11 @@ # # All interfaces are in OSPF Area 0. import ./make-test-python.nix ({ pkgs, ... }: import ./make-test-python.nix ( { pkgs, ... }: let ifAddr = node: iface: (pkgs.lib.head node.config.networking.interfaces.${iface}.ipv4.addresses).address; ifAddr = node: iface: (pkgs.lib.head node.networking.interfaces.${iface}.ipv4.addresses).address; ospfConf1 = '' router ospf Loading Loading @@ -48,7 +49,10 @@ import ./make-test-python.nix ({ pkgs, ... }: router1 = { ... }: { virtualisation.vlans = [ 1 2 ]; virtualisation.vlans = [ 1 2 ]; boot.kernel.sysctl."net.ipv4.ip_forward" = "1"; networking.firewall.extraCommands = "iptables -A nixos-fw -i eth2 -p ospfigp -j ACCEPT"; services.frr = { Loading @@ -64,7 +68,10 @@ import ./make-test-python.nix ({ pkgs, ... }: router2 = { ... }: { virtualisation.vlans = [ 3 2 ]; virtualisation.vlans = [ 3 2 ]; boot.kernel.sysctl."net.ipv4.ip_forward" = "1"; networking.firewall.extraCommands = "iptables -A nixos-fw -i eth2 -p ospfigp -j ACCEPT"; services.frr = { Loading Loading @@ -98,7 +105,7 @@ import ./make-test-python.nix ({ pkgs, ... }: for gw in client, router1, router2, server: gw.wait_for_unit("frr") router1.succeed("${nodes.router1.config.system.build.toplevel}/specialisation/ospf/bin/switch-to-configuration test >&2") router1.succeed("${nodes.router1.system.build.toplevel}/specialisation/ospf/bin/switch-to-configuration test >&2") with subtest("Wait for OSPF to form adjacencies"): for gw in router1, router2: Loading @@ -108,4 +115,5 @@ import ./make-test-python.nix ({ pkgs, ... }: with subtest("Test ICMP"): client.wait_until_succeeds("ping -4 -c 3 server >&2") ''; }) } ) Loading
nixos/tests/frr.nix +87 −79 Original line number Diff line number Diff line Loading @@ -5,10 +5,11 @@ # # All interfaces are in OSPF Area 0. import ./make-test-python.nix ({ pkgs, ... }: import ./make-test-python.nix ( { pkgs, ... }: let ifAddr = node: iface: (pkgs.lib.head node.config.networking.interfaces.${iface}.ipv4.addresses).address; ifAddr = node: iface: (pkgs.lib.head node.networking.interfaces.${iface}.ipv4.addresses).address; ospfConf1 = '' router ospf Loading Loading @@ -48,7 +49,10 @@ import ./make-test-python.nix ({ pkgs, ... }: router1 = { ... }: { virtualisation.vlans = [ 1 2 ]; virtualisation.vlans = [ 1 2 ]; boot.kernel.sysctl."net.ipv4.ip_forward" = "1"; networking.firewall.extraCommands = "iptables -A nixos-fw -i eth2 -p ospfigp -j ACCEPT"; services.frr = { Loading @@ -64,7 +68,10 @@ import ./make-test-python.nix ({ pkgs, ... }: router2 = { ... }: { virtualisation.vlans = [ 3 2 ]; virtualisation.vlans = [ 3 2 ]; boot.kernel.sysctl."net.ipv4.ip_forward" = "1"; networking.firewall.extraCommands = "iptables -A nixos-fw -i eth2 -p ospfigp -j ACCEPT"; services.frr = { Loading Loading @@ -98,7 +105,7 @@ import ./make-test-python.nix ({ pkgs, ... }: for gw in client, router1, router2, server: gw.wait_for_unit("frr") router1.succeed("${nodes.router1.config.system.build.toplevel}/specialisation/ospf/bin/switch-to-configuration test >&2") router1.succeed("${nodes.router1.system.build.toplevel}/specialisation/ospf/bin/switch-to-configuration test >&2") with subtest("Wait for OSPF to form adjacencies"): for gw in router1, router2: Loading @@ -108,4 +115,5 @@ import ./make-test-python.nix ({ pkgs, ... }: with subtest("Test ICMP"): client.wait_until_succeeds("ping -4 -c 3 server >&2") ''; }) } )