]> git.openstreetmap.org Git - chef.git/commitdiff
Add basic tests for shorewall
authorTom Hughes <tom@compton.nu>
Sun, 14 Aug 2016 15:47:43 +0000 (16:47 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 14 Aug 2016 15:47:43 +0000 (16:47 +0100)
.kitchen.yml
test/integration/networking/serverspec/shorewall_spec.rb [new file with mode: 0644]

index c5880fc4b62a32bd5da65bff1a1b3f13399d542c..e3e658424e961acab8865c50c2123f835b488e03 100644 (file)
@@ -15,6 +15,9 @@ suites:
   - name: munin
     run_list:
       - recipe[munin::default]
+  - name: networking
+    run_list:
+      - recipe[networking::default]
   - name: tools
     run_list:
       - recipe[tools::default]
diff --git a/test/integration/networking/serverspec/shorewall_spec.rb b/test/integration/networking/serverspec/shorewall_spec.rb
new file mode 100644 (file)
index 0000000..2518b72
--- /dev/null
@@ -0,0 +1,20 @@
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("shorewall") do
+  it { should be_installed }
+end
+
+describe service("shorewall") do
+  it { should be_enabled }
+  it { should be_running }
+end
+
+describe file("/etc/shorewall/rules") do
+  it { should be_file }
+  its(:content) { should match(/ACCEPT.*echo-request/) }
+  its(:content) { should match(/ACCEPT.*http/) }
+  its(:content) { should match(/ACCEPT.*https/) }
+end