@@ -93,6 +93,8 @@ def test_vrf_static_route(self):
9393 obj = {'config_db' :db .cfgdb }
9494
9595 # 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 )
9698 result = runner .invoke (config .config .commands ["route" ].commands ["add" ], \
9799 ["prefix" , "vrf" , "Vrf-BLUE" , "2.2.3.4/32" , "nexthop" , "30.0.0.6" ], obj = obj )
98100 print (result .exit_code , result .output )
@@ -111,9 +113,12 @@ def test_dest_vrf_static_route(self):
111113 obj = {'config_db' :db .cfgdb }
112114
113115 # 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 )
114118 result = runner .invoke (config .config .commands ["route" ].commands ["add" ], \
115119 ["prefix" , "3.2.3.4/32" , "nexthop" , "vrf" , "Vrf-RED" , "30.0.0.6" ], obj = obj )
116120 print (result .exit_code , result .output )
121+ print (db .cfgdb .get_table ('STATIC_ROUTE' ))
117122 assert ('3.2.3.4/32' ) in db .cfgdb .get_table ('STATIC_ROUTE' )
118123 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' : '' }
119124
@@ -129,6 +134,8 @@ def test_multiple_nexthops_with_vrf_static_route(self):
129134 obj = {'config_db' :db .cfgdb }
130135
131136 ''' Add '''
137+ result = runner .invoke (config .config .commands ["vrf" ].commands ["add" ], ["Vrf-RED" ], obj = obj )
138+ print (result .exit_code , result .output )
132139 # config route add prefix 6.2.3.4/32 nexthop vrf Vrf-RED "30.0.0.6,30.0.0.7"
133140 result = runner .invoke (config .config .commands ["route" ].commands ["add" ], \
134141 ["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):
251258 obj = {'config_db' :db .cfgdb }
252259
253260 ''' Add '''
261+ result = runner .invoke (config .config .commands ["vrf" ].commands ["add" ], ["Vrf-RED" ], obj = obj )
262+ print (result .exit_code , result .output )
254263 # config route add prefix 11.2.3.4/32 nexthop vrf Vrf-RED 30.0.0.5
255264 result = runner .invoke (config .config .commands ["route" ].commands ["add" ], \
256265 ["prefix" , "11.2.3.4/32" , "nexthop" , "vrf" , "Vrf-RED" , "30.0.0.5" ], obj = obj )
257266 print (result .exit_code , result .output )
258267 assert ('11.2.3.4/32' ) in db .cfgdb .get_table ('STATIC_ROUTE' )
259268 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' : '' }
260269
270+ result = runner .invoke (config .config .commands ["vrf" ].commands ["add" ], ["Vrf-BLUE" ], obj = obj )
271+ print (result .exit_code , result .output )
261272 # config route add prefix 11.2.3.4/32 nexthop vrf Vrf-BLUE 30.0.0.6
262273 result = runner .invoke (config .config .commands ["route" ].commands ["add" ], \
263274 ["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):
292303 assert ('12.2.3.4/32' ) in db .cfgdb .get_table ('STATIC_ROUTE' )
293304 assert db .cfgdb .get_entry ('STATIC_ROUTE' , '12.2.3.4/32' ) == {'nexthop' : '30.0.0.6' , 'blackhole' : 'false' , 'distance' : '0' , 'ifname' : '' , 'nexthop-vrf' : '' }
294305
306+ result = runner .invoke (config .config .commands ["vrf" ].commands ["add" ], ["Vrf-RED" ], obj = obj )
307+ print (result .exit_code , result .output )
295308 # config route add prefix 12.2.3.4/32 nexthop vrf Vrf-RED 30.0.0.7
296309 result = runner .invoke (config .config .commands ["route" ].commands ["add" ], \
297310 ["prefix" , "12.2.3.4/32" , "nexthop" , "vrf" , "Vrf-RED" , "30.0.0.7" ], obj = obj )
0 commit comments