Ejemplo n.º 1
0
 def test_0203_send_receive_timeout(self):
     """Test that a timeout is triggered when no packet is received."""
     udp = bof.UDP()
     udp.connect("localhost", 13672)
     with (self.assertRaises(bof.BOFNetworkError)):
         result, _ = udp.send_receive("test_send_receive", timeout=0.1)
     udp.disconnect()
Ejemplo n.º 2
0
 def setUpClass(self):
     self.udp = bof.UDP()
     self.echo_server = Popen(UDP_ECHO_SERVER_CMD.split())
Ejemplo n.º 3
0
 def test_0104_udp_connect_bad_port(self):
     """Test error handling for bad port."""
     udp = bof.UDP()
     with self.assertRaises(bof.BOFNetworkError):
         udp.connect("localhost", 666666)
Ejemplo n.º 4
0
 def test_0103_udp_connect_bad_addr(self):
     """Test error handling for bad address."""
     udp = bof.UDP()
     with self.assertRaises(bof.BOFNetworkError):
         udp.connect("invalid", 13671)
Ejemplo n.º 5
0
 def test_0102_udp_connect(self):
     """Test regular UDP connection."""
     udp = bof.UDP()
     udp.connect("localhost", 13671)
     self.assertEqual(udp.source[0], '127.0.0.1')
     udp.disconnect()
Ejemplo n.º 6
0
 def test_0101_udp_instantiate(self):
     """Test correct BOF UDP object instantiation."""
     udp = bof.UDP()
Ejemplo n.º 7
0
 def setUpClass(self):
     self.udp = bof.UDP()