Skip to content
This repository was archived by the owner on Dec 12, 2023. It is now read-only.

Commit 5c13e61

Browse files
author
Carlos Sanchez
committed
Add beaker tests and update gems
1 parent d64f752 commit 5c13e61

File tree

8 files changed

+304
-42
lines changed

8 files changed

+304
-42
lines changed

Gemfile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
source 'https://rubygems.org'
22

33
group :rake do
4-
gem 'puppet', '>=2.7.17'
5-
gem 'rspec-puppet', '>=1.0.0'
6-
gem 'rake', '>=0.9.2.2'
7-
gem 'puppet-lint'
8-
gem 'puppetlabs_spec_helper'
9-
gem 'puppet-blacksmith', '>=1.0.5'
10-
gem 'librarian-puppet', '>=0.9.13'
4+
gem 'puppet', '>=2.7.17', :require => false
5+
gem 'rspec-puppet', '>=1.0.0', :require => false
6+
gem 'rake', '>=0.9.2.2', :require => false
7+
gem 'puppet-lint', :require => false
8+
gem 'puppetlabs_spec_helper', :require => false
9+
gem 'puppet-blacksmith', '>=1.0.5', :require => false
10+
gem 'librarian-puppet', '>=2.0.0', :require => false
11+
gem 'beaker', '>=1.17.0', :require => false
12+
gem 'beaker-rspec', '>=2.1.0', :require => false
13+
gem 'minitest', '<5.0.0', :require => false # avoid conflict with Beaker
1114
end

Gemfile.lock

Lines changed: 174 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,204 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4+
CFPropertyList (2.2.8)
5+
activemodel (4.0.11)
6+
activesupport (= 4.0.11)
7+
builder (~> 3.1.0)
8+
activesupport (4.0.11)
9+
i18n (~> 0.6, >= 0.6.9)
10+
minitest (~> 4.2)
11+
multi_json (~> 1.3)
12+
thread_safe (~> 0.1)
13+
tzinfo (~> 0.3.37)
14+
addressable (2.3.6)
15+
archive-tar-minitar (0.5.2)
16+
autoparse (0.3.3)
17+
addressable (>= 2.3.1)
18+
extlib (>= 0.9.15)
19+
multi_json (>= 1.0.0)
20+
aws-sdk (1.42.0)
21+
json (~> 1.4)
22+
nokogiri (>= 1.4.4)
23+
beaker (1.20.1)
24+
aws-sdk (= 1.42.0)
25+
blimpy (~> 0.6)
26+
docker-api
27+
fission (~> 0.4)
28+
fog (~> 1.22.1)
29+
google-api-client (~> 0.7.1)
30+
hocon (~> 0.0.4)
31+
inifile (~> 2.0)
32+
json (~> 1.8)
33+
mime-types (~> 1.25)
34+
net-scp (~> 1.1)
35+
net-ssh (~> 2.6)
36+
nokogiri (~> 1.5.10)
37+
rbvmomi (= 1.8.1)
38+
unf (~> 0.1)
39+
beaker-rspec (3.0.0)
40+
beaker (~> 1.10)
41+
rspec
42+
serverspec (~> 1.0)
43+
specinfra (~> 1.0)
44+
blimpy (0.6.7)
45+
fog
46+
minitar
47+
thor
48+
builder (3.1.4)
449
diff-lcs (1.2.5)
5-
facter (1.7.5)
6-
hiera (1.3.2)
50+
docker-api (1.13.6)
51+
archive-tar-minitar
52+
excon (>= 0.38.0)
53+
json
54+
excon (0.40.0)
55+
extlib (0.9.16)
56+
facter (2.3.0)
57+
CFPropertyList (~> 2.2.6)
58+
faraday (0.9.0)
59+
multipart-post (>= 1.2, < 3)
60+
fission (0.5.0)
61+
CFPropertyList (~> 2.2)
62+
fog (1.22.1)
63+
fog-brightbox
64+
fog-core (~> 1.22)
65+
fog-json
66+
ipaddress (~> 0.5)
67+
nokogiri (~> 1.5, >= 1.5.11)
68+
fog-brightbox (0.6.1)
69+
fog-core (~> 1.22)
70+
fog-json
71+
inflecto
72+
fog-core (1.24.0)
73+
builder
74+
excon (~> 0.38)
75+
formatador (~> 0.2)
76+
mime-types
77+
net-scp (~> 1.1)
78+
net-ssh (>= 2.1.3)
79+
fog-json (1.0.0)
80+
multi_json (~> 1.0)
81+
formatador (0.2.5)
82+
google-api-client (0.7.1)
83+
addressable (>= 2.3.2)
84+
autoparse (>= 0.3.3)
85+
extlib (>= 0.9.15)
86+
faraday (>= 0.9.0)
87+
jwt (>= 0.1.5)
88+
launchy (>= 2.1.1)
89+
multi_json (>= 1.0.0)
90+
retriable (>= 1.4)
91+
signet (>= 0.5.0)
92+
uuidtools (>= 2.1.0)
93+
her (0.7.2)
94+
activemodel (>= 3.0.0, < 4.2)
95+
activesupport (>= 3.0.0, < 4.2)
96+
faraday (>= 0.8, < 1.0)
97+
multi_json (~> 1.7)
98+
hiera (1.3.4)
799
json_pure
8100
highline (1.6.21)
101+
hocon (0.0.6)
102+
i18n (0.6.11)
103+
inflecto (0.0.2)
104+
inifile (2.0.2)
105+
ipaddress (0.8.0)
9106
json (1.8.1)
10107
json_pure (1.8.1)
108+
jwt (1.0.0)
109+
launchy (2.4.3)
110+
addressable (~> 2.3)
11111
librarian (0.1.2)
12112
highline
13113
thor (~> 0.15)
14-
librarian-puppet (1.0.1)
15-
json
114+
librarian-puppet (2.0.0)
16115
librarian (>= 0.1.2)
116+
puppet_forge
117+
rsync
17118
metaclass (0.0.4)
18-
mime-types (2.2)
19-
mini_portile (0.5.3)
20-
mocha (1.0.0)
119+
mime-types (1.25.1)
120+
minitar (0.5.4)
121+
minitest (4.7.5)
122+
mocha (1.1.0)
21123
metaclass (~> 0.0.1)
22-
nokogiri (1.6.1)
23-
mini_portile (~> 0.5.0)
24-
puppet (3.4.3)
25-
facter (~> 1.6)
124+
multi_json (1.10.1)
125+
multipart-post (2.0.0)
126+
net-scp (1.2.1)
127+
net-ssh (>= 2.6.5)
128+
net-ssh (2.9.1)
129+
netrc (0.8.0)
130+
nokogiri (1.5.11)
131+
puppet (3.7.2)
132+
facter (> 1.6, < 3)
26133
hiera (~> 1.0)
27-
rgen (~> 0.6.5)
28-
puppet-blacksmith (2.0.2)
29-
nokogiri
134+
json_pure
135+
puppet-blacksmith (3.0.3)
30136
puppet (>= 2.7.16)
31137
rest-client
32-
puppet-lint (0.3.2)
33-
puppetlabs_spec_helper (0.4.1)
34-
mocha (>= 0.10.5)
138+
puppet-lint (1.1.0)
139+
puppet-syntax (1.3.0)
35140
rake
36-
rspec (>= 2.9.0)
37-
rspec-puppet (>= 0.1.1)
38-
rake (10.3.1)
39-
rest-client (1.6.7)
40-
mime-types (>= 1.16)
41-
rgen (0.6.6)
42-
rspec (2.14.1)
43-
rspec-core (~> 2.14.0)
44-
rspec-expectations (~> 2.14.0)
45-
rspec-mocks (~> 2.14.0)
46-
rspec-core (2.14.8)
47-
rspec-expectations (2.14.5)
141+
puppet_forge (1.0.3)
142+
her (~> 0.6)
143+
puppetlabs_spec_helper (0.8.2)
144+
mocha
145+
puppet-lint
146+
puppet-syntax
147+
rake
148+
rspec
149+
rspec-puppet
150+
rake (10.3.2)
151+
rbvmomi (1.8.1)
152+
builder
153+
nokogiri (>= 1.4.1)
154+
trollop
155+
rest-client (1.7.2)
156+
mime-types (>= 1.16, < 3.0)
157+
netrc (~> 0.7)
158+
retriable (1.4.1)
159+
rspec (2.99.0)
160+
rspec-core (~> 2.99.0)
161+
rspec-expectations (~> 2.99.0)
162+
rspec-mocks (~> 2.99.0)
163+
rspec-core (2.99.2)
164+
rspec-expectations (2.99.2)
48165
diff-lcs (>= 1.1.3, < 2.0)
49-
rspec-mocks (2.14.6)
166+
rspec-its (1.0.1)
167+
rspec-core (>= 2.99.0.beta1)
168+
rspec-expectations (>= 2.99.0.beta1)
169+
rspec-mocks (2.99.2)
50170
rspec-puppet (1.0.1)
51171
rspec
172+
rsync (1.0.9)
173+
serverspec (1.16.0)
174+
highline
175+
net-ssh
176+
rspec (~> 2.99)
177+
rspec-its
178+
specinfra (~> 1.27)
179+
signet (0.5.1)
180+
addressable (>= 2.2.3)
181+
faraday (>= 0.9.0.rc5)
182+
jwt (>= 0.1.5)
183+
multi_json (>= 1.0.0)
184+
specinfra (1.27.5)
52185
thor (0.19.1)
186+
thread_safe (0.3.4)
187+
trollop (2.0)
188+
tzinfo (0.3.42)
189+
unf (0.1.4)
190+
unf_ext
191+
unf_ext (0.0.6)
192+
uuidtools (2.1.5)
53193

54194
PLATFORMS
55195
ruby
56196

57197
DEPENDENCIES
58-
librarian-puppet (>= 0.9.13)
198+
beaker (>= 1.17.0)
199+
beaker-rspec (>= 2.1.0)
200+
librarian-puppet (>= 2.0.0)
201+
minitest (< 5.0.0)
59202
puppet (>= 2.7.17)
60203
puppet-blacksmith (>= 1.0.5)
61204
puppet-lint

Rakefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
require 'bundler'
2-
Bundler.require(:rake)
31
require 'rake/clean'
42

5-
CLEAN.include('spec/fixtures/', 'doc', 'pkg')
3+
CLEAN.include('spec/fixtures/manifests/', 'spec/fixtures/modules/', 'doc', 'pkg')
64
CLOBBER.include('.tmp', '.librarian')
75

86
require 'puppetlabs_spec_helper/rake_tasks'
97
require 'puppet_blacksmith/rake_tasks'
108

9+
require 'puppet-lint/tasks/puppet-lint'
1110
PuppetLint.configuration.send("disable_80chars")
11+
PuppetLint.configuration.fail_on_warnings = true
12+
PuppetLint.configuration.relative = true
1213

1314
# use librarian-puppet to manage fixtures instead of .fixtures.yml
1415
# offers more possibilities like explicit version management, forge downloads,...
@@ -17,4 +18,9 @@ task :librarian_spec_prep do
1718
end
1819
task :spec_prep => :librarian_spec_prep
1920

21+
require 'rspec/core/rake_task'
22+
RSpec::Core::RakeTask.new(:beaker) do |c|
23+
c.pattern = "spec/acceptance/**/*_spec.rb"
24+
end
25+
2026
task :default => [:clean, :spec]

manifests/init.pp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
$group = $archiva::params::group,
6464
$manage_user = $archiva::params::manage_user,
6565
$service = $archiva::params::service,
66+
$enable = $archiva::params::enable,
6667
$installroot = $archiva::params::installroot,
6768
$home = $archiva::params::home,
6869
$apache_mirror = $archiva::params::apache_mirror,
@@ -251,7 +252,7 @@
251252
ensure => running,
252253
hasrestart => true,
253254
hasstatus => true,
254-
enable => true,
255+
enable => $enable,
255256
}
256257

257258
if $maxmemory != undef {

manifests/params.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
$group = 'archiva',
1313
$manage_user = true,
1414
$service = 'archiva',
15+
$enable = true,
1516
$installroot = '/usr/local',
1617
$home = '/var/local/archiva',
1718
$apache_mirror = 'http://archive.apache.org/dist',
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
require 'spec_helper_acceptance'
2+
3+
describe 'archiva' do
4+
5+
let(:manifest) { %Q(
6+
class { 'java': } ->
7+
class { 'archiva':
8+
enable => false,
9+
}
10+
) }
11+
12+
it 'should install idempotently' do
13+
apply_manifest(manifest, :catch_failures => true)
14+
apply_manifest(manifest, :catch_changes => true)
15+
# wait no more than 60 secs for service to be up
16+
shell(%Q(timeout 60 sh -c "while ! grep 'Started [email protected]:8080' /var/local/archiva/logs/wrapper*.log; do sleep 1; done"))
17+
port(8080).should be_listening
18+
end
19+
20+
end
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
HOSTS:
2+
centos-65-x64:
3+
roles:
4+
- master
5+
platform: el-6-x86_64
6+
image: devopsil/puppet:3.5.1
7+
# ip: localhost
8+
hypervisor : docker
9+
docker_image_commands:
10+
- yum -y install tar
11+
- useradd vagrant
12+
CONFIG:
13+
log_level: debug
14+
type: git

0 commit comments

Comments
 (0)