ANTA catalog for generic routing tests
VerifyRoutingProtocolModel ¶
Verifies the configured routing protocol model is the one we expect.
Expected Results
- Success: The test will pass if the configured routing protocol model is the one we expect.
- Failure: The test will fail if the configured routing protocol model is not the one we expect.
Examples
anta.tests.routing:
generic:
- VerifyRoutingProtocolModel:
model: multi-agent
Inputs¶
Name | Type | Description | Default |
---|---|---|---|
model |
Literal['multi-agent', 'ribd']
|
Expected routing protocol model. Defaults to `multi-agent`.
|
'multi-agent'
|
Source code in anta/tests/routing/generic.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
VerifyRoutingTableEntry ¶
Verifies that the provided routes are present in the routing table of a specified VRF.
Expected Results
- Success: The test will pass if the provided routes are present in the routing table.
- Failure: The test will fail if one or many provided routes are missing from the routing table.
Examples
anta.tests.routing:
generic:
- VerifyRoutingTableEntry:
vrf: default
routes:
- 10.1.0.1
- 10.1.0.2
Inputs¶
Name | Type | Description | Default |
---|---|---|---|
vrf |
str
|
VRF context. Defaults to `default` VRF.
|
'default'
|
routes |
list[IPv4Address]
|
List of routes to verify.
|
- |
collect |
Literal['one', 'all']
|
Route collect behavior: one=one route per command, all=all routes in vrf per command. Defaults to `one`
|
'one'
|
ip_interface_ip
cached
staticmethod
¶
ip_interface_ip(route: str) -> IPv4Address
Return the IP address of the provided ip route with mask.
Source code in anta/tests/routing/generic.py
169 170 171 172 173 |
|
Source code in anta/tests/routing/generic.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
|
VerifyRoutingTableSize ¶
Verifies the size of the IP routing table of the default VRF.
Expected Results
- Success: The test will pass if the routing table size is between the provided minimum and maximum values.
- Failure: The test will fail if the routing table size is not between the provided minimum and maximum values.
Examples
anta.tests.routing:
generic:
- VerifyRoutingTableSize:
minimum: 2
maximum: 20
Inputs¶
Name | Type | Description | Default |
---|---|---|---|
minimum |
PositiveInteger
|
Expected minimum routing table size.
|
- |
maximum |
PositiveInteger
|
Expected maximum routing table size.
|
- |
Source code in anta/tests/routing/generic.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|