-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Enable pkg tests for systemd status on upgrade #67968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
barneysowood
wants to merge
4
commits into
saltstack:3006.x
Choose a base branch
from
barneysowood:enable-pkg-systemd-tests
base: 3006.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Enable pkg tests for systemd status on upgrade #67968
barneysowood
wants to merge
4
commits into
saltstack:3006.x
from
barneysowood:enable-pkg-systemd-tests
+80
−41
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 tasks
31382c6
to
ebdaa0c
Compare
ebdaa0c
to
a02bdef
Compare
Enables tests for systemd status (enabled, active etc). These were added in saltstack#66218 but disabled. We should actually be testing this.
Updates the check for inactive state having been preserved to expect a non-zero exit code - "systemctl is-active" actually returns 3 and the docs just say that if the service isn't active the return code is non-zero
Fixes use of salt_systemd_setup fixture - we need to call it for each test function otherwise state will persist across tests. Made it a function scoped fixture and removed the attempts to call it in the functions, which wouldn't work. Updated the fixture to also install the previous package version for each test run. Without this, after the first test, the calls to install_salt.install(upgrade=True) were upgrading from the new version to the new version - which isn't what we need to test.
Fixes issues with services in the pkg upgrade systemd tests: * Stopping a salt service that is using the log engine from pytest-salt-factories fails if systemd is set to KillMode=process, which is the current setup in salt's packages. Added a fixture to override for these tests, otherwise we end up with services in a failed state. * SaltPkgInstall.install() stops services on ubuntu/debian after install which is the right thing to do in most cases, but in these tests we need to check the state of services immeadiately after install. Added a stop_services arg to install()
a02bdef
to
e514927
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Enables tests for systemd status (enabled, active etc). These were added in #66218 but disabled. We should actually be testing this.
Spotted this when reviewing #66688 - I was surprised that wasn't breaking tests. Assume the intent was that this should be enabled once #66218 was merged and pkg tests were running again
Previous Behavior
Tests for maintaining status of systemd services on upgrade were not being run
New Behavior
Tests are now being run
Merge requirements satisfied?
N/A
Commits signed with GPG?
Yes/No