Slackware service state initial support#58207
Conversation
|
@dwoz , can you help on this? All the builds failed without actually do any build: I don't know what happened :( |
There was a problem hiding this comment.
Can you add .. versionadded:: Magnesium to all of these new methods.
There was a problem hiding this comment.
Is this always the path? This would prevent a user from setting their own path where they would prefer to manage these files. Might be better to set this as a kwarg in the methods that use this path?
There was a problem hiding this comment.
Yes, this is always the path for rc scripts in Slackware. It's like /etc/init.d on SysV init.
There was a problem hiding this comment.
This needs to be changed to Magnesium instead
There was a problem hiding this comment.
Hahahaha... sorry, this what happens when copying and pasting stuff, I will fix that tonight.
There was a problem hiding this comment.
we are still in the process of migrating entirely to pytest, but since this is a new test file i would love to see it using pytest instead in tests/pytests/unit/modules so we dont have to migrate it later if you're willing to do so.
There was a problem hiding this comment.
Oh, ok. I will change it, as it's a new feature it's better to born in the right way.
4c1ca6c to
2fd336a
Compare
There was a problem hiding this comment.
thanks for all these updates, really appreciate them. I have just one more thing. Can we add these variables to a pytest fixture? This actually helps speed up things when pytest is collecting tests and prevents any issues we have ran into the past where someone edited a list/dict at the global module level that affects other tests.
There was a problem hiding this comment.
It took a while, but following your advice and with the explanations of the @waynew from the Saltstack Test Clinic, I removed all the global variables and took the opportunity to make a big overhaul of test names, descriptions, comments and reorganized some them. I hope this time everything is fine :)
- Added slackware_service.py module to handle the Slackware rc-scripts - Added Slackware in the list to not use the linux_service.py
- Added tests/init/modules/test_slackware_service.py - Fixed the permission mask on slackware_service.py - Added slackware_service in index.rst
- Call to os.stat wasn't properly mocked and the tests fails on all non-Slackware platforms. - Fixed the affected tests and changed the test argument to a non-existent file, so the wrong mock can be detected in Slackware.
- Removed global variables and put inside a reusable fixture - Changed the test names to be more descriptive - Also added better explanations and comments to the mocked data and the tests themselves - Changed the enabled/disabled tests to be more useful
2fd336a to
ed2cb39
Compare
Ch3LL
left a comment
There was a problem hiding this comment.
thanks for all your work on this one, much appreciated
|
@dwoz why the "Needs Testcase" label? |
What does this PR do?
Adds support to manage services in Slackware Linux.
Without this module even a simple operation as service.start doesn't works, that makes impossible to use any service state.
Now, with this module, all service module operations works fine (provided the managed rc-scripts provides the required operation) and the service states are available.
What issues does this PR fix or reference?
Fixes: #58206
Previous Behavior
New Behavior
Merge requirements satisfied?
Commits signed with GPG?
No