From: Tom Hughes Date: Thu, 27 Oct 2016 20:27:03 +0000 (+0100) Subject: Add tests for the forum cookbook X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/76bec6dcb9b65dd84f54d243101513b2c36cae52 Add tests for the forum cookbook --- diff --git a/.kitchen.yml b/.kitchen.yml index fede9d89a..b800b89a3 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -28,6 +28,10 @@ suites: - name: bind run_list: - recipe[bind::default] + - name: forum + run_list: + - recipe[accounts::default] + - role[forum] - name: munin run_list: - recipe[munin::default] diff --git a/test/data_bags/accounts/forum.json b/test/data_bags/accounts/forum.json new file mode 100644 index 000000000..12c9e3837 --- /dev/null +++ b/test/data_bags/accounts/forum.json @@ -0,0 +1,6 @@ +{ + "id": "forum", + "uid": "522", + "comment": "Forum", + "manage_home": false +} diff --git a/test/data_bags/forum/passwords.json b/test/data_bags/forum/passwords.json new file mode 100644 index 000000000..384f48105 --- /dev/null +++ b/test/data_bags/forum/passwords.json @@ -0,0 +1,5 @@ +{ + "id": "passwords", + "database": "database-password", + "cookie_seed": "cookie-seed" +} diff --git a/test/integration/forum/serverspec/apache_spec.rb b/test/integration/forum/serverspec/apache_spec.rb new file mode 100644 index 000000000..9d5268271 --- /dev/null +++ b/test/integration/forum/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 } +end + +describe port(443) do + it { should be_listening } +end diff --git a/test/integration/forum/serverspec/mysql_spec.rb b/test/integration/forum/serverspec/mysql_spec.rb new file mode 100644 index 000000000..68e63582b --- /dev/null +++ b/test/integration/forum/serverspec/mysql_spec.rb @@ -0,0 +1,17 @@ +require "serverspec" + +# Required by serverspec +set :backend, :exec + +describe package("mysql-server") do + it { should be_installed } +end + +describe service("mysql") do + it { should be_enabled } + it { should be_running } +end + +describe port(3306) do + it { should be_listening } +end