Skip to content

Commit 211d927

Browse files
committed
Add tests for ShowBgpAddressFamily with arguments
1 parent d5cb74f commit 211d927

File tree

3 files changed

+287
-0
lines changed

3 files changed

+287
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"address_family": "ipv6 all",
3+
"community": "1234:1234",
4+
"exact_match": "exact_match"
5+
}
Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
expected_output = {
2+
'address_family': {
3+
'ipv6_all': {
4+
'bgp_table_version': 5530,
5+
'generic_scan_interval': 60,
6+
'local_as': 1234,
7+
'non_stop_routing': True,
8+
'nsr_initial_init_ver_status': 'reached',
9+
'nsr_initial_initsync_version': '7',
10+
'nsr_issu_sync_group_versions': '5530/0',
11+
'route_distinguisher': {
12+
'1234:1234': {
13+
'prefix': {
14+
'2001:0db8:85a3:0:0:0:0:1403::/48': {
15+
'index': {
16+
1: {
17+
'locprf': '0',
18+
'next_hop': '192.0.2.1',
19+
'origin_codes': 'i',
20+
'path': '0',
21+
'status_codes': '*>i',
22+
'weight': '100',
23+
},
24+
2: {
25+
'locprf': '0',
26+
'next_hop': '192.0.2.1',
27+
'origin_codes': 'i',
28+
'path': '0',
29+
'status_codes': '*i',
30+
'weight': '100',
31+
},
32+
},
33+
},
34+
'2001:0db8:85a3::/64': {
35+
'index': {
36+
1: {
37+
'locprf': '0',
38+
'next_hop': '192.0.2.1',
39+
'origin_codes': 'i',
40+
'path': '0',
41+
'status_codes': '*>i',
42+
'weight': '100',
43+
},
44+
2: {
45+
'locprf': '0',
46+
'next_hop': '192.0.2.1',
47+
'origin_codes': 'i',
48+
'path': '0',
49+
'status_codes': '*i',
50+
'weight': '100',
51+
},
52+
},
53+
},
54+
},
55+
},
56+
'1234:2505005': {
57+
'prefix': {
58+
'2001:0db8:85a3:0:0:0:0:6:10:205::/112': {
59+
'index': {
60+
1: {
61+
'locprf': '100',
62+
'metric': '4294967295',
63+
'next_hop': '192.0.2.2',
64+
'origin_codes': 'i',
65+
'path': '65031',
66+
'status_codes': '*>i',
67+
'weight': '0',
68+
},
69+
2: {
70+
'locprf': '100',
71+
'metric': '4294967295',
72+
'next_hop': '192.0.2.2',
73+
'origin_codes': 'i',
74+
'path': '65031',
75+
'status_codes': '*i',
76+
'weight': '0',
77+
},
78+
},
79+
},
80+
'2001:0db8:85a3:0:0:0:0:6:192:168:201::/112': {
81+
'index': {
82+
1: {
83+
'locprf': '100',
84+
'metric': '4294967295',
85+
'next_hop': '192.0.2.2',
86+
'origin_codes': 'i',
87+
'path': '65031',
88+
'status_codes': '*>i',
89+
'weight': '0',
90+
},
91+
2: {
92+
'locprf': '100',
93+
'metric': '4294967295',
94+
'next_hop': '192.0.2.2',
95+
'origin_codes': 'i',
96+
'path': '65031',
97+
'status_codes': '*i',
98+
'weight': '0',
99+
},
100+
},
101+
},
102+
'2001:0db8:85a3:0:0:0:0:6:195:113:123:128:0/112': {
103+
'index': {
104+
1: {
105+
'locprf': '100',
106+
'metric': '4294967295',
107+
'next_hop': '192.0.2.2',
108+
'origin_codes': 'i',
109+
'path': '65031',
110+
'status_codes': '*>i',
111+
'weight': '0',
112+
},
113+
2: {
114+
'locprf': '100',
115+
'metric': '4294967295',
116+
'next_hop': '192.0.2.2',
117+
'origin_codes': 'i',
118+
'path': '65031',
119+
'status_codes': '*i',
120+
'weight': '0',
121+
},
122+
},
123+
},
124+
'2001:0db8:85a3:0:0:0:0:6:195:113:123:80/125': {
125+
'index': {
126+
1: {
127+
'locprf': '100',
128+
'metric': '4294967295',
129+
'next_hop': '192.0.2.2',
130+
'origin_codes': 'i',
131+
'path': '65031',
132+
'status_codes': '*>i',
133+
'weight': '0',
134+
},
135+
2: {
136+
'locprf': '100',
137+
'metric': '4294967295',
138+
'next_hop': '192.0.2.2',
139+
'origin_codes': 'i',
140+
'path': '65031',
141+
'status_codes': '*i',
142+
'weight': '0',
143+
},
144+
},
145+
},
146+
'2001:0db8:85a3:0:0:0:0:6:195:113:123:96:0/112': {
147+
'index': {
148+
1: {
149+
'locprf': '100',
150+
'metric': '4294967295',
151+
'next_hop': '192.0.2.2',
152+
'origin_codes': 'i',
153+
'path': '65031',
154+
'status_codes': '*>i',
155+
'weight': '0',
156+
},
157+
2: {
158+
'locprf': '100',
159+
'metric': '4294967295',
160+
'next_hop': '192.0.2.2',
161+
'origin_codes': 'i',
162+
'path': '65031',
163+
'status_codes': '*i',
164+
'weight': '0',
165+
},
166+
},
167+
},
168+
'2001:0db8:85a3:0:0:0:0:6::10/127': {
169+
'index': {
170+
1: {
171+
'locprf': '0',
172+
'next_hop': '192.0.2.2',
173+
'origin_codes': 'i',
174+
'path': '0',
175+
'status_codes': '*>i',
176+
'weight': '100',
177+
},
178+
2: {
179+
'locprf': '0',
180+
'next_hop': '192.0.2.2',
181+
'origin_codes': 'i',
182+
'path': '0',
183+
'status_codes': '*i',
184+
'weight': '100',
185+
},
186+
},
187+
},
188+
},
189+
},
190+
'1234:2505118': {
191+
'prefix': {
192+
'2001:0db8:85a3:0:0:0:0:18::/56': {
193+
'index': {
194+
1: {
195+
'locprf': '100',
196+
'next_hop': '203.0.113.7',
197+
'origin_codes': 'i',
198+
'path': '0',
199+
'status_codes': '*>i',
200+
'weight': '100',
201+
},
202+
2: {
203+
'locprf': '100',
204+
'next_hop': '203.0.113.7',
205+
'origin_codes': 'i',
206+
'path': '0',
207+
'status_codes': '*i',
208+
'weight': '100',
209+
},
210+
},
211+
},
212+
'2001:0db8:85a3:0:0:0:0:1e08::/48': {
213+
'index': {
214+
1: {
215+
'locprf': '100',
216+
'next_hop': '203.0.113.7',
217+
'origin_codes': 'i',
218+
'path': '0',
219+
'status_codes': '*>i',
220+
'weight': '100',
221+
},
222+
2: {
223+
'locprf': '100',
224+
'next_hop': '203.0.113.7',
225+
'origin_codes': 'i',
226+
'path': '0',
227+
'status_codes': '*i',
228+
'weight': '100',
229+
},
230+
},
231+
},
232+
},
233+
},
234+
},
235+
'router_identifier': '192.168.1.1',
236+
'scan_interval': 60,
237+
'table_state': 'active',
238+
},
239+
},
240+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
RP/0/RSP0/CPU0:router# show bgp ivp6 all community 1234:1234 exact-match
2+
Address Family: VPNv6 Unicast
3+
-----------------------------
4+
5+
BGP router identifier 192.168.1.1, local AS number 1234
6+
BGP generic scan interval 60 secs
7+
Non-stop routing is enabled
8+
BGP table state: Active
9+
Table ID: 0x0
10+
BGP main routing table version 5530
11+
BGP NSR Initial initsync version 7 (Reached)
12+
BGP NSR/ISSU Sync-Group versions 5530/0
13+
BGP scan interval 60 secs
14+
15+
Status codes: s suppressed, d damped, h history, * valid, > best i - internal, r RIB-failure, S stale, N Nexthop-discard
16+
Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path
17+
Route Distinguisher: 1234:1234
18+
Route Distinguisher Version: 53
19+
*>i2001:0db8:85a3::/64 192.0.2.1 0 100 0 i
20+
* i 192.0.2.1 0 100 0 i
21+
*>i2001:0db8:85a3:0:0:0:0:1403::/48 192.0.2.1 0 100 0 i
22+
* i 192.0.2.1 0 100 0 i
23+
Route Distinguisher: 1234:2505005
24+
Route Distinguisher Version: 54
25+
*>i2001:0db8:85a3:0:0:0:0:6::10/127 192.0.2.2 0 100 0 i
26+
* i 192.0.2.2 0 100 0 i
27+
*>i2001:0db8:85a3:0:0:0:0:6:195:113:123:80/125 192.0.2.2 4294967295 100 0 65031 i
28+
* i 192.0.2.2 4294967295 100 0 65031 i
29+
*>i2001:0db8:85a3:0:0:0:0:6:10:205::/112 192.0.2.2 4294967295 100 0 65031 i
30+
* i 192.0.2.2 4294967295 100 0 65031 i
31+
*>i2001:0db8:85a3:0:0:0:0:6:192:168:201::/112 192.0.2.2 4294967295 100 0 65031 i
32+
* i 192.0.2.2 4294967295 100 0 65031 i
33+
*>i2001:0db8:85a3:0:0:0:0:6:195:113:123:96:0/112 192.0.2.2 4294967295 100 0 65031 i
34+
* i 192.0.2.2 4294967295 100 0 65031 i
35+
*>i2001:0db8:85a3:0:0:0:0:6:195:113:123:128:0/112 192.0.2.2 4294967295 100 0 65031 i
36+
* i 192.0.2.2 4294967295 100 0 65031 i
37+
Route Distinguisher: 1234:2505118
38+
Route Distinguisher Version: 49
39+
*>i2001:0db8:85a3:0:0:0:0:18::/56 203.0.113.7 100 100 0 i
40+
* i 203.0.113.7 100 100 0 i
41+
*>i2001:0db8:85a3:0:0:0:0:1e08::/48 203.0.113.7 100 100 0 i
42+
* i 203.0.113.7 100 100 0 i

0 commit comments

Comments
 (0)