MCPcopy
hub / github.com/saltstack/salt / stop_services

Method stop_services

tests/support/pkg.py:1055–1072  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers 3

_default_versionMethod · 0.95
installMethod · 0.95
install_previousMethod · 0.95

Calls 3

_check_retcodeMethod · 0.95
debugMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected