From dd90bcd8b46659131f9df92e3f33f2d7229d5c1d Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 14 Dec 2016 14:45:10 -0800 Subject: [PATCH 1/2] Centralized consul version in tests --- test/integration/client/serverspec/default_spec.rb | 2 -- test/integration/default/serverspec/default_spec.rb | 2 -- test/integration/helpers/serverspec/spec_helper.rb | 4 ++++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/integration/client/serverspec/default_spec.rb b/test/integration/client/serverspec/default_spec.rb index 98143200..8bcb4b01 100644 --- a/test/integration/client/serverspec/default_spec.rb +++ b/test/integration/client/serverspec/default_spec.rb @@ -1,8 +1,6 @@ require 'spec_helper' require 'json' -consul_version = '0.7.0' - if windows? consul_executable = "C:\\Program Files\\consul\\#{consul_version}\\consul.exe" consul_command = "& '#{consul_executable}'" diff --git a/test/integration/default/serverspec/default_spec.rb b/test/integration/default/serverspec/default_spec.rb index 2cd886d2..652e7d04 100644 --- a/test/integration/default/serverspec/default_spec.rb +++ b/test/integration/default/serverspec/default_spec.rb @@ -1,7 +1,5 @@ require 'spec_helper' -consul_version = '0.7.1' - if windows? consul_executable = "C:\\Program Files\\consul\\#{consul_version}\\consul.exe" consul_command = "& '#{consul_executable}'" diff --git a/test/integration/helpers/serverspec/spec_helper.rb b/test/integration/helpers/serverspec/spec_helper.rb index 5b6ee36f..8a144dab 100644 --- a/test/integration/helpers/serverspec/spec_helper.rb +++ b/test/integration/helpers/serverspec/spec_helper.rb @@ -4,6 +4,10 @@ def windows? (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil end +def consul_version + '0.7.1' +end + if !windows? set :backend, :exec else From 56f578fc9f136cc1bcc0f1f4d81d7016b0dd55f0 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 14 Dec 2016 15:43:06 -0800 Subject: [PATCH 2/2] Removed zip installation test --- .../zip/serverspec/default_spec.rb | 48 ------------------- 1 file changed, 48 deletions(-) delete mode 100644 test/integration/zip/serverspec/default_spec.rb diff --git a/test/integration/zip/serverspec/default_spec.rb b/test/integration/zip/serverspec/default_spec.rb deleted file mode 100644 index 49ce4406..00000000 --- a/test/integration/zip/serverspec/default_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -require 'spec_helper' - -describe file('C:\opt\consul\0.7.1\consul.exe') do - it { should be_file } -end - -describe service('consul') do - it { should be_enabled } - it { should be_running } -end - -[8300, 8400, 8500, 8600].each do |p| - describe port(p) do - it { should be_listening } - end -end - -describe command('& "C:\opt\consul\0.7.1\consul.exe" members -detailed') do - its(:exit_status) { should eq 0 } - its(:stdout) { should match %r{\balive\b} } - its(:stdout) { should match %r{\brole=consul\b} } - its(:stdout) { should match %r{\bbootstrap=1\b} } - its(:stdout) { should match %r{\bdc=fortmeade\b} } -end - -config_file = 'C:\Program Files\consul\consul.json' -config_dir = 'C:\Program Files\consul\conf.d' -data_dir = 'C:\Program Files\consul\data' - -describe file(config_file) do - it { should be_file } -end - -describe file(config_dir) do - it { should be_directory } -end - -describe file(data_dir) do - it { should be_directory } -end - -describe file('C:\foo\bar\out.log') do - it { should be_file } -end - -describe file('C:\foo\bar\err.log') do - it { should be_file } -end