diff options
Diffstat (limited to 'testcases/functest_utils.py')
-rw-r--r-- | testcases/functest_utils.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/testcases/functest_utils.py b/testcases/functest_utils.py index d9f43a79e..e76ef991b 100644 --- a/testcases/functest_utils.py +++ b/testcases/functest_utils.py @@ -19,6 +19,7 @@ import json import shutil import re import yaml +import socket from git import Repo @@ -694,8 +695,11 @@ def get_resolvconf_ns(): line = rconf.readline() while line: ip = re.search(r"\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b", line) + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) if ip: - nameservers.append(ip.group()) + result = sock.connect_ex((ip.group(),53)) + if result == 0: + nameservers.append(ip.group()) line = rconf.readline() return nameservers |