tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
nixos/tests/fastnetmon-advanced: init
Yureka
2 years ago
f13a5196
bf5f01ee
+66
2 changed files
expand all
collapse all
unified
split
nixos
tests
all-tests.nix
fastnetmon-advanced.nix
+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
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
1
+
{ pkgs, lib, ... }:
2
2
+
3
3
+
{
4
4
+
name = "fastnetmon-advanced";
5
5
+
meta.maintainers = lib.teams.wdz.members;
6
6
+
7
7
+
nodes = {
8
8
+
bird = { ... }: {
9
9
+
networking.firewall.allowedTCPPorts = [ 179 ];
10
10
+
services.bird2 = {
11
11
+
enable = true;
12
12
+
config = ''
13
13
+
router id 192.168.1.1;
14
14
+
15
15
+
protocol bgp fnm {
16
16
+
local 192.168.1.1 as 64513;
17
17
+
neighbor 192.168.1.2 as 64514;
18
18
+
multihop;
19
19
+
ipv4 {
20
20
+
import all;
21
21
+
export none;
22
22
+
};
23
23
+
}
24
24
+
'';
25
25
+
};
26
26
+
};
27
27
+
fnm = { ... }: {
28
28
+
networking.firewall.allowedTCPPorts = [ 179 ];
29
29
+
services.fastnetmon-advanced = {
30
30
+
enable = true;
31
31
+
settings = {
32
32
+
networks_list = [ "172.23.42.0/24" ];
33
33
+
gobgp = true;
34
34
+
gobgp_flow_spec_announces = true;
35
35
+
};
36
36
+
bgpPeers = {
37
37
+
bird = {
38
38
+
local_asn = 64514;
39
39
+
remote_asn = 64513;
40
40
+
local_address = "192.168.1.2";
41
41
+
remote_address = "192.168.1.1";
42
42
+
43
43
+
description = "Bird";
44
44
+
ipv4_unicast = true;
45
45
+
multihop = true;
46
46
+
active = true;
47
47
+
};
48
48
+
};
49
49
+
};
50
50
+
};
51
51
+
};
52
52
+
53
53
+
testScript = { nodes, ... }: ''
54
54
+
start_all()
55
55
+
fnm.wait_for_unit("fastnetmon.service")
56
56
+
bird.wait_for_unit("bird2.service")
57
57
+
58
58
+
fnm.wait_until_succeeds('journalctl -eu fastnetmon.service | grep "BGP daemon restarted correctly"')
59
59
+
fnm.wait_until_succeeds("journalctl -eu gobgp.service | grep BGP_FSM_OPENCONFIRM")
60
60
+
bird.wait_until_succeeds("birdc show protocol fnm | grep Estab")
61
61
+
fnm.wait_until_succeeds('journalctl -eu fastnetmon.service | grep "API server listening"')
62
62
+
fnm.succeed("fcli set blackhole 172.23.42.123")
63
63
+
bird.succeed("birdc show route | grep 172.23.42.123")
64
64
+
'';
65
65
+
}