]> git.openstreetmap.org Git - chef.git/commitdiff
Add test for postgresql cookbook
authorTom Hughes <tom@compton.nu>
Sun, 16 Feb 2020 23:06:05 +0000 (23:06 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 16 Feb 2020 23:06:05 +0000 (23:06 +0000)
.kitchen.yml
.travis.yml
test/integration/postgresql/serverspec/postgresql_spec.rb [new file with mode: 0644]

index f46a4d1f8b3e7947187adaac124c50c25ab91c38..0730adbfc6e268fae719a19a515409d93c39c81a 100644 (file)
@@ -159,6 +159,13 @@ suites:
     attributes:
       web:
         readonly_database_host: readonly
+  - name: postgresql
+    run_list:
+      - recipe[postgresql::default]
+    attributes:
+      postgresql:
+        versions:
+          - 10
   - name: python
     run_list:
       - recipe[python::default]
index 78f216557d1f2bffc270401203bd8b3736be88eb..6ae8b514417a94bcd55b4649707a040a631c6f99 100644 (file)
@@ -108,6 +108,9 @@ jobs:
     - name: "Test Kitchen (planet::replication)"
       script:
         - bundle exec kitchen test planet-replication-ubuntu-1804
+    - name: "Test Kitchen (postgresql)"
+      script:
+        - bundle exec kitchen test postgresql-ubuntu-1804
     - name: "Test Kitchen (python)"
       script:
         - bundle exec kitchen test python-ubuntu-1804
diff --git a/test/integration/postgresql/serverspec/postgresql_spec.rb b/test/integration/postgresql/serverspec/postgresql_spec.rb
new file mode 100644 (file)
index 0000000..97edb60
--- /dev/null
@@ -0,0 +1,17 @@
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("postgresql-10") do
+  it { should be_installed }
+end
+
+describe service("postgresql@10-main") do
+  it { should be_enabled }
+  it { should be_running }
+end
+
+describe port(5432) do
+  it { should be_listening.with("tcp") }
+end