Commit 1ae4370d authored by Adrien Dorsaz's avatar Adrien Dorsaz

staging_test_acme_dns_tiny: tearDown should not try to parse cname_csr as a config file

parent baac0d4a
Pipeline #268 passed with stages
in 22 minutes and 19 seconds
...@@ -41,22 +41,22 @@ class TestACMEDNSTiny(unittest.TestCase): ...@@ -41,22 +41,22 @@ class TestACMEDNSTiny(unittest.TestCase):
def tearDownClass(cls): def tearDownClass(cls):
# close temp files correctly # close temp files correctly
for conffile in cls.configs: for conffile in cls.configs:
parser = configparser.ConfigParser() # for each configuration file, deactivate the account and remove linked temporary files
parser.read(cls.configs[conffile]) if conffile != "cname_csr":
try: parser = configparser.ConfigParser()
# for each configuration, deactivate the account key parser.read(cls.configs[conffile])
if conffile != "cname_csr": try:
account_deactivate(parser["acmednstiny"]["AccountKeyFile"], ACME_DIRECTORY) account_deactivate(parser["acmednstiny"]["AccountKeyFile"], ACME_DIRECTORY)
except: except:
pass pass
try: try:
os.remove(parser["acmednstiny"]["AccountKeyFile"]) os.remove(parser["acmednstiny"]["AccountKeyFile"])
except: except:
pass pass
try: try:
os.remove(parser["acmednstiny"]["CSRFile"]) os.remove(parser["acmednstiny"]["CSRFile"])
except: except:
pass pass
try: try:
os.remove(cls.configs[conffile]) os.remove(cls.configs[conffile])
except: except:
...@@ -65,7 +65,7 @@ class TestACMEDNSTiny(unittest.TestCase): ...@@ -65,7 +65,7 @@ class TestACMEDNSTiny(unittest.TestCase):
# helper function to valid success by making assertion on returned certificate chain # helper function to valid success by making assertion on returned certificate chain
def _assert_certificate_chain(self, cert_chain): def _assert_certificate_chain(self, cert_chain):
# Output have to contains two certiicates # Output have to contains two certificates
certlist = cert_chain.split("-----BEGIN CERTIFICATE-----") certlist = cert_chain.split("-----BEGIN CERTIFICATE-----")
self.assertEqual(3, len(certlist)) self.assertEqual(3, len(certlist))
self.assertEqual('', certlist[0]) self.assertEqual('', certlist[0])
......
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