]> git.openstreetmap.org Git - chef.git/commitdiff
Add tests for foundation cookbook
authorTom Hughes <tom@compton.nu>
Thu, 12 Jan 2023 11:45:09 +0000 (11:45 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 12 Jan 2023 11:47:13 +0000 (11:47 +0000)
.github/workflows/test-kitchen.yml
.kitchen.yml
test/data_bags/foundation/passwords.json [new file with mode: 0644]
test/integration/foundation-board/serverspec/apache_spec.rb [new file with mode: 0644]
test/integration/foundation-dwg/serverspec/apache_spec.rb [new file with mode: 0644]
test/integration/foundation-mwg/serverspec/apache_spec.rb [new file with mode: 0644]
test/integration/foundation-owg/serverspec/apache_spec.rb [new file with mode: 0644]
test/integration/foundation-wiki/serverspec/apache_spec.rb [new file with mode: 0644]

index 76305aaa2cde46bbe78618c85727a874bad8b7b3..e1ddf7221adbda1f03ebbf97fd3a10cd62dc5314 100644 (file)
@@ -39,6 +39,11 @@ jobs:
           - exim
           - fail2ban
           - forum
+          - foundation-board
+          - foundation-dwg
+          - foundation-mwg
+          - foundation-owg
+          - foundation-wiki
           - ftp
           - geodns
           - geoipupdate
index 830cc04c5fec876a7ace08a9f9918dab986c28f6..47630151624ed9fa3c1c118473741970ccd99c6c 100644 (file)
@@ -127,6 +127,21 @@ suites:
   - name: forum
     run_list:
       - recipe[forum::default]
+  - name: foundation-board
+    run_list:
+      - recipe[foundation::board]
+  - name: foundation-dwg
+    run_list:
+      - recipe[foundation::dwg]
+  - name: foundation-mwg
+    run_list:
+      - recipe[foundation::mwg]
+  - name: foundation-owg
+    run_list:
+      - recipe[foundation::owg]
+  - name: foundation-wiki
+    run_list:
+      - recipe[foundation::wiki]
   - name: ftp
     run_list:
       - recipe[ftp::default]
diff --git a/test/data_bags/foundation/passwords.json b/test/data_bags/foundation/passwords.json
new file mode 100644 (file)
index 0000000..b8b93ca
--- /dev/null
@@ -0,0 +1,19 @@
+{
+  "id": "passwords",
+  "wiki": {
+    "database": "database_password",
+    "admin": "admin_password"
+  },
+  "board": {
+    "database": "database_password",
+    "admin": "admin_password"
+  },
+  "dwg": {
+    "database": "database_password",
+    "admin": "admin_password"
+  },
+  "mwg": {
+    "database": "database_password",
+    "admin": "admin_password"
+  }
+}
diff --git a/test/integration/foundation-board/serverspec/apache_spec.rb b/test/integration/foundation-board/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/foundation-dwg/serverspec/apache_spec.rb b/test/integration/foundation-dwg/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/foundation-mwg/serverspec/apache_spec.rb b/test/integration/foundation-mwg/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/foundation-owg/serverspec/apache_spec.rb b/test/integration/foundation-owg/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/foundation-wiki/serverspec/apache_spec.rb b/test/integration/foundation-wiki/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