From 3cb0558b62c2e5c1c22a9c847a49ef5cbd88e4ff Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 14 Jul 2022 10:03:32 +0000 Subject: [PATCH] Add a test for the overpass cookbook --- .github/workflows/test-kitchen.yml | 1 + .kitchen.yml | 3 +++ cookbooks/overpass/attributes/default.rb | 2 ++ .../overpass/serverspec/apache_spec.rb | 21 +++++++++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 test/integration/overpass/serverspec/apache_spec.rb diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index 55c525f64..cde43686d 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -69,6 +69,7 @@ jobs: - osmosis - osqa - otrs + - overpass - passenger - php - php-apache diff --git a/.kitchen.yml b/.kitchen.yml index b652e12ea..b7b9d9e60 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -225,6 +225,9 @@ suites: - name: otrs run_list: - recipe[otrs::default] + - name: overpass + run_list: + - recipe[overpass::default] - name: passenger run_list: - recipe[passenger::default] diff --git a/cookbooks/overpass/attributes/default.rb b/cookbooks/overpass/attributes/default.rb index 0cfd5daba..5c7cfcaaf 100644 --- a/cookbooks/overpass/attributes/default.rb +++ b/cookbooks/overpass/attributes/default.rb @@ -13,3 +13,5 @@ default[:overpass][:replication_url] = "https://planet.openstreetmap.org/replica default[:overpass][:restricted_api] = true default[:overpass][:logdir] = "/var/log/overpass" + +default[:accounts][:users][:overpass][:status] = :role diff --git a/test/integration/overpass/serverspec/apache_spec.rb b/test/integration/overpass/serverspec/apache_spec.rb new file mode 100644 index 000000000..446d3b915 --- /dev/null +++ b/test/integration/overpass/serverspec/apache_spec.rb @@ -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 -- 2.39.5