Skip to content

Commit 4db4101

Browse files
committed
Add warning, device feature flags, and integration test
The 'not supported' warning generates a hard error that can be disabled in case you don't care (that's what I'm using in the integration test).
1 parent af68e00 commit 4db4101

File tree

6 files changed

+36
-4
lines changed

6 files changed

+36
-4
lines changed

docs/module/isis.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ The IS-IS configuration module is automatically removed from a node that does no
121121

122122
IS-IS is automatically started on all interfaces within an autonomous system (interfaces with no EBGP neighbors; see also [](routing_external)). To disable IS-IS on an intra-AS link, set the **isis** link parameter to *False* (see also [](routing_disable)).
123123

124-
You can also set these parameters:
124+
You can also set these parameters on links or interfaces:
125125

126-
* **isis.type** -- Set link type (**level-1**, **level-2** or **level-1-2**).
126+
* **isis.type** -- Set interface circuit type (the type of adjacency that can be established over this link -- **level-1**, **level-2** or **level-1-2**).
127127
* **isis.network_type** -- Set IS-IS network type. Valid values are **point-to-point** or *False* (do not set the network type). See also [Default Link Parameters](#default-link-parameters).
128128
* **isis.metric** or **isis.cost** -- Interface cost. Both parameters are recognized to make IS-IS configuration similar to OSPF (*metric* takes precedence over *cost*)
129129
* **isis.bfd** -- enable or disable BFD on individual interfaces. Like with the node-level **isis.bfd** parameter, this parameter could be a boolean value (*True* to enable BFD for all address families, *False* to disable IS-IS BFD on the interface) or a dictionary of address families, for example:

netsim/devices/eos.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ features:
5252
gateway:
5353
protocol: [ anycast, vrrp ]
5454
isis:
55+
circuit_type: true
56+
import: [ bgp, ospf, ripv2, connected, static, vrf ]
5557
unnumbered:
5658
ipv4: true
5759
ipv6: true
5860
network: true
59-
import: [ bgp, ospf, ripv2, connected, static, vrf ]
6061
lag:
6162
mlag:
6263
peer:

netsim/devices/frr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ features:
8080
gateway:
8181
protocol: [ vrrp, anycast ]
8282
isis:
83+
circuit_type: true
8384
import: [ bgp, ripv2, ospf, connected, static, vrf ]
8485
unnumbered:
8586
ipv4: true

netsim/devices/ios.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ features:
5353
roles: [ host, router, bridge ]
5454
mgmt_vrf: true
5555
isis:
56+
circuit_type: true
5657
import: [ bgp, ospf, ripv2, connected, static ]
5758
unnumbered:
5859
ipv4: true

netsim/modules/isis.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def node_post_transform(self, node: Box, topology: Box) -> None:
7878
if 'sr' in node.module:
7979
_routing.router_id(node,'isis',topology.pools)
8080

81+
isis_ct_intf = []
8182
for l in node.get('interfaces',[]):
8283
if _routing.external(l,'isis') or not (l.get('ipv4',False) or l.get('ipv6',False)):
8384
l.pop('isis',None) # Don't run IS-IS on external interfaces, or l2-only
@@ -86,6 +87,16 @@ def node_post_transform(self, node: Box, topology: Box) -> None:
8687
err = _routing.network_type(l,'isis',['point-to-point'])
8788
if err:
8889
log.error(f'{err}\n... node {node.name} link {l}')
90+
if 'isis.type' in l and not features.isis.circuit_type:
91+
isis_ct_intf.append(l.ifname)
92+
93+
if isis_ct_intf:
94+
log.warning(
95+
text=f'Device {node.device} (node {node.name}) does not support IS-IS circuit type',
96+
flag='circuit_type',
97+
module='isis',
98+
more_data=f'Used on interface(s) {",".join(isis_ct_intf)}',
99+
category=log.IncorrectAttr)
89100

90101
_routing.igp_post_transform(node,topology,proto='isis',vrf_aware=True)
91102
bfd.multiprotocol_bfd_link_state(node,'isis')

tests/integration/isis/03-dual-stack.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@ module: [ isis ]
88

99
defaults.interfaces.mtu: 1500
1010
defaults.sources.extra: [ defaults-ds.yml, ../wait_times.yml, ../warnings.yml ]
11+
defaults.isis.warnings.circuit_type: False
1112

1213
groups:
1314
probes:
1415
provider: clab
15-
members: [ x1, x2 ]
16+
members: [ x1, x2, x3 ]
1617

1718
isis.type: level-1-2
1819

1920
nodes:
2021
dut:
2122
x1:
2223
x2:
24+
x3:
2325

2426
links:
2527
- dut:
@@ -28,13 +30,29 @@ links:
2830
- dut:
2931
x2:
3032

33+
- dut:
34+
isis.type: level-1
35+
x3:
36+
3137
validate:
3238
adj:
3339
description: Check IS-IS adjacencies
3440
wait_msg: Waiting for IS-IS adjacency process to complete
3541
wait: isis_adj_p2p
3642
nodes: [ x1, x2 ]
3743
plugin: isis_neighbor('dut',level='L1L2')
44+
adj_x3:
45+
description: Check the DUT-X3 IS-IS adjacency
46+
wait_msg: Waiting for IS-IS adjacency process to complete
47+
wait: isis_adj_p2p
48+
nodes: [ x3 ]
49+
plugin: isis_neighbor('dut')
50+
adj_ct:
51+
description: Check the level of DUT-X3 IS-IS adjacency
52+
fail: The IS-IS adjacency is not limited by the circuit type on DUT
53+
nodes: [ x3 ]
54+
plugin: isis_neighbor('dut',level='L1')
55+
level: warning
3856
pfx_v4:
3957
description: Check IS-IS IPv4 prefix
4058
wait_msg: Waiting for IS-IS SPF run

0 commit comments

Comments
 (0)