Skip to content

Commit

Permalink
FIXME: I do not understand the test goal
Browse files Browse the repository at this point in the history
  • Loading branch information
neomilium committed Apr 9, 2020
1 parent 3e311d4 commit 646cfde
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions spec/acceptance/class_spec.rb
Expand Up @@ -79,6 +79,7 @@ class { 'fail2ban':
it { is_expected.to be_file }
end
describe service(service_name) do
# FIXME: Remove lsb fact

This comment has been minimized.

Copy link
@smortex

smortex Apr 9, 2020

Member

Wow!

This seems broken, I would expect this to check 2 things:

  1. is the server running
  2. will the server start on boot

Prior to systemd, almost all installed services where started on boot on Debian, so maybe the idea is to only check the "enabled" state when applicable, hence (untested!):

describe service(service_name) do
  it { is_expected.not_to be_running }
  unless %w[sqweeze wheezy jessie].include? fact('lsbdistcodename')
    it { is_expected.not_to be_enabled }
  end
end

This comment has been minimized.

Copy link
@smortex

smortex Apr 11, 2020

Member

Actually, it's quite the opposite: on systems using systemd (so recent Debian versions) the test does not work as intended, probably because the test suite is running from docker and the image is not using systemd:
https://travis-ci.org/github/voxpupuli/puppet-fail2ban/jobs/673637749
https://travis-ci.org/github/voxpupuli/puppet-fail2ban/jobs/673637752

So the condition is here to skip the check on Debian because it will fail otherwise.

if %w[stretch buster].include? fact('lsbdistcodename')
it { is_expected.not_to be_running }
else
Expand Down

0 comments on commit 646cfde

Please sign in to comment.