#!/usr/bin/env python
-import unittest
import dns
import clientsubnetoption
from dnsdisttests import DNSDistTest
#!/usr/bin/env python
import unittest
import dns
+import os
import shutil
import socket
import time
from dnsdisttests import DNSDistTest
+@unittest.skipIf('SKIP_CDB_TESTS' in os.environ, 'CDB tests are disabled')
class CDBTest(DNSDistTest):
_cdbFileName = '/tmp/test-cdb-db'
#!/usr/bin/env python
import base64
import dns
+import os
+import unittest
import clientsubnetoption
from dnsdisttests import DNSDistTest
#from hyper import HTTP20Connection
#from hyper.ssl_compat import SSLContext, PROTOCOL_TLSv1_2
+@unittest.skipIf('SKIP_DOH_TESTS' in os.environ, 'DNS over HTTPS tests are disabled')
class DNSDistDOHTest(DNSDistTest):
@classmethod
cls._response_headers = response_headers.getvalue()
return (receivedQuery, message)
+ @classmethod
+ def setUpClass(cls):
+
+ # for some reason, @unittest.skipIf() is not applied to derived classes with some versions of Python
+ if 'SKIP_DOH_TESTS' in os.environ:
+ raise unittest.SkipTest('DNS over HTTPS tests are disabled')
+
+ cls.startResponders()
+ cls.startDNSDist()
+ cls.setUpSockets()
+
+ print("Launching tests..")
+
# @classmethod
# def openDOHConnection(cls, port, caFile, timeout=2.0):
# sslctx = SSLContext(PROTOCOL_TLSv1_2)
import unittest
import dns
import lmdb
+import os
import socket
from dnsdisttests import DNSDistTest
+@unittest.skipIf('SKIP_LMDB_TESTS' in os.environ, 'LMDB tests are disabled')
class TestLMDB(DNSDistTest):
_lmdbFileName = '/tmp/test-lmdb-db'
#!/usr/bin/env python
import dns
+import os
import subprocess
+import unittest
from dnsdisttests import DNSDistTest
class DNSDistOCSPStaplingTest(DNSDistTest):
return output[0].decode()
+@unittest.skipIf('SKIP_DOH_TESTS' in os.environ, 'DNS over HTTPS tests are disabled')
class TestOCSPStaplingDOH(DNSDistOCSPStaplingTest):
_serverKey = 'server.key'
"""
_config_params = ['_testServerPort', '_serverCert', '_caCert', '_caKey', '_ocspFile', '_dohServerPort', '_serverCert', '_serverKey', '_ocspFile']
+ @classmethod
+ def setUpClass(cls):
+
+ # for some reason, @unittest.skipIf() is not applied to derived classes with some versions of Python
+ if 'SKIP_DOH_TESTS' in os.environ:
+ raise unittest.SkipTest('DNS over HTTPS tests are disabled')
+
+ cls.startResponders()
+ cls.startDNSDist()
+ cls.setUpSockets()
+
+ print("Launching tests..")
+
def testOCSPStapling(self):
"""
OCSP Stapling: DOH
#!/usr/bin/env python
+import os
import requests
import subprocess
+import unittest
from dnsdisttests import DNSDistTest
+@unittest.skipIf('SKIP_PROMETHEUS_TESTS' in os.environ, 'Prometheus tests are disabled')
class TestPrometheus(DNSDistTest):
_webTimeout = 2.0
import subprocess
import tempfile
import time
+import unittest
from dnsdisttests import DNSDistTest
try:
range = xrange
with open(outputFile, 'wb') as fp:
fp.write(os.urandom(numberOfTickets * 80))
+@unittest.skipIf('SKIP_DOH_TESTS' in os.environ, 'DNS over HTTPS tests are disabled')
class TestNoTLSSessionResumptionDOH(DNSDistTLSSessionResumptionTest):
_serverKey = 'server.key'
self.assertFalse(self.checkSessionResumed('127.0.0.1', self._dohServerPort, self._serverName, self._caCert, '/tmp/no-session.out.doh', None, allowNoTicket=True))
self.assertFalse(self.checkSessionResumed('127.0.0.1', self._dohServerPort, self._serverName, self._caCert, '/tmp/no-session.out.doh', '/tmp/no-session.out.doh', allowNoTicket=True))
+@unittest.skipIf('SKIP_DOH_TESTS' in os.environ, 'DNS over HTTPS tests are disabled')
class TestTLSSessionResumptionDOH(DNSDistTLSSessionResumptionTest):
_serverKey = 'server.key'
#!/usr/bin/env python
-import unittest
import dns
import clientsubnetoption
from dnsdisttests import DNSDistTest