コード例 #1
0
    def test_generate_doq_stamp_without_hashes(self):
        address = ""
        hashes = []
        hostname = "doq.example.com"
        options = [Option.DNSSEC, Option.NO_FILTERS]

        self.assertEqual(
            "sdns://BAUAAAAAAAAAAAAPZG9xLmV4YW1wbGUuY29t",
            dnsstamps.create_doq(address, hashes, hostname, options),
            "Invalid stamp")
コード例 #2
0
    def test_generate_doq_stamp(self):
        address = "[fe80::6d6d:f72c:3ad:60b8]"
        hashes = [
            "3e1a1a0f6c53f3e97a492d57084b5b9807059ee057ab1505876fd83fda3db838"
        ]
        hostname = "doq.example.com"

        self.assertEqual(
            "sdns://BAAAAAAAAAAAGltmZTgwOjo2ZDZkOmY3MmM6M2FkOjYwYjhdID4aGg9sU_PpekktVwhLW5gHBZ7gV6sVBYdv2D_aPbg4D2RvcS5leGFtcGxlLmNvbQ",
            dnsstamps.create_doq(address, hashes, hostname), "Invalid stamp")
コード例 #3
0
    def test_generate_doq_stamp_with_multiple_hashes(self):
        address = "127.0.0.1"
        hashes = [
            "3e1a1a0f6c53f3e97a492d57084b5b9807059ee057ab1505876fd83fda3db838",
            "d0b243776a6c10e4485b34ea3e3b3a063f3089770e04a78c8087b7c49d4f98d6"
        ]
        hostname = "doq.example.com"

        self.assertEqual(
            "sdns://BAAAAAAAAAAACTEyNy4wLjAuMaA-GhoPbFPz6XpJLVcIS1uYBwWe4FerFQWHb9g_2j24OCDQskN3amwQ5EhbNOo-OzoGPzCJdw4Ep4yAh7fEnU-Y1g9kb3EuZXhhbXBsZS5jb20",
            dnsstamps.create_doq(address, hashes, hostname), "Invalid stamp")
コード例 #4
0
    def test_generate_doq_stamp_with_options(self):
        address = "127.0.0.1"
        hashes = [
            "3e1a1a0f6c53f3e97a492d57084b5b9807059ee057ab1505876fd83fda3db838"
        ]
        hostname = "doq.example.com"
        options = [Option.DNSSEC]

        self.assertEqual(
            "sdns://BAEAAAAAAAAACTEyNy4wLjAuMSA-GhoPbFPz6XpJLVcIS1uYBwWe4FerFQWHb9g_2j24OA9kb3EuZXhhbXBsZS5jb20",
            dnsstamps.create_doq(address, hashes, hostname, options),
            "Invalid stamp")
コード例 #5
0
    def test_generate_doq_stamp_with_bootstrap_ips(self):
        address = "127.0.0.1"
        hashes = [
            "3e1a1a0f6c53f3e97a492d57084b5b9807059ee057ab1505876fd83fda3db838"
        ]
        hostname = "doq.example.com"
        bootstrap_ips = ["1.1.1.1"]

        self.assertEqual(
            "sdns://BAAAAAAAAAAACTEyNy4wLjAuMSA-GhoPbFPz6XpJLVcIS1uYBwWe4FerFQWHb9g_2j24OA9kb3EuZXhhbXBsZS5jb20HMS4xLjEuMQ",
            dnsstamps.create_doq(address,
                                 hashes,
                                 hostname,
                                 bootstrap_ips=bootstrap_ips), "Invalid stamp")