Loading nixos/tests/frr.nix +88 −79 Original line number Diff line number Diff line Loading @@ -5,10 +5,12 @@ # # 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.config.networking.interfaces.${iface}.ipv4.addresses).address; ospfConf1 = '' router ospf Loading Loading @@ -48,7 +50,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 +69,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 @@ -108,4 +116,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 +88 −79 Original line number Diff line number Diff line Loading @@ -5,10 +5,12 @@ # # 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.config.networking.interfaces.${iface}.ipv4.addresses).address; ospfConf1 = '' router ospf Loading Loading @@ -48,7 +50,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 +69,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 @@ -108,4 +116,5 @@ import ./make-test-python.nix ({ pkgs, ... }: with subtest("Test ICMP"): client.wait_until_succeeds("ping -4 -c 3 server >&2") ''; }) } )