From: Andy Allan Date: Thu, 11 Aug 2016 14:29:34 +0000 (+0100) Subject: Add a serverspec test to ensure the munin-node service is running X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/7e87085093c7714b71216c0c523e2f2e8676c324?ds=sidebyside Add a serverspec test to ensure the munin-node service is running --- diff --git a/.kitchen.yml b/.kitchen.yml index cc8065562..299d0f7d2 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -9,6 +9,9 @@ platforms: - name: ubuntu-16.04 suites: + - name: munin + run_list: + - recipe[munin::default] - name: tools run_list: - recipe[tools::default] diff --git a/Gemfile b/Gemfile index b08776e20..31e34a999 100644 --- a/Gemfile +++ b/Gemfile @@ -4,3 +4,4 @@ gem "rubocop" gem "foodcritic" gem "test-kitchen" gem "kitchen-vagrant" +gem "serverspec" diff --git a/Gemfile.lock b/Gemfile.lock index 10bd9d1f2..f79e26d85 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,6 +5,7 @@ GEM ast (2.3.0) cucumber-core (1.5.0) gherkin (~> 4.0) + diff-lcs (1.2.5) erubis (2.7.0) foodcritic (6.3.0) cucumber-core (>= 1.3) @@ -24,9 +25,11 @@ GEM mixlib-versioning mixlib-shellout (2.2.6) mixlib-versioning (1.1.0) + multi_json (1.12.1) net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (3.2.0) + net-telnet (0.1.1) nokogiri (1.6.8) mini_portile2 (~> 2.1.0) pkg-config (~> 1.1.7) @@ -37,6 +40,22 @@ GEM powerpack (0.1.1) rainbow (2.1.0) rake (11.2.2) + rspec (3.5.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-core (3.5.2) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-its (1.2.0) + rspec-core (>= 3.0.0) + rspec-expectations (>= 3.0.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) rubocop (0.41.1) parser (>= 2.3.1.1, < 3.0) powerpack (~> 0.1) @@ -46,6 +65,17 @@ GEM ruby-progressbar (1.8.1) rufus-lru (1.1.0) safe_yaml (1.0.4) + serverspec (2.36.0) + multi_json + rspec (~> 3.0) + rspec-its + specinfra (~> 2.53) + sfl (2.2) + specinfra (2.60.2) + net-scp + net-ssh (>= 2.7, < 4.0) + net-telnet + sfl test-kitchen (1.10.2) mixlib-install (~> 1.0, >= 1.0.4) mixlib-shellout (>= 1.2, < 3.0) @@ -66,6 +96,7 @@ DEPENDENCIES foodcritic kitchen-vagrant rubocop + serverspec test-kitchen BUNDLED WITH diff --git a/test/integration/munin/serverspec/munin_node_spec.rb b/test/integration/munin/serverspec/munin_node_spec.rb new file mode 100644 index 000000000..d949d5c92 --- /dev/null +++ b/test/integration/munin/serverspec/munin_node_spec.rb @@ -0,0 +1,10 @@ +require "serverspec" + +# Required by serverspec +set :backend, :exec + +describe "munin-node daemon" do + it "has a running service of munin-node" do + expect(service("munin-node")).to be_running + end +end