Debian/Ubuntu distros automatically start the services on install We want to ensure our tests start with the config settings we have set. This will also verify the expected services are up and running.
(self)
| 1053 | log.warning("launchctl %s timed out for %s", cmd[1], service) |
| 1054 | |
| 1055 | def stop_services(self): |
| 1056 | """ |
| 1057 | Debian/Ubuntu distros automatically start the services on install |
| 1058 | We want to ensure our tests start with the config settings we have set. |
| 1059 | This will also verify the expected services are up and running. |
| 1060 | """ |
| 1061 | retval = True |
| 1062 | for service in ["salt-syndic", "salt-master", "salt-minion"]: |
| 1063 | check_run = self.proc.run("systemctl", "status", service) |
| 1064 | if check_run.returncode != 0: |
| 1065 | # The system was not started automatically and |
| 1066 | # we are expecting it to be on install on Debian/Ubuntu systems |
| 1067 | log.debug("The service %s was not started on install.", service) |
| 1068 | retval = False |
| 1069 | else: |
| 1070 | stop_service = self.proc.run("systemctl", "stop", service) |
| 1071 | self._check_retcode(stop_service) |
| 1072 | return retval |
| 1073 | |
| 1074 | def restart_services(self): |
| 1075 | """ |
no test coverage detected