]> git.proxmox.com Git - mirror_frr.git/blob - tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py
Merge pull request #12578 from Pdoijode/evpn-mac-vni-det
[mirror_frr.git] / tests / topotests / bgp_l3vpn_to_bgp_vrf / scripts / check_linux_mpls.py
1 from lib.lutil import luCommand, luLast
2 from lib import topotest
3
4 ret = luCommand(
5 "r2",
6 "ip -M route show",
7 r"\d*(?= via inet 10.0.2.4 dev r2-eth1)",
8 "wait",
9 "See mpls route to r4",
10 )
11 found = luLast()
12
13 if ret != False and found != None:
14 label4r4 = found.group(0)
15 luCommand("r2", "ip -M route show", ".", "pass", "See %s as label to r4" % label4r4)
16 ret = luCommand(
17 "r2",
18 "ip -M route show",
19 r"\d*(?= via inet 10.0.1.1 dev r2-eth0)",
20 "wait",
21 "See mpls route to r1",
22 )
23 found = luLast()
24
25 if ret != False and found != None:
26 label4r1 = found.group(0)
27 luCommand("r2", "ip -M route show", ".", "pass", "See %s as label to r1" % label4r1)
28
29 luCommand(
30 "r1",
31 "ip route show vrf r1-cust1",
32 "99.0.0.4",
33 "pass",
34 "VRF->MPLS PHP route installed",
35 )
36 luCommand(
37 "r4",
38 "ip route show vrf r4-cust2",
39 "99.0.0.1",
40 "pass",
41 "VRF->MPLS PHP route installed",
42 )
43
44 luCommand("r1", "ip -M route show", "101", "pass", "MPLS->VRF route installed")
45 luCommand("r4", "ip -M route show", "1041", "pass", "MPLS->VRF1 route installed")
46 luCommand("r4", "ip -M route show", "1042", "pass", "MPLS->VRF2 route installed")
47
48 luCommand(
49 "ce1",
50 "ping 99.0.0.4 -I 99.0.0.1 -c 1",
51 " 0. packet loss",
52 "wait",
53 "CE->CE (loopback) ping - l3vpn+zebra case",
54 )
55 # skip due to VRF weirdness
56 # luCommand('ce4', 'ping 99.0.0.1 -I 99.0.0.4 -c 1',
57 # ' 0. packet loss','wait','CE->CE (loopback) ping - l3vpn+zebra case')
58
59 luCommand(
60 "ce1",
61 "ping 99.0.0.4 -I 99.0.0.1 -c 1",
62 " 0. packet loss",
63 "wait",
64 "CE->CE (loopback) ping",
65 )
66 # luCommand('ce4', 'ping 99.0.0.1 -I 99.0.0.4 -c 1',
67 # ' 0. packet loss','wait','CE->CE (loopback) ping')
68
69 luCommand("r3", "ip -M route show", "103", "pass", "MPLS->VRF route installed")
70 luCommand(
71 "ce2",
72 "ping 99.0.0.3 -I 99.0.0.2 -c 1",
73 " 0. packet loss",
74 "wait",
75 "CE2->CE3 (loopback) ping",
76 )
77 luCommand(
78 "ce3",
79 "ping 99.0.0.4 -I 99.0.0.3 -c 1",
80 " 0. packet loss",
81 "wait",
82 "CE3->CE4 (loopback) ping",
83 )
84 luCommand(
85 "r1",
86 "ip vrf exec r1-cust1 ping 6.0.3.1 -I 10.4.5.6 -c 1",
87 " 0. packet loss",
88 "wait",
89 "R1(r1-cust1)->CE3/4 (loopback) ping",
90 )
91 luCommand(
92 "r1",
93 "ip vrf exec r1-cust1 ping 6.0.3.1 -I 10.4.5.6 -c 1",
94 " 0. packet loss",
95 "pass",
96 "R1(r1-cust1)->CE3/4 (loopback) ping",
97 )
98 luCommand(
99 "r1",
100 "ip vrf exec r1-cust5 ping 6.0.3.1 -I 29.0.0.1 -c 1",
101 " 0. packet loss",
102 "pass",
103 "R1(r1-cust5)->CE3/4 ( (loopback) ping",
104 )