forked from criteo-forks/consul-cookbook
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
82 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
# TODO | ||
- Fix the helpers and clean up the where it injects into DSL. | ||
- Use the InSpec instead of ServerSpec. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
require_relative '../spec_helper' | ||
|
||
consul_executable = "/opt/consul/#{consul_version}/consul" | ||
config_file = '/etc/consul/consul.json' | ||
config_dir = '/etc/consul' | ||
|
||
describe file(consul_executable) do | ||
it { should be_file } | ||
it { should be_executable } | ||
end | ||
|
||
describe group('consul') do | ||
it { should exist } | ||
end | ||
|
||
describe user('consul') do | ||
it { should exist } | ||
its('group') { should eq 'consul' } | ||
end | ||
|
||
describe command("su - consul -c 'echo successfully logged in'") do | ||
its(:stdout) { should_not match /successfully logged in/ } | ||
its(:exit_status) { should_not eq 0 } | ||
end | ||
|
||
describe service('consul') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
end | ||
|
||
[8400, 8500, 8600].each do |p| | ||
describe port(p) do | ||
it { should be_listening } | ||
end | ||
end | ||
|
||
describe command("#{consul_executable} members -detailed") do | ||
its(:exit_status) { should eq 0 } | ||
its(:stdout) { should match %r{\balive\b} } | ||
its(:stdout) { should match %r{\brole=node\b} } | ||
end | ||
|
||
describe file('/usr/local/bin/consul') do | ||
it { should be_symlink } | ||
end | ||
|
||
describe file(config_file) do | ||
it { should be_file } | ||
its('mode') { should cmp '0640' } | ||
end | ||
|
||
describe file(config_dir) do | ||
it { should be_directory } | ||
its('mode') { should cmp '0755' } | ||
end |
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
...ntegration/default/serverspec/acl_spec.rb → test/integration/default/acl_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
def windows? | ||
(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil | ||
end | ||
|
||
def consul_version | ||
'0.7.2' | ||
end |
2 changes: 1 addition & 1 deletion
2
...ntegration/webui/serverspec/webui_spec.rb → test/integration/webui/webui_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
require 'spec_helper' | ||
require_relative '../spec_helper' | ||
|
||
consul_version = '0.7.1' | ||
|
||
|