| 991 | ).stdout.strip() |
| 992 | |
| 993 | def install(self, upgrade=False, downgrade=False, stop_services=True): |
| 994 | self._install_pkgs(upgrade=upgrade, downgrade=downgrade) |
| 995 | if platform.is_darwin(): |
| 996 | self._refresh_macos_binary_paths() |
| 997 | self.update_process_path() |
| 998 | if stop_services: |
| 999 | # The Salt .pkg loads ``com.saltstack.salt.minion`` (and on |
| 1000 | # some installs also ``master``/``api``/``syndic``) at install |
| 1001 | # time via ``RunAtLoad=true``. Those daemons start with the |
| 1002 | # default minion config (``master: salt``, which does not |
| 1003 | # resolve), so they never authenticate to the test fixture's |
| 1004 | # master. Worse, saltfactories' ``PkgLaunchdSaltDaemonImpl`` |
| 1005 | # checks the plist label when its own ``salt_minion`` fixture |
| 1006 | # tries to ``launchctl bootstrap`` -- sees the auto-loaded |
| 1007 | # daemon, declares the test minion "already running", and |
| 1008 | # silently uses the misconfigured launchd-managed process |
| 1009 | # instead. Fan-out then finds zero connected minions and |
| 1010 | # ``api_request`` returns ``{'return': [{}]}``. |
| 1011 | # Bootout the auto-installed daemons here so the label is |
| 1012 | # free when the test fixture brings up its own. |
| 1013 | self._stop_macos_pkg_daemons() |
| 1014 | if self.distro_id in ("ubuntu", "debian") and stop_services: |
| 1015 | self.stop_services() |
| 1016 | elif ( |
| 1017 | upgrade |
| 1018 | and self.pkg_system_service |
| 1019 | and not platform.is_windows() |
| 1020 | and not platform.is_darwin() |
| 1021 | ): |
| 1022 | # RPM/DEB upgrade replaces on disk while systemd units can keep old |
| 1023 | # processes until restart; ``salt-call --local test.version`` then |
| 1024 | # still reports the previous release (see upgrade systemd teardown). |
| 1025 | self.restart_services() |
| 1026 | |
| 1027 | def _stop_macos_pkg_daemons(self): |
| 1028 | """ |