]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - regression-tests.dnsdist/test_Console.py
dnsdist: Support setting the value of AA, AD and RA when spoofing
[thirdparty/pdns.git] / regression-tests.dnsdist / test_Console.py
index 0ab8c8fdbe92736281b835987343797fe5f4cb7d..952cc2afa6a151a1b232512ee72a2764537cfc10 100644 (file)
@@ -41,3 +41,20 @@ class TestConsoleNotAllowed(DNSDistTest):
         Console: Not allowed by the ACL
         """
         self.assertRaises(SocketError, self.sendConsoleCommand, 'showVersion()')
+
+class TestConsoleNoKey(DNSDistTest):
+
+    _consoleKey = DNSDistTest.generateConsoleKey()
+    _consoleKeyB64 = base64.b64encode(_consoleKey).decode('ascii')
+
+    _config_params = ['_consolePort', '_testServerPort']
+    _config_template = """
+    controlSocket("127.0.0.1:%s")
+    newServer{address="127.0.0.1:%d"}
+    """
+
+    def testConsoleAllowed(self):
+        """
+        Console: No key, the connection should not be allowed
+        """
+        self.assertRaises(SocketError, self.sendConsoleCommand, 'showVersion()')