Blame SOURCES/0001-Skip-tests-that-require-external-network-connection_rhbz#1914296.patch

fba76a
From 0414551fab97825fb826882b9c23c1a3ea0b71ea Mon Sep 17 00:00:00 2001
fba76a
From: Rafael Guterres Jeffman <rjeffman@redhat.com>
fba76a
Date: Thu, 22 Apr 2021 10:08:41 -0300
fba76a
Subject: [PATCH] Skip tests that require external network connection.
fba76a
fba76a
---
fba76a
 tests/test_async.py             | 11 ++---------
fba76a
 tests/test_query.py             |  9 ++-------
fba76a
 tests/test_resolver.py          | 10 ++--------
fba76a
 tests/test_resolver_override.py |  9 ++-------
fba76a
 4 files changed, 8 insertions(+), 31 deletions(-)
fba76a
fba76a
diff --git a/tests/test_async.py b/tests/test_async.py
fba76a
index 0252f22..370c6bb 100644
fba76a
--- a/tests/test_async.py
fba76a
+++ b/tests/test_async.py
d773ec
@@ -38,15 +38,10 @@ try:
fba76a
 except Exception:
fba76a
     _ssl_available = False
fba76a
 
d773ec
fba76a
-# Some tests require the internet to be available to run, so let's
fba76a
-# skip those if it's not there.
fba76a
-_network_available = True
fba76a
-try:
fba76a
-    socket.gethostbyname('dnspython.org')
fba76a
-except socket.gaierror:
fba76a
-    _network_available = False
fba76a
+# RHEL 9 build environment does not have provide external network access.
fba76a
+_network_available = False
d773ec
fba76a
 
d773ec
 # Look for systemd-resolved, as it does dangling CNAME responses incorrectly.
d773ec
 #
fba76a
diff --git a/tests/test_query.py b/tests/test_query.py
fba76a
index 2cff377..99dc873 100644
fba76a
--- a/tests/test_query.py
fba76a
+++ b/tests/test_query.py
fba76a
@@ -36,13 +36,8 @@ import dns.query
fba76a
 import dns.tsigkeyring
fba76a
 import dns.zone
fba76a
 
fba76a
-# Some tests require the internet to be available to run, so let's
fba76a
-# skip those if it's not there.
fba76a
-_network_available = True
fba76a
-try:
fba76a
-    socket.gethostbyname('dnspython.org')
fba76a
-except socket.gaierror:
fba76a
-    _network_available = False
fba76a
+# RHEL 9 build environment does not have provide external network access.
fba76a
+_network_available = False
fba76a
 
fba76a
 # Some tests use a "nano nameserver" for testing.  It requires trio
fba76a
 # and threading, so try to import it and if it doesn't work, skip
fba76a
diff --git a/tests/test_resolver.py b/tests/test_resolver.py
fba76a
index 4f5643d..b26ab65 100644
fba76a
--- a/tests/test_resolver.py
fba76a
+++ b/tests/test_resolver.py
fba76a
@@ -18,7 +18,6 @@
fba76a
 from io import StringIO
fba76a
 import selectors
fba76a
 import sys
fba76a
-import socket
fba76a
 import time
fba76a
 import unittest
fba76a
 
fba76a
@@ -31,13 +30,8 @@ import dns.resolver
fba76a
 import dns.tsig
fba76a
 import dns.tsigkeyring
fba76a
 
fba76a
-# Some tests require the internet to be available to run, so let's
fba76a
-# skip those if it's not there.
fba76a
-_network_available = True
fba76a
-try:
fba76a
-    socket.gethostbyname('dnspython.org')
fba76a
-except socket.gaierror:
fba76a
-    _network_available = False
fba76a
+# RHEL 9 build environment does not have provide external network access.
fba76a
+_network_available = False
fba76a
 
fba76a
 # Some tests use a "nano nameserver" for testing.  It requires trio
fba76a
 # and threading, so try to import it and if it doesn't work, skip
fba76a
diff --git a/tests/test_resolver_override.py b/tests/test_resolver_override.py
fba76a
index ac93316..036a42e 100644
fba76a
--- a/tests/test_resolver_override.py
fba76a
+++ b/tests/test_resolver_override.py
fba76a
@@ -9,13 +9,8 @@ import dns.rdataclass
fba76a
 import dns.rdatatype
fba76a
 import dns.resolver
fba76a
 
fba76a
-# Some tests require the internet to be available to run, so let's
fba76a
-# skip those if it's not there.
fba76a
-_network_available = True
fba76a
-try:
fba76a
-    socket.gethostbyname('dnspython.org')
fba76a
-except socket.gaierror:
fba76a
-    _network_available = False
fba76a
+# RHEL 9 build environment does not have provide external network access.
fba76a
+_network_available = False
fba76a
 
fba76a
 
fba76a
 @unittest.skipIf(not _network_available, "Internet not reachable")
fba76a
-- 
fba76a
2.30.2
fba76a