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 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from jorgenbl/develop
Fix broken regex and add support for discarded packets in get_interfaces_counters
- Loading branch information
Showing
4 changed files
with
113 additions
and
42 deletions.
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
60 changes: 37 additions & 23 deletions
60
test/unit/mocked_data/test_get_interfaces_counters/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,44 +1,58 @@ | ||
{ | ||
"GigabitEthernet1": { | ||
"tx_discards": -1, | ||
"tx_broadcast_packets": -1, | ||
"rx_multicast_packets": 0, | ||
"tx_unicast_packets": 9297, | ||
"rx_octets": 2, | ||
"rx_unicast_packets": 297, | ||
"rx_octets": 25963, | ||
"rx_broadcast_packets": 0, | ||
"rx_multicast_packets": 0, | ||
"rx_errors": 0, | ||
"tx_octets": 1, | ||
"rx_discards": -1, | ||
"rx_discards": 0, | ||
"tx_unicast_packets": 160, | ||
"tx_octets": 26812, | ||
"tx_broadcast_packets": -1, | ||
"tx_multicast_packets": -1, | ||
"tx_errors": 0, | ||
"rx_unicast_packets": 13799 | ||
"tx_discards": 0 | ||
}, | ||
"GigabitEthernet2": { | ||
"tx_discards": -1, | ||
"tx_broadcast_packets": -1, | ||
"rx_multicast_packets": 0, | ||
"tx_unicast_packets": 154, | ||
"rx_octets": 3, | ||
"rx_unicast_packets": 0, | ||
"rx_octets": 0, | ||
"rx_broadcast_packets": 0, | ||
"rx_multicast_packets": 0, | ||
"rx_errors": 0, | ||
"tx_octets": 7, | ||
"rx_discards": -1, | ||
"rx_discards": 0, | ||
"tx_unicast_packets": 0, | ||
"tx_octets": 0, | ||
"tx_broadcast_packets": -1, | ||
"tx_multicast_packets": -1, | ||
"tx_errors": 0, | ||
"rx_unicast_packets": 105 | ||
"tx_discards": 0 | ||
}, | ||
"GigabitEthernet3": { | ||
"tx_discards": -1, | ||
"tx_broadcast_packets": -1, | ||
"rx_unicast_packets": 0, | ||
"rx_octets": 0, | ||
"rx_broadcast_packets": 0, | ||
"rx_multicast_packets": 0, | ||
"tx_unicast_packets": 3, | ||
"rx_errors": 0, | ||
"rx_discards": 0, | ||
"tx_unicast_packets": 0, | ||
"tx_octets": 0, | ||
"tx_broadcast_packets": -1, | ||
"tx_multicast_packets": -1, | ||
"tx_errors": 0, | ||
"tx_discards": 0 | ||
}, | ||
"GigabitEthernet4": { | ||
"rx_unicast_packets": 0, | ||
"rx_octets": 0, | ||
"rx_broadcast_packets": 0, | ||
"rx_multicast_packets": 0, | ||
"rx_errors": 0, | ||
"tx_octets": 8, | ||
"rx_discards": -1, | ||
"rx_discards": 0, | ||
"tx_unicast_packets": 0, | ||
"tx_octets": 0, | ||
"tx_broadcast_packets": -1, | ||
"tx_multicast_packets": -1, | ||
"tx_errors": 0, | ||
"rx_unicast_packets": 0 | ||
"tx_discards": 0 | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
test/unit/mocked_data/test_get_interfaces_counters/normal/show_interface_summary.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,14 @@ | ||
|
||
*: interface is up | ||
IHQ: pkts in input hold queue IQD: pkts dropped from input queue | ||
OHQ: pkts in output hold queue OQD: pkts dropped from output queue | ||
RXBS: rx rate (bits/sec) RXPS: rx rate (pkts/sec) | ||
TXBS: tx rate (bits/sec) TXPS: tx rate (pkts/sec) | ||
TRTL: throttle count | ||
|
||
Interface IHQ IQD OHQ OQD RXBS RXPS TXBS TXPS TRTL | ||
----------------------------------------------------------------------------------------------------------------- | ||
* GigabitEthernet1 0 0 0 0 0 0 0 0 0 | ||
GigabitEthernet2 0 0 0 0 0 0 0 0 0 | ||
GigabitEthernet3 0 0 0 0 0 0 0 0 0 | ||
GigabitEthernet4 0 0 0 0 0 0 0 0 0 |
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