patching the delmailuser script to function properly (+ refactoring)#1809
patching the delmailuser script to function properly (+ refactoring)#1809georglauterbach merged 2 commits intodocker-mailserver:masterfrom georglauterbach:delmailuser-patch
Conversation
|
So echo "Mailbox deleted." || errex "Mailbox couldn't be deleted: ${?}"is obviously hilarious. The tests however do not seem to like if [[ -d "/var/mail/${MAILARR[1]}/${MAILARR[0]}" ]]
then
...
else
errex "Mailbox directory '/var/mail/${MAILARR[1]}/${MAILARR[0]}' does not exist." # <- especially this
fiwhich before would not be exiting with a non-zero exit code. I would just change this to if [[ -d "/var/mail/${MAILARR[1]}/${MAILARR[0]}" ]]
then
...
else
echo "Mailbox directory '/var/mail/${MAILARR[1]}/${MAILARR[0]}' did not exist."
fi@wernerfred Your take? Ima be honest here, not sure if the tests are written to conform to the shitty script...? PS: I just did it and I will see how it turns out. |
Speaking directly (no offense to the original test writers) for me it was really hard to understand what's going on with a lot of the tests I examined as I had to patch a test for the dkim PR. There are a lot of tests where calling them bad style would be too nice. Sometimes the authors even stated in the comments above that the test is really crap and will propably also pass if something else is given as ENV (testing only
🤣 🤣 🤣 |
Indeed, the tests will need complete overhaul in the future.
I didn't even see this the first time, but when I saw it, I was perplexed... Tests are passing now. This is ready for merging, only waiting for your review. |
Description
This PR refactors
delmailuserto function properly (hopefully).Fixes #1808 (issue)
Type of change
Checklist: