-
Notifications
You must be signed in to change notification settings - Fork 559
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eos: support using json version of show vrf
If version of EOS is new enough (>= 4.23.0), use the JSON output of "show vrf" to avoid issues with text parsing in 4.28+ Anecdotal evidence suggests that "default" was added to the text output of "show vrf" in 4.23, so this also resolves the double route issue in 1919. closes #1919
- Loading branch information
Showing
4 changed files
with
114 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
test/eos/mocked_data/test_get_network_instances/vrf/cli_version.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2 |
31 changes: 31 additions & 0 deletions
31
test/eos/mocked_data/test_get_network_instances/vrf/expected_result.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"default": { | ||
"name": "default", | ||
"type": "DEFAULT_INSTANCE", | ||
"state": { "route_distinguisher": "" }, | ||
"interfaces": { | ||
"interface": { | ||
"Ethernet1": {}, | ||
"Ethernet2": {}, | ||
"Loopback0": {}, | ||
"Management0": {} | ||
} | ||
} | ||
}, | ||
"foo": { | ||
"name": "foo", | ||
"type": "L3VRF", | ||
"state": { "route_distinguisher": "0:1" }, | ||
"interfaces": { | ||
"interface": {} | ||
} | ||
}, | ||
"bar": { | ||
"name": "bar", | ||
"type": "L3VRF", | ||
"state": { "route_distinguisher": "" }, | ||
"interfaces": { | ||
"interface": {} | ||
} | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
test/eos/mocked_data/test_get_network_instances/vrf/show_vrf.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"vrfs": { | ||
"foo": { | ||
"routeDistinguisher": "0:1", | ||
"protocols": { | ||
"ipv4": { | ||
"supported": true, | ||
"protocolState": "up", | ||
"routingState": "up" | ||
}, | ||
"ipv6": { | ||
"supported": true, | ||
"protocolState": "up", | ||
"routingState": "down" | ||
} | ||
}, | ||
"vrfState": "up", | ||
"interfacesV4": [], | ||
"interfacesV6": [], | ||
"interfaces": [] | ||
}, | ||
"bar": { | ||
"routeDistinguisher": "", | ||
"protocols": { | ||
"ipv4": { | ||
"supported": true, | ||
"protocolState": "up", | ||
"routingState": "down" | ||
}, | ||
"ipv6": { | ||
"supported": true, | ||
"protocolState": "up", | ||
"routingState": "down" | ||
} | ||
}, | ||
"vrfState": "up", | ||
"interfacesV4": [], | ||
"interfacesV6": [], | ||
"interfaces": [] | ||
}, | ||
"default": { | ||
"routeDistinguisher": "", | ||
"protocols": { | ||
"ipv4": { | ||
"supported": true, | ||
"protocolState": "up", | ||
"routingState": "up" | ||
}, | ||
"ipv6": { | ||
"supported": true, | ||
"protocolState": "up", | ||
"routingState": "down" | ||
} | ||
}, | ||
"vrfState": "up", | ||
"interfacesV4": ["Ethernet1", "Ethernet2", "Loopback0", "Management0"], | ||
"interfacesV6": ["Management0"], | ||
"interfaces": ["Ethernet1", "Ethernet2", "Loopback0", "Management0"] | ||
} | ||
} | ||
} |