From 2e85b4809afb4757fd7b81868709ced4f211d7b4 Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Fri, 17 Apr 2020 13:37:28 +0300 Subject: [PATCH] ipatests/test_installation: Use knownservices to map the service name. Reviewed-By: Christian Heimes --- ipatests/test_integration/test_installation.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ipatests/test_integration/test_installation.py b/ipatests/test_integration/test_installation.py index d8fad7e06..8546d52cc 100644 --- a/ipatests/test_integration/test_installation.py +++ b/ipatests/test_integration/test_installation.py @@ -607,24 +607,25 @@ class TestInstallMaster(IntegrationTest): other hand in case of restart it will change. """ # listing all services - services = [ + ipa_services_name = [ "Directory", "krb5kdc", "kadmin", "named", "httpd", "ipa-custodia", "pki-tomcatd", "ipa-otpd", "ipa-dnskeysyncd" ] # checking the service status cmd = self.master.run_command(['ipactl', 'status']) - for service in services: + for service in ipa_services_name: assert f"{service} Service: RUNNING" in cmd.stdout_text # stopping few services service_stop = ["krb5kdc", "kadmin", "httpd"] for service in service_stop: - self.master.run_command(['systemctl', 'stop', service]) + service_name = services.knownservices[service].systemd_name + self.master.run_command(['systemctl', 'stop', service_name]) # checking service status service_start = [ - svcs for svcs in services if svcs not in service_stop + svcs for svcs in ipa_services_name if svcs not in service_stop ] cmd = self.master.run_command(['ipactl', 'status']) for service in service_start: @@ -637,7 +638,7 @@ class TestInstallMaster(IntegrationTest): # checking service status cmd = self.master.run_command(['ipactl', 'status']) - for service in services: + for service in ipa_services_name: assert f"{service} Service: RUNNING" in cmd.stdout_text # get process id of services @@ -648,7 +649,7 @@ class TestInstallMaster(IntegrationTest): # checking service status cmd = self.master.run_command(['ipactl', 'status']) - for service in services: + for service in ipa_services_name: assert f"{service} Service: RUNNING" in cmd.stdout_text # check if pid for services are different @@ -660,7 +661,7 @@ class TestInstallMaster(IntegrationTest): # checking service status cmd = self.master.run_command(['ipactl', 'status']) - for service in services: + for service in ipa_services_name: assert f"{service} Service: RUNNING" in cmd.stdout_text # check if pid for services are same