Add tests for otrs cookbook
authorTom Hughes <tom@compton.nu>
Sat, 4 Feb 2017 17:06:31 +0000 (17:06 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 4 Feb 2017 17:06:31 +0000 (17:06 +0000)
.kitchen.yml
test/data_bags/accounts/otrs.json [new file with mode: 0644]
test/data_bags/otrs/passwords.json [new file with mode: 0644]
test/integration/otrs/serverspec/apache_spec.rb [new file with mode: 0644]

index cd6ebeb..c5f8a69 100644 (file)
@@ -48,6 +48,11 @@ suites:
   - name: networking
     run_list:
       - recipe[networking::default]
+  - name: otrs
+    run_list:
+      - recipe[accounts::default]
+      - recipe[chef::default]
+      - role[otrs]
   - name: tools
     run_list:
       - recipe[tools::default]
diff --git a/test/data_bags/accounts/otrs.json b/test/data_bags/accounts/otrs.json
new file mode 100644 (file)
index 0000000..e1354ef
--- /dev/null
@@ -0,0 +1,7 @@
+{
+  "id": "otrs",
+  "uid": "513",
+  "comment": "otrs.openstreetmap.org",
+  "home": "/opt/otrs",
+  "manage_home": false
+}
diff --git a/test/data_bags/otrs/passwords.json b/test/data_bags/otrs/passwords.json
new file mode 100644 (file)
index 0000000..ccb5fec
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "id": "passwords",
+  "otrs": "database-password"
+}
diff --git a/test/integration/otrs/serverspec/apache_spec.rb b/test/integration/otrs/serverspec/apache_spec.rb
new file mode 100644 (file)
index 0000000..9d52682
--- /dev/null
@@ -0,0 +1,21 @@
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("apache2") do
+  it { should be_installed }
+end
+
+describe service("apache2") do
+  it { should be_enabled }
+  it { should be_running }
+end
+
+describe port(80) do
+  it { should be_listening }
+end
+
+describe port(443) do
+  it { should be_listening }
+end