Ejemplo n.º 1
0
 def test_bad_interface_address(self):
     config = send.StreamConfig()
     udp_ibv_config = send.UdpIbvConfig(
         endpoints=[('239.255.88.88', 8888)],
         interface_address='this is not an interface address')
     with pytest.raises(RuntimeError, match='Host not found'):
         send.UdpIbvStream(spead2.ThreadPool(), config, udp_ibv_config)
Ejemplo n.º 2
0
 def test_unicast_endpoints(self):
     config = send.StreamConfig()
     udp_ibv_config = send.UdpIbvConfig(endpoints=[('10.0.0.1', 8888)],
                                        interface_address='10.0.0.1')
     with pytest.raises(ValueError,
                        match='endpoint is not an IPv4 multicast address'):
         send.UdpIbvStream(spead2.ThreadPool(), config, udp_ibv_config)
Ejemplo n.º 3
0
 def test_ipv6_interface_address(self):
     config = send.StreamConfig()
     udp_ibv_config = send.UdpIbvConfig(
         endpoints=[('239.255.88.88', 8888)],
         interface_address='::1')
     with pytest.raises(ValueError, match='interface address'):
         send.UdpIbvStream(spead2.ThreadPool(), config, udp_ibv_config)
Ejemplo n.º 4
0
 def test_empty_memory_region(self):
     data = bytearray(0)
     config = send.StreamConfig()
     udp_ibv_config = send.UdpIbvConfig(endpoints=[('239.255.88.88', 8888)],
                                        interface_address='10.0.0.1',
                                        memory_regions=[data])
     with pytest.raises(ValueError,
                        match='memory region must have non-zero size'):
         send.UdpIbvStream(spead2.ThreadPool(), config, udp_ibv_config)
Ejemplo n.º 5
0
 def test_overlapping_memory_regions(self):
     data = memoryview(bytearray(10))
     part1 = data[:6]
     part2 = data[5:]
     config = send.StreamConfig()
     udp_ibv_config = send.UdpIbvConfig(endpoints=[('239.255.88.88', 8888)],
                                        interface_address='10.0.0.1',
                                        memory_regions=[part1, part2])
     with pytest.raises(ValueError, match='memory regions overlap'):
         send.UdpIbvStream(spead2.ThreadPool(), config, udp_ibv_config)
Ejemplo n.º 6
0
 def test_no_endpoints(self):
     config = send.StreamConfig()
     udp_ibv_config = send.UdpIbvConfig(interface_address='10.0.0.1')
     with pytest.raises(ValueError, match='endpoints is empty'):
         send.UdpIbvStream(spead2.ThreadPool(), config, udp_ibv_config)