]> git.openstreetmap.org Git - chef.git/commitdiff
Add test for fail2ban cookbook
authorTom Hughes <tom@compton.nu>
Fri, 14 Feb 2020 16:30:14 +0000 (16:30 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 14 Feb 2020 16:30:14 +0000 (16:30 +0000)
.kitchen.yml
.travis.yml
cookbooks/fail2ban/metadata.rb
test/integration/fail2ban/serverspec/fail2ban_spec.rb [new file with mode: 0644]

index 89cbf3aba7d26c7c3e7865081a7a72820701b8c7..d3ad97d43a34532775002863d59497d5471057ae 100644 (file)
@@ -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]
index 9624f4c9b6475fb5f22efb2e475c0307dfcf23bf..bb4e4b49c4c8d798af48e3ea90a752660e1d558f 100644 (file)
@@ -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
index 6ff596b4369fc4223311194a84f0cea4a4dc3042..93f21f14d0e8c5edb433eff775452eec8ed784c0 100644 (file)
@@ -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 (file)
index 0000000..3e41060
--- /dev/null
@@ -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