Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dnsviz/dnsviz.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCasey Deccio <casey@deccio.net>2019-01-12 08:03:44 +0300
committerCasey Deccio <casey@deccio.net>2019-01-15 06:09:43 +0300
commit876737c3b7029e60619c34e37f70e8c8cdb87c99 (patch)
treee05cba396d6855655acf38aa0bec3638698a0f41 /tests
parent3024f1cc01c2b899c687a98f79862da13dd954d1 (diff)
Add tests for probing for zone files
Diffstat (limited to 'tests')
-rw-r--r--tests/local_probe_tests.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/local_probe_tests.py b/tests/local_probe_tests.py
new file mode 100644
index 0000000..fcd4724
--- /dev/null
+++ b/tests/local_probe_tests.py
@@ -0,0 +1,27 @@
+import io
+import os
+import subprocess
+import unittest
+
+DATA_DIR = os.path.dirname(__file__)
+EXAMPLE_COM_SIGNED = os.path.join(DATA_DIR, 'zone', 'example.com.zone.signed')
+EXAMPLE_COM_ZONE = os.path.join(DATA_DIR, 'zone', 'example.com.zone')
+EXAMPLE_COM_DELEGATION = os.path.join(DATA_DIR, 'zone', 'example.com.zone-delegation')
+
+class DNSProbeTestCase(unittest.TestCase):
+ def setUp(self):
+ self.devnull = io.open('/dev/null', 'wb')
+
+ def tearDown(self):
+ self.devnull.close()
+
+ def test_authoritative_probe_root(self):
+ self.assertEqual(subprocess.call(
+ ['dnsviz', 'probe', '-d', '0', '-A',
+ '-x' 'example.com:%s' % EXAMPLE_COM_SIGNED,
+ '-N' 'example.com:%s' % EXAMPLE_COM_DELEGATION,
+ '-D' 'example.com:%s' % EXAMPLE_COM_DELEGATION,
+ 'example.com'], stdout=self.devnull), 0)
+
+if __name__ == '__main__':
+ unittest.main()