Skip to content

Commit

Permalink
Add tests for tunnel on jenkins slaves
Browse files Browse the repository at this point in the history
  • Loading branch information
jhooyberghs committed Feb 7, 2018
1 parent e36e33b commit be9943b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
21 changes: 21 additions & 0 deletions spec/acceptance/slave_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -261,5 +261,26 @@ class { ::jenkins::slave:
end
end
end # tool_locations

context 'tunnel' do
tunnel = 'localhost:9000'

context tunnel do
it 'works with no errors' do
pp = <<-EOS
class { ::jenkins::slave:
tunnel => '#{tunnel}',
}
EOS

apply2(pp)
end

describe process('java') do
its(:user) { should eq 'jenkins-slave' }
its(:args) { should match /-tunnel localhost:9000/ }
end
end
end # tunnel
end # parameters
end
11 changes: 11 additions & 0 deletions spec/classes/jenkins_slave_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,17 @@
end
end

describe 'with tunnel specified' do
let(:params) do
{
tunnel: 'localhost:9000'
}
end

it {should contain_file(slave_runtime_file).with_content(/^TUNNEL="localhost:9000"$/)}

end

describe 'with different swarm versions' do
let(:source) { 'http://rspec.example.com' }
context 'a version lower than 3.0' do
Expand Down

0 comments on commit be9943b

Please sign in to comment.