@@ -255,12 +255,26 @@ def test_ospf_06_neighbor(self):
255255 def test_ospf_07_redistribute (self ):
256256 metric = '15'
257257 metric_type = '1'
258- redistribute = ['babel' , 'bgp' , 'connected' , 'isis' , 'kernel' , 'nhrp' , 'rip' , 'static' ]
258+ table_id = '21'
259+ redistribute = [
260+ 'babel' ,
261+ 'bgp' ,
262+ 'connected' ,
263+ 'isis' ,
264+ 'kernel' ,
265+ 'nhrp' ,
266+ 'rip' ,
267+ 'static' ,
268+ 'table' ,
269+ ]
259270
260271 for protocol in redistribute :
261- self .cli_set (base_path + ['redistribute' , protocol , 'metric' , metric ])
262- self .cli_set (base_path + ['redistribute' , protocol , 'route-map' , route_map ])
263- self .cli_set (base_path + ['redistribute' , protocol , 'metric-type' , metric_type ])
272+ redistr_base = base_path + ['redistribute' , protocol ]
273+ if protocol == 'table' :
274+ redistr_base += [table_id ]
275+ self .cli_set (redistr_base + ['metric' , metric ])
276+ self .cli_set (redistr_base + ['route-map' , route_map ])
277+ self .cli_set (redistr_base + ['metric-type' , metric_type ])
264278
265279 # commit changes
266280 self .cli_commit ()
@@ -269,7 +283,14 @@ def test_ospf_07_redistribute(self):
269283 frrconfig = self .getFRRconfig ('router ospf' , endsection = '^exit' )
270284 self .assertIn (f'router ospf' , frrconfig )
271285 for protocol in redistribute :
272- self .assertIn (f' redistribute { protocol } metric { metric } metric-type { metric_type } route-map { route_map } ' , frrconfig )
286+ if protocol == 'table' :
287+ protocolstr = f'table-direct { table_id } '
288+ else :
289+ protocolstr = protocol
290+ self .assertIn (
291+ f' redistribute { protocolstr } metric { metric } metric-type { metric_type } route-map { route_map } ' ,
292+ frrconfig ,
293+ )
273294
274295 def test_ospf_08_virtual_link (self ):
275296 networks = ['10.0.0.0/8' , '172.16.0.0/12' , '192.168.0.0/16' ]
0 commit comments