From 7427daaa6c5da0ccd518af360106047087fb2688 Mon Sep 17 00:00:00 2001 From: Erica Portnoy Date: Mon, 9 Jan 2023 14:29:18 -0800 Subject: [PATCH] Add basic integration tests --- .../certbot_tests/test_main.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/certbot-ci/certbot_integration_tests/certbot_tests/test_main.py b/certbot-ci/certbot_integration_tests/certbot_tests/test_main.py index 65eca976d..158b12aba 100644 --- a/certbot-ci/certbot_integration_tests/certbot_tests/test_main.py +++ b/certbot-ci/certbot_integration_tests/certbot_tests/test_main.py @@ -813,6 +813,27 @@ def test_revoke_multiple_lineages(context: IntegrationTestsContext) -> None: assert 'Not deleting revoked certificates due to overlapping archive dirs' in f.read() +def test_reconfigure(context: IntegrationTestsContext) -> None: + """Test the reconfigure verb""" + certname = context.get_domain() + context.certbot(['-d', certname]) + conf_path = join(context.config_dir, 'renewal', '{}.conf'.format(certname)) + + # Test changing configurator + context.certbot(['reconfigure', '--cert-name', certname, '--nginx']) + with open(conf_path, 'r') as f: + assert 'authenticator = nginx' in f.read(), \ + 'Expected authenticator to be changed to nginx in renewal config' + assert 'installer = nginx' in f.read(), \ + 'Expected installer to be changed to nginx in renewal config' + + # Test adding new hook + context.certbot(['reconfigure', '--cert-name', certname, '--pre-hook', '"echo new pre hook"']) + with open(conf_path, 'r') as f: + assert 'pre_hook = echo new pre hook' in f.read(), \ + 'Expected new pre hook to added in renewal config' + + def test_wildcard_certificates(context: IntegrationTestsContext) -> None: """Test wildcard certificate issuance.""" certname = context.get_domain('wild')