diff options
author | Julien Danjou <julien@danjou.info> | 2018-07-06 14:33:46 +0200 |
---|---|---|
committer | Julien Danjou <julien@danjou.info> | 2018-07-18 09:25:09 +0200 |
commit | 0c69979e0fd8203dcdd5097955c598628a942a91 (patch) | |
tree | 1015e5e7550e871de23cab55d8c23824af39c9e3 | |
parent | 4e4459d57af5cd2e938e5e9638433616b0fff8d2 (diff) | |
download | ceilometer-0c69979e0fd8203dcdd5097955c598628a942a91.tar.gz |
udp: remove wrong and useless tests
Those tests do not work on systems that are able to create AF_INET6 socket for
IPv4 addresses (e.g. Darwin). They also don't test anything since they're just
mocking stuff to check the logic.
Change-Id: I2205b969db09760dd96cfbc0fd701896ef944cf4
-rw-r--r-- | ceilometer/tests/unit/publisher/test_udp.py | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/ceilometer/tests/unit/publisher/test_udp.py b/ceilometer/tests/unit/publisher/test_udp.py index 58e1d97a..53224e18 100644 --- a/ceilometer/tests/unit/publisher/test_udp.py +++ b/ceilometer/tests/unit/publisher/test_udp.py @@ -16,7 +16,6 @@ """ import datetime -import socket import mock import msgpack @@ -113,42 +112,6 @@ class TestUDPPublisher(base.BaseTestCase): self.CONF = service.prepare_service([], []) self.CONF.publisher.telemetry_secret = 'not-so-secret' - def _check_udp_socket(self, url, expected_addr_family): - with mock.patch.object(socket, 'socket') as mock_socket: - udp.UDPPublisher(self.CONF, netutils.urlsplit(url)) - mock_socket.assert_called_with(expected_addr_family, - socket.SOCK_DGRAM) - - def test_publisher_udp_socket_ipv4(self): - self._check_udp_socket('udp://127.0.0.1:4952', - socket.AF_INET) - - def test_publisher_udp_socket_ipv6(self): - self._check_udp_socket('udp://[::1]:4952', - socket.AF_INET6) - - def test_publisher_udp_socket_ipv4_hostname(self): - host = "ipv4.google.com" - try: - socket.getaddrinfo(host, None, - socket.AF_INET, - socket.SOCK_DGRAM) - except socket.gaierror: - self.skipTest("cannot resolve not running test") - url = "udp://"+host+":4952" - self._check_udp_socket(url, socket.AF_INET) - - def test_publisher_udp_socket_ipv6_hostname(self): - host = "ipv6.google.com" - try: - socket.getaddrinfo(host, None, - socket.AF_INET6, - socket.SOCK_DGRAM) - except socket.gaierror: - self.skipTest("cannot resolve not running test") - url = "udp://"+host+":4952" - self._check_udp_socket(url, socket.AF_INET6) - def test_published(self): self.data_sent = [] with mock.patch('socket.socket', |