Commit e9de7da4 authored by Guido Trotter's avatar Guido Trotter
Browse files

TestAsyncUDPSocket: test for oversized sends


Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarLuca Bigliardi <shammash@google.com>
parent 1de45c78
......@@ -28,7 +28,9 @@ import socket
import time
from ganeti import daemon
from ganeti import constants
from ganeti import utils
from ganeti import errors
import testutils
......@@ -235,6 +237,11 @@ class TestAsyncUDPSocket(testutils.GanetiTestCase):
self.mainloop.Run()
self.assertEquals(self.server.received, ["p1", "p2", "terminate"])
def testOversizedDatagram(self):
oversized_data = (constants.MAX_UDP_DATA_SIZE + 1) * "a"
self.assertRaises(errors.UdpDataSizeError, self.client.enqueue_send,
"127.0.0.1", self.port, oversized_data)
if __name__ == "__main__":
testutils.GanetiTestProgram()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment