Skip to content

Commit

Permalink
update travis configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
  • Loading branch information
chris-rock committed Jul 3, 2017
1 parent 8902359 commit 4125a85
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 19 deletions.
8 changes: 8 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,11 @@ suites:
collector: json-file
inspec_version: 1.25.1
fail_if_not_present: true
- name: chef-12-test
run_list:
- recipe[audit::default]
attributes:
audit:
collector: json-file
inspec_version: 1.25.1
fail_if_not_present: true
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ matrix:
include:
- rvm: 2.2
script: bundle exec rake
- rvm: 2.3.1
- rvm: 2.3.3
script: bundle exec rake $SUITE
env: SUITE=test:integration OS='default-centos-7'
- rvm: 2.3.1
- rvm: 2.3.3
script: bundle exec rake $SUITE
env: SUITE=test:integration OS='default-ubuntu-1404'
- rvm: 2.3.1
- rvm: 2.3.3
script: bundle exec rake $SUITE
env: SUITE=test:integration OS='missing-profile-no-fail-ubuntu-1404'
- rvm: 2.3.1
- rvm: 2.3.3
script: bundle exec rake $SUITE && exit 1 || echo "OK"
env: SUITE=test:integration OS='missing-profile-fail-ubuntu-1404'
- rvm: 2.3.1
- rvm: 2.3.3
script: bundle exec rake $SUITE
env: SUITE=test:integration OS='gem-install-version-centos-7'
- rvm: 2.3.1
- rvm: 2.3.3
script: bundle exec rake $SUITE
env: SUITE=test:integration OS='gem-install-version-ubuntu-1404'
- rvm: 2.3.1
- rvm: 2.3.3
script: bundle exec rake $SUITE
env: SUITE=test:integration OS='skip-inspec-gem-install-ubuntu-1404'
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ group :test do
gem 'coveralls', '~> 0.8.2', require: false
gem 'rb-readline'
gem 'webmock'
gem 'fauxhai', '~> 5.2'
end

group :integration do
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ node.default['audit']['profiles'].push("path": "#{PROFILES_PATH}/mylinux-failure
```ruby
"audit": {
"reporter": "chef-server-compliance",
"inspec_version": "1.2.1",
"inspec_version": "1.29.0",
"profiles": [
# profile from Chef Compliance
{
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/libraries/cs_automate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
# set data_collector
stub_request(:post, 'https://chef.server/data_collector').
with(:body => @enriched_report_expected.to_json,
headers: {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Length'=>/.+/, 'Content-Type'=>'application/json', 'Host'=>/.+/, 'User-Agent'=>/.+/, 'X-Chef-Version'=>/.+/, 'X-Ops-Authorization-1'=>/.+/, 'X-Ops-Authorization-2'=>/.+/, 'X-Ops-Authorization-3'=>/.+/, 'X-Ops-Authorization-4'=>/.+/, 'X-Ops-Authorization-5'=>/.+/, 'X-Ops-Authorization-6'=>/.+/, 'X-Ops-Content-Hash'=>/.+/, 'X-Ops-Server-Api-Version'=>'1', 'X-Ops-Sign'=>'algorithm=sha1;version=1.1;', 'X-Ops-Timestamp'=>/.+/, 'X-Ops-Userid'=>'spec-node', 'X-Remote-Request-Id'=>/.+/}).
headers: {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Length'=>/.+/, 'Content-Type'=>'application/json', 'Host'=>/.+/, 'User-Agent'=>/.+/, 'X-Chef-Version'=>/.+/, 'X-Ops-Authorization-1'=>/.+/, 'X-Ops-Authorization-2'=>/.+/, 'X-Ops-Authorization-3'=>/.+/, 'X-Ops-Authorization-4'=>/.+/, 'X-Ops-Authorization-5'=>/.+/, 'X-Ops-Authorization-6'=>/.+/, 'X-Ops-Content-Hash'=>/.+/, 'X-Ops-Server-Api-Version'=>'1', 'X-Ops-Sign'=>'algorithm=sha1;version=1.1;', 'X-Ops-Timestamp'=>/.+/, 'X-Ops-Userid'=>'spec-node', 'X-Remote-Request-Id'=>/.+/}).
to_return(:status => 200, :body => "", :headers => {})

@automate = Reporter::ChefServerAutomate.new(opts)
Expand Down
18 changes: 9 additions & 9 deletions spec/unit/recipes/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

context 'When an inspec gem version is specified ' do
let(:chef_run) do
ChefSpec::ServerRunner.new do |node|
ChefSpec::ServerRunner.new(platform: 'centos', version: '6.9') do |node|
node.override['audit']['inspec_version'] = '0.0.0'
end.converge(described_recipe)
end
Expand All @@ -54,7 +54,7 @@

context 'When an inspec gem alternate source is specified ' do
let(:chef_run) do
ChefSpec::ServerRunner.new do |node|
ChefSpec::ServerRunner.new(platform: 'centos', version: '6.9') do |node|
node.override['audit']['inspec_gem_source'] = 'http://0.0.0.0:8080'
end.converge(described_recipe)
end
Expand All @@ -70,7 +70,7 @@

context 'When server and refresh_token are specified' do
let(:chef_run) do
ChefSpec::ServerRunner.new do |node|
ChefSpec::ServerRunner.new(platform: 'centos', version: '6.9') do |node|
node.override['audit']['collector'] = 'chef-compliance'
node.override['audit']['profiles'] = [ { 'name': 'myprofile', 'compliance': 'admin/myprofile' } ]
node.override['audit']['server'] = 'https://my.compliance.test/api'
Expand All @@ -86,7 +86,7 @@

context 'When two profiles are specified' do
let(:chef_run) do
runner = ChefSpec::ServerRunner.new(platform: 'centos', version: '6.5')
runner = ChefSpec::ServerRunner.new(platform: 'centos', version: '6.9')
runner.node.override['audit']['profiles'] = [ { 'name': 'myprofile', 'compliance': 'admin/myprofile' }, { 'name': 'ssh', 'compliance': 'base/ssh' } ]
runner.node.override['audit']['inspec_version'] = 'latest'
runner.node.override['audit']['quiet'] = true
Expand All @@ -102,7 +102,7 @@
# TODO: need to implement functionality for this
# context 'When invalid profile is passed' do
# let(:chef_run) do
# runner = ChefSpec::ServerRunner.new(platform: 'centos', version: '6.5')
# runner = ChefSpec::ServerRunner.new(platform: 'centos', version: '6.9')
# runner.node.override['audit']['profiles'] = [ { 'name': 'myprofile', 'compliance': 'myprofile' } ]
# runner.converge(described_recipe)
# end
Expand All @@ -114,7 +114,7 @@

context 'When specifying profiles with alternate sources' do
let(:chef_run) do
runner = ChefSpec::ServerRunner.new(platform: 'centos', version: '6.5')
runner = ChefSpec::ServerRunner.new(platform: 'centos', version: '6.9')
runner.node.override['audit']['profiles'] = [
{ 'name': 'linux', 'compliance': 'base/linux' },
{ 'name': 'apache', 'compliance': 'base/apache' },
Expand All @@ -135,7 +135,7 @@

context 'When specifying a single reporter' do
let(:chef_run) do
runner = ChefSpec::ServerRunner.new(platform: 'centos', version: '6.5')
runner = ChefSpec::ServerRunner.new(platform: 'centos', version: '6.9')
runner.node.override['audit']['collector'] = 'json-file'
runner.node.override['audit']['profiles'] = [
{ 'name': 'linux', 'compliance': 'base/linux' },
Expand All @@ -157,7 +157,7 @@

context 'When specifying multiple reporters' do
let(:chef_run) do
runner = ChefSpec::ServerRunner.new(platform: 'centos', version: '6.5')
runner = ChefSpec::ServerRunner.new(platform: 'centos', version: '6.9')
runner.node.override['audit']['collector'] = ['chef-compliance', 'json-file']
runner.node.override['audit']['profiles'] = [
{ 'name': 'linux', 'compliance': 'base/linux' },
Expand All @@ -179,7 +179,7 @@

context 'when audit_mode is enabled' do
let(:chef_run) do
runner = ChefSpec::ServerRunner.new(platform: 'centos', version: '6.5')
runner = ChefSpec::ServerRunner.new(platform: 'centos', version: '6.9')
runner.node.override['audit']['collector'] = 'json-file'
runner.node.override['audit']['profiles'] = [
{ 'name': 'linux', 'compliance': 'base/linux' },
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/recipes/upload_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

context 'When server and refresh_token are specified' do
let(:chef_run) do
ChefSpec::ServerRunner.new do |node|
ChefSpec::ServerRunner.new(platform: 'centos', version: '6.9') do |node|
node.override['audit']['collector'] = 'chef-compliance'
node.override['audit']['profiles'] = [ {'name': 'admin/myprofile', 'path': '/some/path.tar.gz' } ]
node.override['audit']['server'] = 'https://my.compliance.test/api'
Expand Down

0 comments on commit 4125a85

Please sign in to comment.