@@ -93,6 +93,8 @@ def test_vrf_static_route(self):
93
93
obj = {'config_db' :db .cfgdb }
94
94
95
95
# config route add prefix vrf Vrf-BLUE 2.2.3.4/32 nexthop 30.0.0.6
96
+ result = runner .invoke (config .config .commands ["vrf" ].commands ["add" ], ["Vrf-BLUE" ], obj = obj )
97
+ print (result .exit_code , result .output )
96
98
result = runner .invoke (config .config .commands ["route" ].commands ["add" ], \
97
99
["prefix" , "vrf" , "Vrf-BLUE" , "2.2.3.4/32" , "nexthop" , "30.0.0.6" ], obj = obj )
98
100
print (result .exit_code , result .output )
@@ -111,9 +113,12 @@ def test_dest_vrf_static_route(self):
111
113
obj = {'config_db' :db .cfgdb }
112
114
113
115
# config route add prefix 3.2.3.4/32 nexthop vrf Vrf-RED 30.0.0.6
116
+ result = runner .invoke (config .config .commands ["vrf" ].commands ["add" ], ["Vrf-RED" ], obj = obj )
117
+ print (result .exit_code , result .output )
114
118
result = runner .invoke (config .config .commands ["route" ].commands ["add" ], \
115
119
["prefix" , "3.2.3.4/32" , "nexthop" , "vrf" , "Vrf-RED" , "30.0.0.6" ], obj = obj )
116
120
print (result .exit_code , result .output )
121
+ print (db .cfgdb .get_table ('STATIC_ROUTE' ))
117
122
assert ('3.2.3.4/32' ) in db .cfgdb .get_table ('STATIC_ROUTE' )
118
123
assert db .cfgdb .get_entry ('STATIC_ROUTE' , '3.2.3.4/32' ) == {'nexthop' : '30.0.0.6' , 'nexthop-vrf' : 'Vrf-RED' , 'blackhole' : 'false' , 'distance' : '0' , 'ifname' : '' }
119
124
@@ -129,6 +134,8 @@ def test_multiple_nexthops_with_vrf_static_route(self):
129
134
obj = {'config_db' :db .cfgdb }
130
135
131
136
''' Add '''
137
+ result = runner .invoke (config .config .commands ["vrf" ].commands ["add" ], ["Vrf-RED" ], obj = obj )
138
+ print (result .exit_code , result .output )
132
139
# config route add prefix 6.2.3.4/32 nexthop vrf Vrf-RED "30.0.0.6,30.0.0.7"
133
140
result = runner .invoke (config .config .commands ["route" ].commands ["add" ], \
134
141
["prefix" , "6.2.3.4/32" , "nexthop" , "vrf" , "Vrf-RED" , "30.0.0.6,30.0.0.7" ], obj = obj )
@@ -251,13 +258,17 @@ def test_static_route_ECMP_nexthop_with_vrf(self):
251
258
obj = {'config_db' :db .cfgdb }
252
259
253
260
''' Add '''
261
+ result = runner .invoke (config .config .commands ["vrf" ].commands ["add" ], ["Vrf-RED" ], obj = obj )
262
+ print (result .exit_code , result .output )
254
263
# config route add prefix 11.2.3.4/32 nexthop vrf Vrf-RED 30.0.0.5
255
264
result = runner .invoke (config .config .commands ["route" ].commands ["add" ], \
256
265
["prefix" , "11.2.3.4/32" , "nexthop" , "vrf" , "Vrf-RED" , "30.0.0.5" ], obj = obj )
257
266
print (result .exit_code , result .output )
258
267
assert ('11.2.3.4/32' ) in db .cfgdb .get_table ('STATIC_ROUTE' )
259
268
assert db .cfgdb .get_entry ('STATIC_ROUTE' , '11.2.3.4/32' ) == {'nexthop' : '30.0.0.5' , 'nexthop-vrf' : 'Vrf-RED' , 'blackhole' : 'false' , 'distance' : '0' , 'ifname' : '' }
260
269
270
+ result = runner .invoke (config .config .commands ["vrf" ].commands ["add" ], ["Vrf-BLUE" ], obj = obj )
271
+ print (result .exit_code , result .output )
261
272
# config route add prefix 11.2.3.4/32 nexthop vrf Vrf-BLUE 30.0.0.6
262
273
result = runner .invoke (config .config .commands ["route" ].commands ["add" ], \
263
274
["prefix" , "11.2.3.4/32" , "nexthop" , "vrf" , "Vrf-BLUE" , "30.0.0.6" ], obj = obj )
@@ -292,6 +303,8 @@ def test_static_route_ECMP_mixed_nextfop(self):
292
303
assert ('12.2.3.4/32' ) in db .cfgdb .get_table ('STATIC_ROUTE' )
293
304
assert db .cfgdb .get_entry ('STATIC_ROUTE' , '12.2.3.4/32' ) == {'nexthop' : '30.0.0.6' , 'blackhole' : 'false' , 'distance' : '0' , 'ifname' : '' , 'nexthop-vrf' : '' }
294
305
306
+ result = runner .invoke (config .config .commands ["vrf" ].commands ["add" ], ["Vrf-RED" ], obj = obj )
307
+ print (result .exit_code , result .output )
295
308
# config route add prefix 12.2.3.4/32 nexthop vrf Vrf-RED 30.0.0.7
296
309
result = runner .invoke (config .config .commands ["route" ].commands ["add" ], \
297
310
["prefix" , "12.2.3.4/32" , "nexthop" , "vrf" , "Vrf-RED" , "30.0.0.7" ], obj = obj )
0 commit comments