lol

nixos/tests/fastnetmon-advanced: init

Yureka f13a5196 bf5f01ee

+66
+1
nixos/tests/all-tests.nix
··· 248 248 ec2-nixops = (handleTestOn ["x86_64-linux"] ./ec2.nix {}).boot-ec2-nixops or {}; 249 249 ecryptfs = handleTest ./ecryptfs.nix {}; 250 250 fscrypt = handleTest ./fscrypt.nix {}; 251 + fastnetmon-advanced = runTest ./fastnetmon-advanced.nix; 251 252 ejabberd = handleTest ./xmpp/ejabberd.nix {}; 252 253 elk = handleTestOn ["x86_64-linux"] ./elk.nix {}; 253 254 emacs-daemon = handleTest ./emacs-daemon.nix {};
+65
nixos/tests/fastnetmon-advanced.nix
··· 1 + { pkgs, lib, ... }: 2 + 3 + { 4 + name = "fastnetmon-advanced"; 5 + meta.maintainers = lib.teams.wdz.members; 6 + 7 + nodes = { 8 + bird = { ... }: { 9 + networking.firewall.allowedTCPPorts = [ 179 ]; 10 + services.bird2 = { 11 + enable = true; 12 + config = '' 13 + router id 192.168.1.1; 14 + 15 + protocol bgp fnm { 16 + local 192.168.1.1 as 64513; 17 + neighbor 192.168.1.2 as 64514; 18 + multihop; 19 + ipv4 { 20 + import all; 21 + export none; 22 + }; 23 + } 24 + ''; 25 + }; 26 + }; 27 + fnm = { ... }: { 28 + networking.firewall.allowedTCPPorts = [ 179 ]; 29 + services.fastnetmon-advanced = { 30 + enable = true; 31 + settings = { 32 + networks_list = [ "172.23.42.0/24" ]; 33 + gobgp = true; 34 + gobgp_flow_spec_announces = true; 35 + }; 36 + bgpPeers = { 37 + bird = { 38 + local_asn = 64514; 39 + remote_asn = 64513; 40 + local_address = "192.168.1.2"; 41 + remote_address = "192.168.1.1"; 42 + 43 + description = "Bird"; 44 + ipv4_unicast = true; 45 + multihop = true; 46 + active = true; 47 + }; 48 + }; 49 + }; 50 + }; 51 + }; 52 + 53 + testScript = { nodes, ... }: '' 54 + start_all() 55 + fnm.wait_for_unit("fastnetmon.service") 56 + bird.wait_for_unit("bird2.service") 57 + 58 + fnm.wait_until_succeeds('journalctl -eu fastnetmon.service | grep "BGP daemon restarted correctly"') 59 + fnm.wait_until_succeeds("journalctl -eu gobgp.service | grep BGP_FSM_OPENCONFIRM") 60 + bird.wait_until_succeeds("birdc show protocol fnm | grep Estab") 61 + fnm.wait_until_succeeds('journalctl -eu fastnetmon.service | grep "API server listening"') 62 + fnm.succeed("fcli set blackhole 172.23.42.123") 63 + bird.succeed("birdc show route | grep 172.23.42.123") 64 + ''; 65 + }