Skip to content

Commit

Permalink
Add mgmt port speed test (sonic-net#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
sumukhatv authored and qiluo-msft committed Jul 19, 2019
1 parent 3a58b88 commit 0fe27b1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_hc_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,25 @@ def test_mgmt_iface_alias(self):
self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 1, 10001))))
self.assertEqual(str(value0.data), 'mgmt1')

def test_mgmt_iface_speed(self):
"""
Test that mgmt port speed is 1000
"""
oid = ObjectIdentifier(11, 0, 0, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 15, 10000))
get_pdu = GetPDU(
header=PDUHeader(1, PduTypes.GET, 16, 0, 42, 0, 0, 0),
oids=[oid]
)

encoded = get_pdu.encode()
response = get_pdu.make_response(self.lut)
print(response)

value0 = response.values[0]
self.assertEqual(value0.type_, ValueType.GAUGE_32)
self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 15, 10000))))
self.assertEqual(value0.data, 1000)

def test_in_octets(self):
"""
For a port with no speed in the db the result should be 0
Expand Down

0 comments on commit 0fe27b1

Please sign in to comment.