This repository has been archived by the owner on Jan 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Get interfaces ip #205
Merged
Merged
Get interfaces ip #205
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
49 changes: 32 additions & 17 deletions
49
test/unit/mocked_data/test_get_interfaces_ip/normal/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 |
---|---|---|
@@ -1,19 +1,34 @@ | ||
{ | ||
"Vlan20": { | ||
"ipv4": { | ||
"172.29.50.3": { | ||
"prefix_length": 27 | ||
} | ||
} | ||
}, | ||
"Vlan41": { | ||
"ipv4": { | ||
"172.29.52.34": { | ||
"prefix_length": 27 | ||
}, | ||
"192.168.81.34": { | ||
"prefix_length": 24 | ||
} | ||
} | ||
} | ||
"Vlan20": { | ||
"ipv4": { | ||
"172.29.50.3": { | ||
"prefix_length": 27 | ||
} | ||
}, | ||
"ipv6": { | ||
"FE80::C009:24FF:FEAC:0": { | ||
"prefix_length": 64 | ||
}, | ||
"2002::1": { | ||
"prefix_length": 64 | ||
} | ||
} | ||
}, | ||
"Vlan41": { | ||
"ipv4": { | ||
"172.29.52.34": { | ||
"prefix_length": 27 | ||
}, | ||
"192.168.81.34": { | ||
"prefix_length": 24 | ||
} | ||
} | ||
}, | ||
"Loopback0": { | ||
"ipv6": { | ||
"FE80::C009:24FF:FEAC:0": {"prefix_length": 64}, | ||
"2001::1": {"prefix_length": 128}, | ||
"2001::2": {"prefix_length": 128} | ||
} | ||
} | ||
} |
87 changes: 87 additions & 0 deletions
87
test/unit/mocked_data/test_get_interfaces_ip/normal/show_ip_interface.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,87 @@ | ||
Vlan20 is up, line protocol is up | ||
Internet address is 172.29.50.3/27 | ||
Broadcast address is 255.255.255.255 | ||
Address determined by non-volatile memory | ||
MTU is 1500 bytes | ||
Helper addresses are 172.16.0.1 | ||
192.168.1.1 | ||
Directed broadcast forwarding is enabled | ||
Multicast reserved groups joined: 224.0.0.102 224.0.0.5 224.0.0.6 | ||
Outgoing access list is not set | ||
Inbound access list is not set | ||
Proxy ARP is disabled | ||
Local Proxy ARP is disabled | ||
Security level is default | ||
Split horizon is enabled | ||
ICMP redirects are never sent | ||
ICMP unreachables are never sent | ||
ICMP mask replies are never sent | ||
IP fast switching is enabled | ||
IP Flow switching is disabled | ||
IP CEF switching is enabled | ||
IP CEF switching turbo vector | ||
IP Null turbo vector | ||
Associated unicast routing topologies: | ||
Topology "base", operation state is UP | ||
IP multicast fast switching is enabled | ||
IP multicast distributed fast switching is disabled | ||
IP route-cache flags are Fast, CEF | ||
Router Discovery is disabled | ||
IP output packet accounting is disabled | ||
IP access violation accounting is disabled | ||
TCP/IP header compression is disabled | ||
RTP/IP header compression is disabled | ||
Probe proxy name replies are disabled | ||
Policy routing is disabled | ||
Network address translation is disabled | ||
BGP Policy Mapping is disabled | ||
Input features: MCI Check | ||
Output features: IP Post Routing Processing, HW Shortcut Installation | ||
Post encapsulation features: MTU Processing, IP Protocol Output Counter, IP Sendself Check, HW Shortcut Installation | ||
Sampled Netflow is disabled | ||
IP Routed Flow creation is disabled in netflow table | ||
IP Bridged Flow creation is disabled in netflow table | ||
IPv4 WCCP Redirect outbound is disabled | ||
IPv4 WCCP Redirect inbound is disabled | ||
IPv4 WCCP Redirect exclude is disabled | ||
IP multicast multilayer switching is disabled | ||
GigabitEthernet1/1 is down, line protocol is down | ||
GigabitEthernet1/2 is down, line protocol is down | ||
GigabitEthernet1/3 is administratively down, line protocol is down | ||
Internet protocol processing disabled | ||
Vlan41 is up, line protocol is up | ||
Internet address is 172.29.52.34/27 | ||
Broadcast address is 255.255.255.255 | ||
Address determined by non-volatile memory | ||
MTU is 1514 bytes | ||
Helper address is not set | ||
Directed broadcast forwarding is disabled | ||
Secondary address 192.168.81.34/24 | ||
Outgoing access list is not set | ||
Inbound access list is not set | ||
Proxy ARP is enabled | ||
Local Proxy ARP is disabled | ||
Security level is default | ||
Split horizon is enabled | ||
ICMP redirects are always sent | ||
ICMP unreachables are always sent | ||
ICMP mask replies are never sent | ||
IP fast switching is enabled | ||
IP fast switching on the same interface is disabled | ||
IP Flow switching is disabled | ||
IP CEF switching is enabled | ||
IP CEF Fast switching turbo vector | ||
IP multicast fast switching is enabled | ||
IP multicast distributed fast switching is disabled | ||
IP route-cache flags are Fast, CEF | ||
Router Discovery is disabled | ||
IP output packet accounting is disabled | ||
IP access violation accounting is disabled | ||
TCP/IP header compression is disabled | ||
RTP/IP header compression is disabled | ||
Policy routing is disabled | ||
Network address translation is disabled | ||
BGP Policy Mapping is disabled | ||
WCCP Redirect outbound is disabled | ||
WCCP Redirect inbound is disabled | ||
WCCP Redirect exclude is disabled |
6 changes: 0 additions & 6 deletions
6
test/unit/mocked_data/test_get_interfaces_ip/normal/show_ip_interface_brief.txt
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
test/unit/mocked_data/test_get_interfaces_ip/normal/show_ipv6_interface.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,30 @@ | ||
Vlan20 is administratively down, line protocol is down | ||
IPv6 is enabled, link-local address is FE80::C009:24FF:FEAC:0 [TEN] | ||
Global unicast address(es): | ||
2002::1, subnet is 2002::/64 [TEN] | ||
Joined group address(es): | ||
FF02::1 | ||
FF02::1:FF00:1 | ||
FF02::1:FFAC:0 | ||
MTU is 1500 bytes | ||
ICMP error messages limited to one every 100 milliseconds | ||
ICMP redirects are enabled | ||
ND DAD is enabled, number of DAD attempts: 1 | ||
ND reachable time is 30000 milliseconds | ||
Loopback0 is up, line protocol is up | ||
IPv6 is enabled, link-local address is FE80::C009:24FF:FEAC:0 | ||
Global unicast address(es): | ||
2001::1, subnet is 2001::1/128 | ||
2001::2, subnet is 2001::2/128 | ||
Joined group address(es): | ||
FF02::1 | ||
FF02::2 | ||
FF02::1:FF00:1 | ||
FF02::1:FF00:2 | ||
FF02::1:FFAC:0 | ||
MTU is 1514 bytes | ||
ICMP error messages limited to one every 100 milliseconds | ||
ICMP redirects are enabled | ||
ND DAD is not supported | ||
ND reachable time is 30000 milliseconds | ||
|
8 changes: 0 additions & 8 deletions
8
.../unit/mocked_data/test_get_interfaces_ip/normal/show_run_interface_GigabitEthernet0_5.txt
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
test/unit/mocked_data/test_get_interfaces_ip/normal/show_run_interface_Port_channel1.txt
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
test/unit/mocked_data/test_get_interfaces_ip/normal/show_run_interface_Vlan20.txt
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
test/unit/mocked_data/test_get_interfaces_ip/normal/show_run_interface_Vlan40.txt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
test/unit/mocked_data/test_get_interfaces_ip/normal/show_run_interface_Vlan41.txt
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might this be more readable as
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think I would probably change this slightly to something like:
i.e. only add it to 'interfaces' if there is a positive match