]> git.openstreetmap.org Git - chef.git/commitdiff
Add test for switch2osm cookbook
authorTom Hughes <tom@compton.nu>
Tue, 18 Feb 2020 15:58:02 +0000 (15:58 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 18 Feb 2020 16:08:29 +0000 (16:08 +0000)
.kitchen.yml
.travis.yml
cookbooks/switch2osm/metadata.rb
cookbooks/switch2osm/recipes/default.rb
test/integration/switch2osm/serverspec/apache_spec.rb [new file with mode: 0644]

index 77ef19f964b9736a2d29c78fe70adbf36113f333..949240e32046d00b45aa29bbf7096dafb655eecc 100644 (file)
@@ -185,6 +185,9 @@ suites:
   - name: stateofthemap
     run_list:
       - recipe[stateofthemap::default]
   - name: stateofthemap
     run_list:
       - recipe[stateofthemap::default]
+  - name: switch2osm
+    run_list:
+      - recipe[switch2osm::default]
   - name: tilecache
     run_list:
       - recipe[tilecache::default]
   - name: tilecache
     run_list:
       - recipe[tilecache::default]
index 3f16680ba67bef0cec463a7e0f95922708bd7a88..9a41f2b89596fae4986eeddc31034500b4018dd8 100644 (file)
@@ -126,6 +126,9 @@ jobs:
     - name: "Test Kitchen (stateofthemap)"
       script:
         - bundle exec kitchen test stateofthemap-ubuntu-1804
     - name: "Test Kitchen (stateofthemap)"
       script:
         - bundle exec kitchen test stateofthemap-ubuntu-1804
+    - name: "Test Kitchen (switch2osm)"
+      script:
+        - bundle exec kitchen test switch2osm-ubuntu-1804
     - name: "Test Kitchen (tilecache)"
       script:
         - bundle exec kitchen test tilecache-ubuntu-1804
     - name: "Test Kitchen (tilecache)"
       script:
         - bundle exec kitchen test tilecache-ubuntu-1804
index 3a380b93fa2e2368ce7e57f3ad9a3b6512cca1dc..c87125ac31767544ce6007a5e40d90cf06076268 100644 (file)
@@ -6,4 +6,5 @@ description       "Installs and configures servers for switch2osm"
 
 version           "1.0.0"
 supports          "ubuntu"
 
 version           "1.0.0"
 supports          "ubuntu"
-depends           "wordpress"
+depends           "apache"
+depends           "git"
index 3e0c51f9ce9f29722e66564d6f8ac249fe938c20..da4957cad122d160dff4648425e4e00293b77a0c 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+
 include_recipe "apache"
 include_recipe "git"
 
 package %w[
   ruby
   ruby-dev
 include_recipe "apache"
 include_recipe "git"
 
 package %w[
   ruby
   ruby-dev
+  libssl-dev
   zlib1g-dev
   zlib1g-dev
+  pkg-config
 ]
 
 apache_module "expires"
 ]
 
 apache_module "expires"
diff --git a/test/integration/switch2osm/serverspec/apache_spec.rb b/test/integration/switch2osm/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