From 0c9f5bd5159b093b68e518b2fa0830fe60222b66 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 16 Feb 2020 17:55:33 +0000 Subject: [PATCH] Add test for tilecache cookbook --- .kitchen.yml | 7 ++++++ .travis.yml | 3 +++ .../tilecache/serverspec/nginx_spec.rb | 25 +++++++++++++++++++ .../tilecache/serverspec/squid_spec.rb | 21 ++++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 test/integration/tilecache/serverspec/nginx_spec.rb create mode 100644 test/integration/tilecache/serverspec/squid_spec.rb diff --git a/.kitchen.yml b/.kitchen.yml index 03549801f..e9350cc01 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -172,6 +172,13 @@ suites: - name: squid run_list: - recipe[squid::default] + - name: tilecache + run_list: + - recipe[tilecache::default] + attributes: + networking: + nameservers: + - 127.0.0.1 - name: tools run_list: - recipe[tools::default] diff --git a/.travis.yml b/.travis.yml index c822da4f0..78f216557 100644 --- a/.travis.yml +++ b/.travis.yml @@ -117,6 +117,9 @@ jobs: - name: "Test Kitchen (squid)" script: - bundle exec kitchen test squid-ubuntu-1804 + - name: "Test Kitchen (tilecache)" + script: + - bundle exec kitchen test tilecache-ubuntu-1804 - name: "Test Kitchen (tools)" script: - bundle exec kitchen test tools-ubuntu-1804 diff --git a/test/integration/tilecache/serverspec/nginx_spec.rb b/test/integration/tilecache/serverspec/nginx_spec.rb new file mode 100644 index 000000000..4122e1904 --- /dev/null +++ b/test/integration/tilecache/serverspec/nginx_spec.rb @@ -0,0 +1,25 @@ +require "serverspec" + +# Required by serverspec +set :backend, :exec + +describe package("nginx") do + it { should be_installed } +end + +describe service("nginx") 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 + +describe port(8050) do + it { should be_listening.with("tcp") } +end diff --git a/test/integration/tilecache/serverspec/squid_spec.rb b/test/integration/tilecache/serverspec/squid_spec.rb new file mode 100644 index 000000000..a72a8b356 --- /dev/null +++ b/test/integration/tilecache/serverspec/squid_spec.rb @@ -0,0 +1,21 @@ +require "serverspec" + +# Required by serverspec +set :backend, :exec + +describe package("squid") do + it { should be_installed } +end + +describe service("squid") do + it { should be_enabled } + it { should be_running } +end + +describe port(3128) do + it { should be_listening.with("tcp") } +end + +describe port(8080) do + it { should be_listening.with("tcp") } +end -- 2.39.5