]> git.openstreetmap.org Git - chef.git/commitdiff
Add test for donate cookbook
authorTom Hughes <tom@compton.nu>
Fri, 14 Feb 2020 16:06:16 +0000 (16:06 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 14 Feb 2020 16:06:16 +0000 (16:06 +0000)
.kitchen.yml
.travis.yml
test/data_bags/accounts/donate.json [new file with mode: 0644]
test/data_bags/donate/passwords.json [new file with mode: 0644]
test/integration/donate/serverspec/apache_spec.rb [new file with mode: 0644]
test/integration/donate/serverspec/mysql_spec.rb [new file with mode: 0644]

index 22cd1a636cb85b54ffddba602d5bf0fd416e4643..89cbf3aba7d26c7c3e7865081a7a72820701b8c7 100644 (file)
@@ -72,6 +72,13 @@ suites:
     attributes:
       apache:
         mpm: prefork
     attributes:
       apache:
         mpm: prefork
+  - name: donate
+    run_list:
+      - recipe[accounts::default]
+      - role[donate]
+    attributes:
+      apache:
+        mpm: prefork
   - name: exim
     run_list:
       - recipe[exim::default]
   - name: exim
     run_list:
       - recipe[exim::default]
index 67fe98a1904de179429588599e6e3717e8f71dea..9624f4c9b6475fb5f22efb2e475c0307dfcf23bf 100644 (file)
@@ -35,6 +35,9 @@ jobs:
     - name: "Test Kitchen (dmca)"
       script:
         - bundle exec kitchen test dmca-ubuntu-1804
     - name: "Test Kitchen (dmca)"
       script:
         - bundle exec kitchen test dmca-ubuntu-1804
+    - name: "Test Kitchen (donate)"
+      script:
+        - bundle exec kitchen test donate-ubuntu-1804
     - name: "Test Kitchen (exim)"
       script:
         - bundle exec kitchen test exim-ubuntu-1804
     - name: "Test Kitchen (exim)"
       script:
         - bundle exec kitchen test exim-ubuntu-1804
diff --git a/test/data_bags/accounts/donate.json b/test/data_bags/accounts/donate.json
new file mode 100644 (file)
index 0000000..a0fdfcc
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "id": "donate",
+  "uid": "524",
+  "comment": "OSMF Donations"
+}
diff --git a/test/data_bags/donate/passwords.json b/test/data_bags/donate/passwords.json
new file mode 100644 (file)
index 0000000..5cfde8e
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "id": "passwords",
+  "database": "database-password"
+}
diff --git a/test/integration/donate/serverspec/apache_spec.rb b/test/integration/donate/serverspec/apache_spec.rb
new file mode 100644 (file)
index 0000000..446d3b9
--- /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.with("tcp") }
+end
+
+describe port(443) do
+  it { should be_listening.with("tcp") }
+end
diff --git a/test/integration/donate/serverspec/mysql_spec.rb b/test/integration/donate/serverspec/mysql_spec.rb
new file mode 100644 (file)
index 0000000..b0738f9
--- /dev/null
@@ -0,0 +1,17 @@
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("mysql-server") do
+  it { should be_installed }
+end
+
+describe service("mysql") do
+  it { should be_enabled }
+  it { should be_running }
+end
+
+describe port(3306) do
+  it { should be_listening.with("tcp") }
+end