diff --git a/0001-Skip-tests-that-require-external-network-connection_rhbz#1914296.patch b/0001-Skip-tests-that-require-external-network-connection_rhbz#1914296.patch new file mode 100644 index 0000000..34dafa1 --- /dev/null +++ b/0001-Skip-tests-that-require-external-network-connection_rhbz#1914296.patch @@ -0,0 +1,105 @@ +From 0414551fab97825fb826882b9c23c1a3ea0b71ea Mon Sep 17 00:00:00 2001 +From: Rafael Guterres Jeffman +Date: Thu, 22 Apr 2021 10:08:41 -0300 +Subject: [PATCH] Skip tests that require external network connection. + +--- + tests/test_async.py | 11 ++--------- + tests/test_query.py | 9 ++------- + tests/test_resolver.py | 10 ++-------- + tests/test_resolver_override.py | 9 ++------- + 4 files changed, 8 insertions(+), 31 deletions(-) + +diff --git a/tests/test_async.py b/tests/test_async.py +index 0252f22..370c6bb 100644 +--- a/tests/test_async.py ++++ b/tests/test_async.py +@@ -38,15 +38,8 @@ try: + except Exception: + _ssl_available = False + +- +-# Some tests require the internet to be available to run, so let's +-# skip those if it's not there. +-_network_available = True +-try: +- socket.gethostbyname('dnspython.org') +-except socket.gaierror: +- _network_available = False +- ++# RHEL 9 build environment does not have provide external network access. ++_network_available = False + + # Probe for IPv4 and IPv6 + query_addresses = [] +diff --git a/tests/test_query.py b/tests/test_query.py +index 2cff377..99dc873 100644 +--- a/tests/test_query.py ++++ b/tests/test_query.py +@@ -36,13 +36,8 @@ import dns.query + import dns.tsigkeyring + import dns.zone + +-# Some tests require the internet to be available to run, so let's +-# skip those if it's not there. +-_network_available = True +-try: +- socket.gethostbyname('dnspython.org') +-except socket.gaierror: +- _network_available = False ++# RHEL 9 build environment does not have provide external network access. ++_network_available = False + + # Some tests use a "nano nameserver" for testing. It requires trio + # and threading, so try to import it and if it doesn't work, skip +diff --git a/tests/test_resolver.py b/tests/test_resolver.py +index 4f5643d..b26ab65 100644 +--- a/tests/test_resolver.py ++++ b/tests/test_resolver.py +@@ -18,7 +18,6 @@ + from io import StringIO + import selectors + import sys +-import socket + import time + import unittest + +@@ -31,13 +30,8 @@ import dns.resolver + import dns.tsig + import dns.tsigkeyring + +-# Some tests require the internet to be available to run, so let's +-# skip those if it's not there. +-_network_available = True +-try: +- socket.gethostbyname('dnspython.org') +-except socket.gaierror: +- _network_available = False ++# RHEL 9 build environment does not have provide external network access. ++_network_available = False + + # Some tests use a "nano nameserver" for testing. It requires trio + # and threading, so try to import it and if it doesn't work, skip +diff --git a/tests/test_resolver_override.py b/tests/test_resolver_override.py +index ac93316..036a42e 100644 +--- a/tests/test_resolver_override.py ++++ b/tests/test_resolver_override.py +@@ -9,13 +9,8 @@ import dns.rdataclass + import dns.rdatatype + import dns.resolver + +-# Some tests require the internet to be available to run, so let's +-# skip those if it's not there. +-_network_available = True +-try: +- socket.gethostbyname('dnspython.org') +-except socket.gaierror: +- _network_available = False ++# RHEL 9 build environment does not have provide external network access. ++_network_available = False + + + @unittest.skipIf(not _network_available, "Internet not reachable") +-- +2.30.2 + diff --git a/python-dns.spec b/python-dns.spec index 4bf5b8d..084298f 100644 --- a/python-dns.spec +++ b/python-dns.spec @@ -14,7 +14,7 @@ Name: python-%{py_package_name} Version: 2.1.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: DNS toolkit for Python # The entire package is licensed with both licenses, see LICENSE file @@ -22,6 +22,7 @@ License: ISC and MIT URL: http://www.dnspython.org Source0: https://github.com/rthalley/%{pypi_name}/archive/v%{version}%{rctag}/%{pypi_name}-%{version}%{rctag}.tar.gz +Patch0: 0001-Skip-tests-that-require-external-network-connection_rhbz#1914296.patch BuildArch: noarch BuildRequires: python3-devel @@ -110,6 +111,9 @@ pytest -k "not testCanonicalNameDangling" } %changelog +* Thu Apr 22 2021 Rafael Jeffman - 2.1.0-5 +- Skip tests that require external network connection. + * Fri Apr 16 2021 Mohan Boddu - 2.1.0-4 - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937