-
Notifications
You must be signed in to change notification settings - Fork 91
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
FIX #51 possibility to add checksum #80
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,5 @@ | |
$nexus_data_folder = undef | ||
$download_folder = '/srv' | ||
$manage_config = true | ||
$md5sum = '' | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'apt class' do | ||
|
||
context 'default parameters' do | ||
# Using puppet_apply as a helper | ||
it 'should work with no errors' do | ||
pp = <<-EOS | ||
class{ '::java': } | ||
|
||
class{ '::nexus': | ||
version => '2.8.0', | ||
revision => '05', | ||
md5sum => 'e1cece1ae5eb3a12f857e2368a3e9dbc', | ||
nexus_root => '/srv', | ||
} | ||
EOS | ||
|
||
# Run it twice and test for idempotency | ||
apply_manifest(pp, :catch_failures => true) | ||
apply_manifest(pp, :catch_failures => true) | ||
end | ||
|
||
describe user('nexus') do | ||
it { should belong_to_group 'nexus' } | ||
end | ||
|
||
describe service('nexus') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
context 'Nexus should be running on the default port' do | ||
describe port(8081) do | ||
it { | ||
sleep(180) # Waiting start up | ||
should be_listening | ||
} | ||
end | ||
|
||
describe command('curl 0.0.0.0:8081/nexus/') do | ||
its(:stdout) { should match /Sonatype Nexus™ 2.8.0-05/ } | ||
end | ||
end | ||
|
||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
'revision' => '01', | ||
'version' => '2.11.2', | ||
'download_folder' => '/srv', | ||
'md5sum' => '', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this supposed to be undef now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are almost right. md5sum can not be used with undef value, that will cause during test:
caused by undef can not be used in hash The empty value is used to be compatible with strict mode during the test |
||
} | ||
} | ||
|
||
|
@@ -34,6 +35,7 @@ | |
'source' => 'http://download.sonatype.com/nexus/oss/nexus-2.11.2-01-bundle.tar.gz', | ||
'destination' => '/srv/nexus-2.11.2-01-bundle.tar.gz', | ||
'before' => 'Exec[nexus-untar]', | ||
'source_hash' => '', | ||
) } | ||
|
||
it { should contain_exec('nexus-untar').with( | ||
|
@@ -68,7 +70,7 @@ | |
params.merge!( | ||
{ | ||
'deploy_pro' => true, | ||
'download_site' => 'http://download.sonatype.com/nexus/professional-bundle', | ||
'download_site' => 'http://download.sonatype.com/nexus/professional-bundle' | ||
} | ||
) | ||
|
||
|
@@ -88,7 +90,28 @@ | |
'target' => '/srv/nexus-professional-2.11.2-01', | ||
) | ||
end | ||
|
||
it 'should working with md5sum' do | ||
params.merge!( | ||
{ | ||
'md5sum' => '1234567890' | ||
} | ||
) | ||
should contain_wget__fetch('nexus-2.11.2-01-bundle.tar.gz').with( | ||
'source' => 'http://download.sonatype.com/nexus/oss/nexus-2.11.2-01-bundle.tar.gz', | ||
'destination' => '/srv/nexus-2.11.2-01-bundle.tar.gz', | ||
'before' => 'Exec[nexus-untar]', | ||
'source_hash' => '1234567890', | ||
) | ||
should contain_exec('nexus-untar').with( | ||
'command' => 'tar zxf /srv/nexus-2.11.2-01-bundle.tar.gz --directory /srv', | ||
'creates' => '/srv/nexus-2.11.2-01', | ||
'path' => [ '/bin', '/usr/bin' ], | ||
) | ||
end | ||
|
||
end | ||
|
||
end | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this default to empty string instead of undef?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right the undef value is better. I change it!