Mark Bergsma has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/356620 )
Change subject: Add BGP.parse{KeepAlive,Notification} test cases
......................................................................
Add BGP.parse{KeepAlive,Notification} test cases
Change-Id: I57c71ddd12fe0c9f271debd4dcbda99181025484
---
M pybal/bgp/test/test_bgp.py
1 file changed, 10 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/debs/pybal
refs/changes/20/356620/1
diff --git a/pybal/bgp/test/test_bgp.py b/pybal/bgp/test/test_bgp.py
index 309b2a1..34eba77 100644
--- a/pybal/bgp/test/test_bgp.py
+++ b/pybal/bgp/test/test_bgp.py
@@ -230,3 +230,13 @@
msgdata = bytearray(bytes(update)[bgp.HDR_LEN:])
msgdata[0] += 66
self.assertRaises(Exception, self.proto.parseUpdate, msgdata)
+
+ def testParseKeepAlive(self):
+ self.assertRaises(bgp.BadMessageLength, self.proto.parseKeepAlive, b'
')
+
+ def testParseNotification(self):
+ msg = (struct.pack('!BB', bgp.ERR_MSG_UPDATE,
+ bgp.ERR_MSG_UPDATE_MALFORMED_ASPATH) + b"Unit test")
+ self.assertEquals(self.proto.parseNotification(msg),
+ (bgp.ERR_MSG_UPDATE, bgp.ERR_MSG_UPDATE_MALFORMED_ASPATH, b"Unit
test"))
+ self.assertRaises(bgp.BadMessageLength, self.proto.parseNotification,
b' ')
--
To view, visit https://gerrit.wikimedia.org/r/356620
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I57c71ddd12fe0c9f271debd4dcbda99181025484
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/pybal
Gerrit-Branch: master
Gerrit-Owner: Mark Bergsma <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits