Skip to content

Commit

Permalink
Merge eb290e8 into fa7b162
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Apr 15, 2017
2 parents fa7b162 + eb290e8 commit 17e1683
Show file tree
Hide file tree
Showing 12 changed files with 132 additions and 29 deletions.
4 changes: 4 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,7 @@ If you don't want to have to recreate the virtual machine every time you
can use `BEAKER_DESTROY=no` and `BEAKER_PROVISION=no`. On the first run you will
at least need `BEAKER_PROVISION` set to yes (the default). The Vagrantfile
for the created virtual machines will be in `.vagrant/beaker_vagrant_fies`.

The easiest way to debug in a docker container is to open a shell:

docker exec -it -u root ${container_id_or_name} bash
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
modulesync_config_version: '0.20.1'
modulesync_config_version: '0.21.0'
63 changes: 63 additions & 0 deletions .overcommit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Managed by https://github.com/voxpupuli/modulesync_configs
#
# Hooks are only enabled if you take action.
#
# To enable the hooks run:
#
# ```
# bundle exec overcommit --install
# # ensure .overcommit.yml does not harm to you and then
# bundle exec overcommit --sign
# ```
#
# (it will manage the .git/hooks directory):
#
# Examples howto skip a test for a commit or push:
#
# ```
# SKIP=RuboCop git commit
# SKIP=PuppetLint git commit
# SKIP=RakeTask git push
# ```
#
# Don't invoke overcommit at all:
#
# ```
# OVERCOMMIT_DISABLE=1 git commit
# ```
#
# Read more about overcommit: https://github.com/brigade/overcommit
#
# To manage this config yourself in your module add
#
# ```
# .overcommit.yml:
# unmanaged: true
# ```
#
# to your modules .sync.yml config
---
PreCommit:
RuboCop:
enabled: true
description: 'Runs rubocop on modified files only'
command: ['bundle', 'exec', 'rubocop']
PuppetLint:
enabled: true
description: 'Runs puppet-lint on modified files only'
command: ['bundle', 'exec', 'puppet-lint']
YamlSyntax:
enabled: true
JsonSyntax:
enabled: true
TrailingWhitespace:
enabled: true

PrePush:
RakeTarget:
enabled: true
description: 'Run rake targets'
targets:
- 'test'
- 'rubocop'
command: [ 'bundle', 'exec', 'rake' ]
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ AllCops:
- .vendor/**/*
- pkg/**/*
- spec/fixtures/**/*
- Gemfile
- Rakefile
Lint/ConditionPosition:
Enabled: True

Expand Down
17 changes: 11 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ sudo: false
dist: trusty
language: ruby
cache: bundler
bundler_args: --without system_tests development
before_install:
- bundle -v
- rm Gemfile.lock || true
Expand All @@ -17,16 +16,22 @@ matrix:
fast_finish: true
include:
- rvm: 2.1.9
bundler_args: --without system_tests development
env: PUPPET_VERSION="~> 4.0" CHECK=test
- rvm: 2.2.6
- rvm: 2.2.7
bundler_args: --without system_tests development
env: PUPPET_VERSION="~> 4.0" CHECK=test
- rvm: 2.3.3
- rvm: 2.3.4
bundler_args: --without system_tests development
env: PUPPET_VERSION="~> 4.0" CHECK=test
- rvm: 2.4.0
- rvm: 2.4.1
bundler_args: --without system_tests development
env: PUPPET_VERSION="~> 4.0" CHECK=test
- rvm: 2.4.0
- rvm: 2.4.1
bundler_args: --without system_tests development
env: PUPPET_VERSION="~> 4.0" CHECK=rubocop
- rvm: 2.4.0
- rvm: 2.4.1
bundler_args: --without system_tests development
env: PUPPET_VERSION="~> 4.0" CHECK=build DEPLOY_TO_FORGE=yes
branches:
only:
Expand Down
16 changes: 8 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ def location_for(place, fake_version = nil)
end

group :test do
gem 'puppetlabs_spec_helper', '~> 2.0.1', :require => false
gem 'parallel_tests', :require => false
gem 'puppetlabs_spec_helper', '~> 2.1.1', :require => false
gem 'rspec-puppet', '~> 2.5', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'rspec-puppet-utils', :require => false
Expand All @@ -26,10 +25,10 @@ group :test do
gem 'metadata-json-lint', :require => false
gem 'puppet-blacksmith', :require => false
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem.git'
gem 'puppet-strings', '~> 1.0.0', :require => false
gem 'puppet-strings', '~> 1.0', :require => false
gem 'redcarpet', :require => false
gem 'rubocop', '~> 0.47.0', :require => false if RUBY_VERSION >= '2.3.0'
gem 'rubocop-rspec', '~> 1.10.0', :require => false if RUBY_VERSION >= '2.3.0'
gem 'rubocop', '~> 0.48.0', :require => false if RUBY_VERSION >= '2.3.0'
gem 'rubocop-rspec', '~> 1.15.0', :require => false if RUBY_VERSION >= '2.3.0'
gem 'mocha', '>= 1.2.1', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
Expand All @@ -41,9 +40,10 @@ group :test do
end

group :development do
gem 'travis', :require => false
gem 'travis-lint', :require => false
gem 'guard-rake', :require => false
gem 'travis', :require => false
gem 'travis-lint', :require => false
gem 'guard-rake', :require => false
gem 'overcommit', '~> 0.39.1', :require => false
end

group :system_tests do
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/network_config/redhat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def self.munge(pairs)
end
end

props[:method] = 'static' unless %w(bootp dhcp).include? props[:method]
props[:method] = 'static' unless %w[bootp dhcp].include? props[:method]

props
end
Expand Down
9 changes: 5 additions & 4 deletions spec/defines/bond/debian_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'method' => 'static',
'ipaddress' => '172.18.1.2',
'netmask' => '255.255.128.0',
'slaves' => %w(eth0 eth1),
'slaves' => %w[eth0 eth1],

'mode' => 'active-backup',
'miimon' => '100',
Expand All @@ -23,7 +23,7 @@
}
end

%w(eth0 eth1).each do |slave|
%w[eth0 eth1].each do |slave|
it "should add a network_config resource for #{slave}" do
is_expected.to contain_network_config(slave).with_ensure('absent')
end
Expand Down Expand Up @@ -55,7 +55,7 @@
'method' => 'static',
'ipaddress' => '10.20.2.1',
'netmask' => '255.255.255.192',
'slaves' => %w(eth0 eth1 eth2),
'slaves' => %w[eth0 eth1 eth2],
'mtu' => 1550,
'options' => { 'bond-future-option' => 'yes' },
'slave_options' => { 'slave-future-option' => 'no' },
Expand All @@ -69,7 +69,8 @@
'xmit_hash_policy' => 'layer3+4'
}
end
%w(eth0 eth1 eth2).each do |slave|

%w[eth0 eth1 eth2].each do |slave|
it "should add a network_config resource for #{slave}" do
is_expected.to contain_network_config(slave).with_ensure('absent')
end
Expand Down
9 changes: 5 additions & 4 deletions spec/defines/bond/redhat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'method' => 'static',
'ipaddress' => '172.18.1.2',
'netmask' => '255.255.128.0',
'slaves' => %w(eth0 eth1),
'slaves' => %w[eth0 eth1],

'mode' => 'active-backup',
'miimon' => '100',
Expand All @@ -23,7 +23,7 @@
}
end

%w(eth0 eth1).each do |slave|
%w[eth0 eth1].each do |slave|
it "should add a network_config resource for #{slave}" do
is_expected.to contain_network_config(slave).with('ensure' => 'present',
'method' => 'static',
Expand Down Expand Up @@ -54,7 +54,7 @@
'method' => 'static',
'ipaddress' => '10.20.2.1',
'netmask' => '255.255.255.192',
'slaves' => %w(eth0 eth1 eth2),
'slaves' => %w[eth0 eth1 eth2],
'mtu' => '1550',
'options' => { 'NM_CONTROLLED' => 'yes' },
'slave_options' => { 'NM_CONTROLLED' => 'no' },
Expand All @@ -68,7 +68,8 @@
'xmit_hash_policy' => 'layer3+4'
}
end
%w(eth0 eth1 eth2).each do |slave|

%w[eth0 eth1 eth2].each do |slave|
it "should add a network_config resource for #{slave}" do
is_expected.to contain_network_config(slave).with('ensure' => 'present',
'method' => 'static',
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/bond_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'method' => 'static',
'ipaddress' => '172.18.1.2',
'netmask' => '255.255.128.0',
'slaves' => %w(eth0 eth1),
'slaves' => %w[eth0 eth1],
'mtu' => 1550,
'options' => { 'NM_CONTROLLED' => 'yes' },
'slave_options' => { 'NM_CONTROLLED' => 'no' },
Expand Down
2 changes: 2 additions & 0 deletions spec/unit/provider/network_config/interfaces_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,15 @@ def fixture_data(file)

describe 'writing wrong vlan iface blocks' do
let(:content) { described_class.format_file('', [eth1_4500_provider]) }

it 'fails with wrong VLAN ID' do
expect { content }.to raise_error(Puppet::Error, %r{Interface eth1.4500: missing vlan-raw-device or wrong VLAN ID in the iface name})
end
end

describe 'writing wrong vlanNN iface blocks' do
let(:content) { described_class.format_file('', [vlan10_provider]) }

it 'fails with missing vlan-raw-device' do
expect { content }.to raise_error(Puppet::Error, %r{Interface vlan10: missing vlan-raw-device or wrong VLAN ID in the iface name})
end
Expand Down

0 comments on commit 17e1683

Please sign in to comment.