@@ -255,12 +255,16 @@ 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 = ['babel' , 'bgp' , 'connected' , 'isis' , 'kernel' , 'nhrp' , 'rip' , 'static' , 'table' ]
259260
260261 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 ])
262+ redistr_base = base_path + ['redistribute' , protocol ]
263+ if protocol == 'table' :
264+ redistr_base += [table_id ]
265+ self .cli_set (redistr_base + ['metric' , metric ])
266+ self .cli_set (redistr_base + ['route-map' , route_map ])
267+ self .cli_set (redistr_base + ['metric-type' , metric_type ])
264268
265269 # commit changes
266270 self .cli_commit ()
@@ -269,7 +273,11 @@ def test_ospf_07_redistribute(self):
269273 frrconfig = self .getFRRconfig ('router ospf' , endsection = '^exit' )
270274 self .assertIn (f'router ospf' , frrconfig )
271275 for protocol in redistribute :
272- self .assertIn (f' redistribute { protocol } metric { metric } metric-type { metric_type } route-map { route_map } ' , frrconfig )
276+ if protocol == 'table' :
277+ protocolstr = f'table-direct { table_id } '
278+ else :
279+ protocolstr = protocol
280+ self .assertIn (f' redistribute { protocolstr } metric { metric } metric-type { metric_type } route-map { route_map } ' , frrconfig )
273281
274282 def test_ospf_08_virtual_link (self ):
275283 networks = ['10.0.0.0/8' , '172.16.0.0/12' , '192.168.0.0/16' ]
0 commit comments