diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:26:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:26:00 +0000 |
commit | 830407e88f9d40d954356c3754f2647f91d5c06a (patch) | |
tree | d6a0ece6feea91f3c656166dbaa884ef8a29740e /tests/integration/deckard/pydnstest/tests/test_parse_config.py | |
parent | Initial commit. (diff) | |
download | knot-resolver-upstream.tar.xz knot-resolver-upstream.zip |
Adding upstream version 5.6.0.upstream/5.6.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/integration/deckard/pydnstest/tests/test_parse_config.py')
-rw-r--r-- | tests/integration/deckard/pydnstest/tests/test_parse_config.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/integration/deckard/pydnstest/tests/test_parse_config.py b/tests/integration/deckard/pydnstest/tests/test_parse_config.py new file mode 100644 index 0000000..d8cdea1 --- /dev/null +++ b/tests/integration/deckard/pydnstest/tests/test_parse_config.py @@ -0,0 +1,17 @@ +""" This is unittest file for parse methods in scenario.py """ +import os + +from pydnstest.scenario import parse_config + + +def test_parse_config__trust_anchor(): + """Checks if trust-anchors are separated into files according to domain.""" + anchor1 = u'domain1.com.\t3600\tIN\tDS\t11901 7 1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + anchor2 = u'domain2.net.\t3600\tIN\tDS\t59835 7 1 cccccccccccccccccccccccccccccccccccccccc' + anchor3 = u'domain1.com.\t3600\tIN\tDS\t11902 7 1 1111111111111111111111111111111111111111' + anchors = [[u'trust-anchor', u'"{}"'.format(anchor1)], + [u'trust-anchor', u'"{}"'.format(anchor2)], + [u'trust-anchor', u'"{}"'.format(anchor3)]] + args = (anchors, True, os.getcwd()) + ta_files = parse_config(*args)["TRUST_ANCHOR_FILES"] + assert sorted(ta_files.values()) == sorted([[anchor1, anchor3], [anchor2]]) |