Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spec tests for jenkins::slave::tunnel parameter #844

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 36 additions & 14 deletions spec/classes/jenkins_slave_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,25 +133,47 @@
end
end

describe 'with valid tunnel specified' do
let(:params) do
{
tunnel: 'localhost:9000'
}
describe 'with tunnel specified' do
context 'with invalid tunnel specified' do
let(:params) do
{
tunnel: ':',
}
end
it { should raise_error(Puppet::Error,/Error while evaluating a Resource Statement/) }
end

it {should contain_file(slave_runtime_file).with_content(/^TUNNEL="localhost:9000"$/)}
context 'as a valid tunnel' do
context 'with HOST:PORT specified' do
let(:params) do
{
tunnel: 'localhost:9000',
}
end

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

describe 'with invalid tunnel specified' do
let(:params) do
{
tunnel: ':'
}
end
it { should raise_error(Puppet::Error) }
context 'with HOST: specified' do
let(:params) do
{
tunnel: 'localhost:',
}
end

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

context 'with :PORT specified' do
let(:params) do
{
tunnel: ':9000',
}
end

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

describe 'with different swarm versions' do
Expand Down