summaryrefslogtreecommitdiffstats
path: root/testcases/functest_utils.py
diff options
context:
space:
mode:
authorboucherv <valentin.boucher@orange.com>2016-01-19 14:13:43 +0100
committerMorgan Richomme <morgan.richomme@orange.com>2016-01-19 13:22:05 +0000
commit77e826cec8341e39ec7b92a32186b2e65bfc0fcf (patch)
treea1b0c2dcf7c2093959879fafb10c4de6efa571d1 /testcases/functest_utils.py
parent20935e628eff0fe20d2d053b10af59e514d5ab29 (diff)
Ensure nameserver ip works
Change-Id: I380b69bcfa79873fbde3412ab994f9c34c4b9ac2 Signed-off-by: boucherv <valentin.boucher@orange.com> (cherry picked from commit 4dc35c36e80521b0fe0ca6ab528d2c4e062b2a12)
Diffstat (limited to 'testcases/functest_utils.py')
-rw-r--r--testcases/functest_utils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/testcases/functest_utils.py b/testcases/functest_utils.py
index baab415d9..ef0b8afd2 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
@@ -662,8 +663,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