From 5d286e79515c8a6c856a5acde6300271422acfac Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Fri, 20 Nov 2020 14:54:27 -0500 Subject: [PATCH] ipatests: Clean up existing ACME registration and certs The same base class is used for ACME setup and configuration. Be sure to clean up any existing registraton prior to continuing otherwise ACME register will complain. https://pagure.io/freeipa/issue/8581 Signed-off-by: Rob Crittenden Reviewed-By: Florence Blanc-Renaud Reviewed-By: Mohammad Rizwan Reviewed-By: Armando Neto --- ipatests/test_integration/test_acme.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ipatests/test_integration/test_acme.py b/ipatests/test_integration/test_acme.py index 5c778d1e0..d83137e30 100644 --- a/ipatests/test_integration/test_acme.py +++ b/ipatests/test_integration/test_acme.py @@ -197,6 +197,19 @@ class TestACME(CALessBase): @pytest.mark.skipif(skip_certbot_tests, reason='certbot not available') def test_certbot_register(self): + # clean up any existing registration and certificates + self.clients[0].run_command( + [ + 'rm', '-rf', + '/etc/letsencrypt/accounts', + '/etc/letsencrypt/archive', + '/etc/letsencrypt/csr', + '/etc/letsencrypt/keys', + '/etc/letsencrypt/live', + '/etc/letsencrypt/renewal', + '/etc/letsencrypt/renewal-hooks' + ] + ) # service is enabled; registration should succeed self.clients[0].run_command( [