Exemplo n.º 1
0
 def test_udp_ipv6_wrong_addr_ignore(self):
     with tests.mock.patch(
             'eventlet.support.greendns.socket.socket.recvfrom',
             side_effect=socket.timeout):
         with tests.assert_raises(dns.exception.Timeout):
             greendns.udp(self.query,
                          '::1',
                          timeout=0.1,
                          ignore_unexpected=True)
Exemplo n.º 2
0
 def test_udp_ipv6_wrong_addr(self):
     with tests.mock.patch('eventlet.support.greendns.socket.socket.recvfrom',
                           return_value=(self.query_wire,
                                         ('ffff:0000::1', 53, 0, 0))):
         with tests.assert_raises(dns.query.UnexpectedSource):
             greendns.udp(self.query, '::1')
Exemplo n.º 3
0
 def test_udp_ipv6_wrong_addr_ignore(self):
     with tests.mock.patch('eventlet.support.greendns.socket.socket.recvfrom',
                           side_effect=socket.timeout):
         with tests.assert_raises(dns.exception.Timeout):
             greendns.udp(self.query, '::1', timeout=0.1, ignore_unexpected=True)
Exemplo n.º 4
0
 def test_udp_ipv6_addr_zeroes(self):
     with tests.mock.patch('eventlet.support.greendns.socket.socket.recvfrom',
                           return_value=(self.query_wire,
                                         ('0:00:0000::1', 53, 0, 0))):
         greendns.udp(self.query, '::1')
Exemplo n.º 5
0
 def test_udp_ipv6_timeout(self):
     with tests.mock.patch('eventlet.support.greendns.socket.socket.recvfrom',
                           side_effect=socket.timeout):
         with tests.assert_raises(dns.exception.Timeout):
             greendns.udp(self.query, '::1', timeout=0.1)
Exemplo n.º 6
0
 def test_udp_ipv6_wrong_addr(self):
     with tests.mock.patch(
             'eventlet.support.greendns.socket.socket.recvfrom',
             return_value=(self.query_wire, ('ffff:0000::1', 53, 0, 0))):
         with tests.assert_raises(dns.query.UnexpectedSource):
             greendns.udp(self.query, '::1')
Exemplo n.º 7
0
 def test_udp_ipv6_addr_zeroes(self):
     with tests.mock.patch(
             'eventlet.support.greendns.socket.socket.recvfrom',
             return_value=(self.query_wire, ('0:00:0000::1', 53, 0, 0))):
         greendns.udp(self.query, '::1')
Exemplo n.º 8
0
 def test_udp_ipv6_timeout(self):
     with tests.mock.patch(
             'eventlet.support.greendns.socket.socket.recvfrom',
             side_effect=socket.timeout):
         with tests.assert_raises(dns.exception.Timeout):
             greendns.udp(self.query, '::1', timeout=0.1)
Exemplo n.º 9
0
 def test_udp_ipv4(self):
     with tests.mock.patch('eventlet.support.greendns.socket.socket.recvfrom',
                           return_value=(self.query_wire,
                                         ('127.0.0.1', 53))):
         greendns.udp(self.query, '127.0.0.1')