From: Tom Hughes Date: Fri, 14 Feb 2020 16:30:14 +0000 (+0000) Subject: Add test for fail2ban cookbook X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/a85b69649f628ef919c0709d83f034fd1f039c8b?hp=c4b78405fd353d9d34ffd56593e14d40d21d1d5c Add test for fail2ban cookbook --- diff --git a/.kitchen.yml b/.kitchen.yml index 89cbf3aba..d3ad97d43 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -82,6 +82,9 @@ suites: - name: exim run_list: - recipe[exim::default] + - name: fail2ban + run_list: + - recipe[fail2ban::default] - name: forum run_list: - recipe[accounts::default] diff --git a/.travis.yml b/.travis.yml index 9624f4c9b..bb4e4b49c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,6 +41,9 @@ jobs: - name: "Test Kitchen (exim)" script: - bundle exec kitchen test exim-ubuntu-1804 + - name: "Test Kitchen (fail2ban)" + script: + - bundle exec kitchen test fail2ban-ubuntu-1804 - name: "Test Kitchen (forum)" script: - bundle exec kitchen test forum-ubuntu-1804 diff --git a/cookbooks/fail2ban/metadata.rb b/cookbooks/fail2ban/metadata.rb index 6ff596b43..93f21f14d 100644 --- a/cookbooks/fail2ban/metadata.rb +++ b/cookbooks/fail2ban/metadata.rb @@ -6,3 +6,4 @@ description "Configures fail2ban" version "1.0.0" supports "ubuntu" +depends "munin" diff --git a/test/integration/fail2ban/serverspec/fail2ban_spec.rb b/test/integration/fail2ban/serverspec/fail2ban_spec.rb new file mode 100644 index 000000000..3e4106008 --- /dev/null +++ b/test/integration/fail2ban/serverspec/fail2ban_spec.rb @@ -0,0 +1,13 @@ +require "serverspec" + +# Required by serverspec +set :backend, :exec + +describe package("fail2ban") do + it { should be_installed } +end + +describe service("fail2ban") do + it { should be_enabled } + it { should be_running } +end