Commit e41a13cf authored by Adrien Dorsaz's avatar Adrien Dorsaz
Browse files

test: add invalid TSIG test to confirm a failure is raised if key name isn't the good one

parent bc954b24
......@@ -88,6 +88,11 @@ def gen_configs():
with open(, 'w') as configfile:
invalidTSIGName = NamedTemporaryFile()
config["TSIGKeyring"]["KeyName"] = "{0}.invalid".format(TSIGKEYNAME)
with open(, 'w') as configfile:
missingDNS = NamedTemporaryFile()
config["DNS"] = {}
with open(, 'w') as configfile:
......@@ -99,6 +104,7 @@ def gen_configs():
"goodSAN": goodSAN,
"weakKey": weakKey,
"accountAsDomain": accountAsDomain,
"invalidTSIGName": invalidTSIGName,
"missingDNS": missingDNS,
"key": {"accountkey": account_key,
"weakkey": weak_key,
......@@ -83,6 +83,15 @@ class TestModule(unittest.TestCase):
self.assertIsInstance(result, ValueError)
self.assertIn("Certificate public key must be different than account key", result.args[0])
def test_failure_dns_update_tsigkeyname(self):
""" Fail to update DNS records by invalid TSIG Key name """
result = acme_dns_tiny.main([CONFIGS['invalidTSIGName'].name])
except Exception as e:
result = e
self.assertIsInstance(result, ValueError)
self.assertIn("Error updating DNS", result.args[0])
def test_failure_notcompleted_configuration(self):
""" Configuration file have to be completed """
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment