simp-beaker-helpers 1.18.7 → 1.19.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,15 +8,25 @@ context 'after copy_fixture_modules_to( hosts )' do
8
8
 
9
9
  describe "fact_on(master,'root_home')" do
10
10
  it 'should not return value of `root_home`' do
11
- puts fact = fact_on(master, 'root_home')
12
- expect( fact ).to eq ''
11
+ expect(fact_on(master, 'root_home')).to eq ''
13
12
  end
14
13
  end
15
14
 
16
15
  describe "pfact_on(master,'root_home')" do
17
16
  it 'should return value of `root_home`' do
18
- puts fact = pfact_on(master, 'root_home')
19
- expect( fact ).to eq '/root'
17
+ expect(pfact_on(master, 'root_home')).to eq '/root'
18
+ end
19
+ end
20
+
21
+ describe "pfact_on(master,'os.release.major')" do
22
+ it 'should return the value of `os.release.major`' do
23
+ expect(pfact_on(master, 'os.release.major')).to match(/.+/)
24
+ end
25
+ end
26
+
27
+ describe "pfact_on(master,'os.release.foo')" do
28
+ it 'should not return the value of `os.release.foo`' do
29
+ expect(pfact_on(master, 'os.release.foo')).to eq ''
20
30
  end
21
31
  end
22
32
  end
@@ -2,42 +2,36 @@ require 'spec_helper_acceptance'
2
2
 
3
3
  hosts.each do |host|
4
4
  describe '#write_hieradata_to' do
5
+ expect_failures = false
6
+ if hosts_with_role(hosts, 'el8').include?(host)
7
+ expect_failures = true
8
+ end
5
9
 
6
10
  it 'should install yum utils' do
7
11
  host.install_package('yum-utils')
8
12
  end
9
13
 
10
- context 'defailt settings' do
14
+ context 'default settings' do
11
15
  before(:all) { install_simp_repos(host) }
12
16
 
13
- it 'creates the repo' do
14
- on host, 'test -f /etc/yum.repos.d/simp.repo'
15
- on host, 'test -f /etc/yum.repos.d/simp_deps.repo'
16
- end
17
-
18
17
  it 'enables the correct repos' do
19
- simp6info = on(host, '/usr/bin/yum repolist -v simp | grep ^Repo-status').stdout.strip
20
- expect(simp6info).to match(/.*Repo-status.*enabled.*/)
21
- simp6depsinfo = on(host, 'yum repolist -v simp_deps| grep ^Repo-status').stdout.strip
22
- expect(simp6depsinfo).to match(/.*Repo-status.*enabled.*/)
18
+ skip "#{host} is not supported yet" if expect_failures
19
+ on(host, 'yum -y list simp')
20
+ on(host, 'yum -y list postgresql96')
23
21
  end
24
22
  end
25
23
 
26
24
  context 'when passed a disabled list ' do
27
- before(:all) { install_simp_repos(host, ['simp'] ) }
25
+ before(:all) { install_simp_repos(host, ['simp-community-simp'] ) }
28
26
 
29
- it 'creates the repo' do
30
- on host, 'test -f /etc/yum.repos.d/simp.repo'
31
- on host, 'test -f /etc/yum.repos.d/simp_deps.repo'
27
+ it 'enables the correct repos' do
28
+ skip "#{host} is not supported yet" if expect_failures
29
+ on(host, 'yum -y list postgresql96')
32
30
  end
33
31
 
34
- it 'enables the correct repos' do
35
- simp6info = on(host, 'yum repolist -v simp | grep ^Repo-status').stdout.strip
36
- expect(simp6info).to match(/.*Repo-status.*disabled.*/)
37
- simp6depsinfo = on(host, 'yum repolist -v simp_deps| grep ^Repo-status').stdout.strip
38
- expect(simp6depsinfo).to match(/.*Repo-status.*enabled.*/)
32
+ it 'disables the correct repos' do
33
+ on(host, 'yum -y list simp', :acceptable_exit_codes => [1])
39
34
  end
40
35
  end
41
-
42
36
  end
43
37
  end
@@ -31,7 +31,10 @@ ScrubFixtures.new
31
31
  ENV['BEAKER_fips'] = 'yes'
32
32
  ENV['FIXTURES_YML'] = alt_fixtures
33
33
 
34
+ beaker_gem_options = ENV['BEAKER_GEM_OPTIONS']
35
+
34
36
  Bundler.with_clean_env{
37
+ ENV['BEAKER_GEM_OPTIONS'] = beaker_gem_options
35
38
  ENV['FIXTURES_YML'] = alt_fixtures
36
39
 
37
40
  %x{bundle exec rake spec_prep}
@@ -1,24 +1,22 @@
1
- # This needs to be done so that we actually bring in a collection at the start
2
- # of the run
3
- #
4
- # Choosing an arbitrary number in the middle of 5 so that we're not fooled by
5
- # edge cases
6
- #
7
- ENV['PUPPET_VERSION'] = '5.1'
8
-
9
1
  require 'spec_helper_acceptance'
10
2
 
11
- Bundler.with_clean_env{
12
- %x{bundle exec rake spec_prep}
13
- }
3
+ unless ENV['PUPPET_VERSION'] || ENV['BEAKER_PUPPET_COLLECTION']
4
+ fail('You must set either PUPPET_VERSION or BEAKER_PUPPET_COLLECTION as an environment variable')
5
+ end
6
+
7
+ if ENV['BEAKER_PUPPET_COLLECTION']
8
+ target_version = ENV['BEAKER_PUPPET_COLLECTION'][/(\d+)$/,1]
9
+ elsif ENV['PUPPET_VERSION']
10
+ target_version = ENV['PUPPET_VERSION'].split('.').first
11
+ end
14
12
 
15
13
  hosts.each do |host|
16
14
  describe 'make sure puppet version is valid' do
17
15
  context "on #{host}" do
18
16
  client_puppet_version = on(host, 'puppet --version').output.strip
19
17
 
20
- it "should be running puppet version #{ENV['PUPPET_VERSION']}}" do
21
- expect(Gem::Version.new(client_puppet_version)).to be >= Gem::Version.new(ENV['PUPPET_VERSION'])
18
+ it "should be running puppet version #{target_version}" do
19
+ expect(Gem::Version.new(client_puppet_version)).to be >= Gem::Version.new(target_version)
22
20
  end
23
21
  end
24
22
  end
@@ -10,12 +10,14 @@ HOSTS:
10
10
  roles:
11
11
  - windows
12
12
  platform: windows-server-amd64
13
- box: opentable/win-2012r2-standard-amd64-nocm # VBOX ONLY
13
+ box: devopsgroup-io/windows_server-2012r2-standard-amd64-nocm
14
14
  hypervisor: <%= hypervisor %>
15
15
  vagrant_memsize: 2048
16
16
  vagrant_cpus: 2
17
17
  user: vagrant
18
18
  is_cygwin: false
19
+ ssh:
20
+ host_key: ssh-dss
19
21
 
20
22
  el7:
21
23
  roles:
@@ -103,21 +103,11 @@ describe 'Simp::BeakerHelpers' do
103
103
  end
104
104
 
105
105
  it 'uses defaults when no environment variables are set' do
106
- expect( @helper.get_puppet_install_info[:puppet_install_version] ).to match(/^5\./)
107
- expect( @helper.get_puppet_install_info[:puppet_collection] ).to eq('puppet5')
106
+ expect( @helper.get_puppet_install_info[:puppet_install_version] ).to match(/^6\./)
107
+ expect( @helper.get_puppet_install_info[:puppet_collection] ).to eq('puppet6')
108
108
  expect( @helper.get_puppet_install_info[:puppet_install_type] ).to eq('agent')
109
109
  end
110
110
 
111
- it 'extracts info from PUPPET_INSTALL_VERSION for Puppet 4' do
112
- ENV['PUPPET_INSTALL_VERSION']= '4.10.5'
113
- expected = {
114
- :puppet_install_version => '1.10.5',
115
- :puppet_collection => nil,
116
- :puppet_install_type => 'agent'
117
- }
118
- expect( @helper.get_puppet_install_info ).to eq expected
119
- end
120
-
121
111
  it 'extracts info from PUPPET_INSTALL_VERSION for Puppet 5' do
122
112
  allow(@helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
123
113
  ENV['PUPPET_INSTALL_VERSION']= '5.5.0'
@@ -153,26 +143,6 @@ describe 'Simp::BeakerHelpers' do
153
143
  expect( @helper.get_puppet_install_info ).to eq expected
154
144
  end
155
145
 
156
- it 'extracts info from BEAKER_PUPPET_AGENT_VERSION' do
157
- ENV['BEAKER_PUPPET_AGENT_VERSION']= '4.10.5'
158
- expected = {
159
- :puppet_install_version => '1.10.5',
160
- :puppet_collection => nil,
161
- :puppet_install_type => 'agent'
162
- }
163
- expect( @helper.get_puppet_install_info ).to eq expected
164
- end
165
-
166
- it 'extracts info from PUPPET_VERSION' do
167
- ENV['PUPPET_VERSION']= '4.10.5'
168
- expected = {
169
- :puppet_install_version => '1.10.5',
170
- :puppet_collection => nil,
171
- :puppet_install_type => 'agent'
172
- }
173
- expect( @helper.get_puppet_install_info ).to eq expected
174
- end
175
-
176
146
  it 'extracts info from BEAKER_PUPPET_COLLECTION' do
177
147
  allow(@helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
178
148
  ENV['BEAKER_PUPPET_COLLECTION']= 'puppet5'
@@ -198,9 +168,9 @@ describe 'Simp::BeakerHelpers' do
198
168
  it 'extracts info from PUPPET_INSTALL_TYPE' do
199
169
  ENV['PUPPET_INSTALL_TYPE'] = 'pe'
200
170
 
201
- expect( @helper.get_puppet_install_info[:puppet_collection] ).to eq('puppet5')
171
+ expect( @helper.get_puppet_install_info[:puppet_collection] ).to eq('puppet6')
202
172
  expect( @helper.get_puppet_install_info[:puppet_install_type] ).to eq('pe')
203
- expect( @helper.get_puppet_install_info[:puppet_install_version] ).to match(/^5\./)
173
+ expect( @helper.get_puppet_install_info[:puppet_install_version] ).to match(/^6\./)
204
174
  end
205
175
 
206
176
  it 'fails when BEAKER_PUPPET_COLLECTION is invalid' do
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simp-beaker-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.7
4
+ version: 1.19.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Tessmer
8
8
  - Trevor Vaughan
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-07-08 00:00:00.000000000 Z
12
+ date: 2021-01-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: beaker
@@ -161,6 +161,7 @@ executables: []
161
161
  extensions: []
162
162
  extra_rdoc_files: []
163
163
  files:
164
+ - ".fips_fixtures"
164
165
  - ".fixtures.yml"
165
166
  - ".gitignore"
166
167
  - ".gitlab-ci.yml"
@@ -191,22 +192,18 @@ files:
191
192
  - spec/acceptance/suites/default/enable_fips_spec.rb
192
193
  - spec/acceptance/suites/default/fixture_modules_spec.rb
193
194
  - spec/acceptance/suites/default/install_simp_deps_repo_spec.rb
194
- - spec/acceptance/suites/default/nodesets
195
195
  - spec/acceptance/suites/default/pki_tests_spec.rb
196
196
  - spec/acceptance/suites/default/set_hieradata_on_spec.rb
197
197
  - spec/acceptance/suites/default/write_hieradata_to_spec.rb
198
198
  - spec/acceptance/suites/fips_from_fixtures/00_default_spec.rb
199
199
  - spec/acceptance/suites/fips_from_fixtures/metadata.yml
200
- - spec/acceptance/suites/fips_from_fixtures/nodesets
201
200
  - spec/acceptance/suites/offline/00_default_spec.rb
202
201
  - spec/acceptance/suites/offline/README
203
202
  - spec/acceptance/suites/offline/nodesets/default.yml
204
203
  - spec/acceptance/suites/puppet_collections/00_default_spec.rb
205
204
  - spec/acceptance/suites/puppet_collections/metadata.yml
206
- - spec/acceptance/suites/puppet_collections/nodesets/default.yml
207
205
  - spec/acceptance/suites/snapshot/00_snapshot_test_spec.rb
208
206
  - spec/acceptance/suites/snapshot/10_general_usage_spec.rb
209
- - spec/acceptance/suites/snapshot/nodesets
210
207
  - spec/acceptance/suites/windows/00_default_spec.rb
211
208
  - spec/acceptance/suites/windows/metadata.yml
212
209
  - spec/acceptance/suites/windows/nodesets/default.yml
@@ -220,7 +217,7 @@ licenses:
220
217
  - Apache-2.0
221
218
  metadata:
222
219
  issue_tracker: https://simp-project.atlassian.net
223
- post_install_message:
220
+ post_install_message:
224
221
  rdoc_options: []
225
222
  require_paths:
226
223
  - lib
@@ -235,9 +232,33 @@ required_rubygems_version: !ruby/object:Gem::Requirement
235
232
  - !ruby/object:Gem::Version
236
233
  version: '0'
237
234
  requirements: []
238
- rubyforge_project:
239
- rubygems_version: 2.7.7
240
- signing_key:
235
+ rubygems_version: 3.0.9
236
+ signing_key:
241
237
  specification_version: 4
242
238
  summary: beaker helper methods for SIMP
243
- test_files: []
239
+ test_files:
240
+ - spec/acceptance/nodesets/default.yml
241
+ - spec/acceptance/suites/default/check_puppet_version_spec.rb
242
+ - spec/acceptance/suites/default/enable_fips_spec.rb
243
+ - spec/acceptance/suites/default/fixture_modules_spec.rb
244
+ - spec/acceptance/suites/default/install_simp_deps_repo_spec.rb
245
+ - spec/acceptance/suites/default/pki_tests_spec.rb
246
+ - spec/acceptance/suites/default/set_hieradata_on_spec.rb
247
+ - spec/acceptance/suites/default/write_hieradata_to_spec.rb
248
+ - spec/acceptance/suites/fips_from_fixtures/00_default_spec.rb
249
+ - spec/acceptance/suites/fips_from_fixtures/metadata.yml
250
+ - spec/acceptance/suites/offline/00_default_spec.rb
251
+ - spec/acceptance/suites/offline/README
252
+ - spec/acceptance/suites/offline/nodesets/default.yml
253
+ - spec/acceptance/suites/puppet_collections/00_default_spec.rb
254
+ - spec/acceptance/suites/puppet_collections/metadata.yml
255
+ - spec/acceptance/suites/snapshot/00_snapshot_test_spec.rb
256
+ - spec/acceptance/suites/snapshot/10_general_usage_spec.rb
257
+ - spec/acceptance/suites/windows/00_default_spec.rb
258
+ - spec/acceptance/suites/windows/metadata.yml
259
+ - spec/acceptance/suites/windows/nodesets/default.yml
260
+ - spec/acceptance/suites/windows/nodesets/win2016.yml
261
+ - spec/acceptance/suites/windows/nodesets/win2019.yml
262
+ - spec/lib/simp/beaker_helpers_spec.rb
263
+ - spec/spec_helper.rb
264
+ - spec/spec_helper_acceptance.rb
@@ -1 +0,0 @@
1
- spec/acceptance/suites/default/../../nodesets
@@ -1 +0,0 @@
1
- spec/acceptance/suites/fips_from_fixtures/../../nodesets
@@ -1,30 +0,0 @@
1
- <%
2
- if ENV['BEAKER_HYPERVISOR']
3
- hypervisor = ENV['BEAKER_HYPERVISOR']
4
- else
5
- hypervisor = 'vagrant'
6
- end
7
- -%>
8
- HOSTS:
9
- server-el7:
10
- roles:
11
- - server
12
- - default
13
- - master
14
- - el7
15
- platform: el-7-x86_64
16
- box: centos/7
17
- hypervisor: <%= hypervisor %>
18
-
19
- server-el6:
20
- roles:
21
- - el6
22
- platform: el-6-x86_64
23
- box: centos/6
24
- hypervisor: <%= hypervisor %>
25
-
26
- CONFIG:
27
- log_level: verbose
28
- type: aio
29
- puppet_collection: puppet5
30
- vagrant_memsize: 256
@@ -1 +0,0 @@
1
- spec/acceptance/suites/snapshot/../../nodesets