]> granicus.if.org Git - pdns/commitdiff
dnsdist: upgrade nose, add timeouts in responder, be verbose
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 7 Jan 2016 13:27:51 +0000 (14:27 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 7 Jan 2016 13:27:51 +0000 (14:27 +0100)
.travis.yml
regression-tests.dnsdist/dnscrypt.py
regression-tests.dnsdist/dnsdisttests.py
regression-tests.dnsdist/requirements.txt

index 4d227861e202179a01874678914f1408e8aae7bc..569ee694982c2e76b6c15048d940046a374cd060 100644 (file)
@@ -285,7 +285,7 @@ script:
   - ./testrunner
   - cp ./dnsdist ../../../regression-tests.dnsdist/
   - cd ../../../regression-tests.dnsdist
-  - DNSDISTBIN=./dnsdist ./runtests
+  - DNSDISTBIN=./dnsdist ./runtests -v
   - rm -f ./dnsdist
   - rm -f ./DNSCryptResolver.cert ./DNSCryptResolver.key
   - cd ..
index bb6689595d68e75aa894c206b60f340feff72964..82957c50ebf5bbb2f26e7cac5e8734c79f14414e 100644 (file)
@@ -63,7 +63,7 @@ class DNSCryptClient:
 
         return result
 
-    def __init__(self, providerName, providerFingerprint, resolverAddress, resolverPort=443):
+    def __init__(self, providerName, providerFingerprint, resolverAddress, resolverPort=443, timeout=2):
         self._providerName = providerName
         self._providerFingerprint = providerFingerprint.lower().replace(':', '').decode('hex')
         self._resolverAddress = resolverAddress
@@ -73,8 +73,8 @@ class DNSCryptClient:
 
         addrType = self._addrToSocketType(self._resolverAddress)
         self._sock = socket.socket(addrType, socket.SOCK_DGRAM)
+        self._sock.settimeout(timeout)
         self._sock.connect((self._resolverAddress, self._resolverPort))
-        self._sock.settimeout(2)
 
     def _sendQuery(self, queryContent):
         self._sock.send(queryContent)
index d6a58571b4f0adfd03df96dcddfb1c24b02a67c1..f947359004329568dc5fa20fdf8b622fb624b6a1 100644 (file)
@@ -95,13 +95,13 @@ class DNSDistTest(unittest.TestCase):
 
         if cls._dnsdist.poll() is not None:
             cls._dnsdist.kill()
-            cls._dnsdist.wait()
             sys.exit(cls._dnsdist.returncode)
 
     @classmethod
     def setUpSockets(cls):
         print("Setting up UDP socket..")
         cls._sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+        cls._sock.settimeout(2.0)
         cls._sock.connect(("127.0.0.1", cls._dnsDistPort))
 
     @classmethod
@@ -125,7 +125,7 @@ class DNSDistTest(unittest.TestCase):
                 time.sleep(delay)
                 if cls._dnsdist.poll() is None:
                     cls._dnsdist.kill()
-            cls._dnsdist.wait()
+                cls._dnsdist.wait()
 
     @classmethod
     def ResponderIncrementCounter(cls):
@@ -169,7 +169,9 @@ class DNSDistTest(unittest.TestCase):
                 if rrset:
                     response.answer.append(rrset)
 
+            sock.settimeout(2.0)
             sock.sendto(response.to_wire(), addr)
+            sock.settimeout(None)
         sock.close()
 
     @classmethod
@@ -185,6 +187,7 @@ class DNSDistTest(unittest.TestCase):
         sock.listen(100)
         while True:
             (conn, address) = sock.accept()
+            conn.settimeout(2.0)
             data = conn.recv(2)
             (datalen,) = struct.unpack("!H", data)
             data = conn.recv(datalen)
index e33025f32eebeb4dc776b6dfa2e94bde58498032..5521abf7c59c7e399930c9472ebe40d99e405942 100644 (file)
@@ -1,3 +1,3 @@
 dnspython>=1.11
-nose==1.3.0
+nose>=1.3.7
 libnacl>=1.4.3