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