Skip to content
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

postfix_network_listening_disabled tests #6708

Merged
merged 1 commit into from Mar 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -2,3 +2,5 @@
# packages = postfix

echo "inet_interfaces = loopback-only" > /etc/postfix/main.cf
systemctl enable postfix
systemctl start postfix
Expand Up @@ -2,4 +2,5 @@
# packages = postfix

echo "#inet_interfaces = loopback-only" > /etc/postfix/main.cf
echo "inet_interfaces = something_different" >> /etc/postfix/main.cf
systemctl enable postfix
systemctl start postfix
@@ -1,4 +1,6 @@
#!/bin/bash
# packages = postfix

echo "inet_interfaces = some_different_interface,loopback-only" > /etc/postfix/main.cf
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see value in testing if a correct substring is not mistaken as a correct configuration, the rule description mentions that the only value configured should be the one from the variable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the original test "tested" two things at the same time, so it could be put into a test scenario of its own.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. I have added a new test scenario similar to the previous one.

Unfortunately, in the new test scenario, I have to start postfix first and then add the configuration. It's because having inet_interfaces = some_different_interface,loopback-only requires to have interface called loopback-only. Without that, you can't start postfix.

echo "inet_interfaces = all" > /etc/postfix/main.cf
systemctl enable postfix
systemctl start postfix
@@ -0,0 +1,6 @@
#!/bin/bash
# packages = postfix

systemctl enable postfix
systemctl start postfix
echo "inet_interfaces = all,loopback-only" > /etc/postfix/main.cf
@@ -0,0 +1,6 @@
#!/bin/bash
# packages = postfix

echo "inet_interfaces = all" > /etc/postfix/main.cf
systemctl stop postfix
systemctl disable postfix