Unverified Commit 99ad7da9 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

nixosTests.frr: fix node.router.config warning (#354710)

parents a44589e1 1cc81439
Loading
Loading
Loading
Loading
+87 −79
Original line number Diff line number Diff line
@@ -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
@@ -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 = {
@@ -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 = {
@@ -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:
@@ -108,4 +115,5 @@ import ./make-test-python.nix ({ pkgs, ... }:
        with subtest("Test ICMP"):
            client.wait_until_succeeds("ping -4 -c 3 server >&2")
      '';
    })
  }
)