beaker 2.35.0 → 2.36.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzUxMTk0ODg1NjgxNDFkYzQ2ZDMzZTc5MjYxMDNkOTg1ODc1YmZlMg==
4
+ Y2FjZjE4ZjkyMmEyZTI3MWU2YmFmNTFlNzIwN2I0YzY3ZGFmODZkYg==
5
5
  data.tar.gz: !binary |-
6
- M2Q4ZTQ3MjcyZmE3ZTA5YTdlMmYyYjdkMzFjZTAxMDMxMTRkMDUwNw==
6
+ YmZkM2M3MThkOTEzNDMzYTBlOWRmOWNjNTBkNThkMWE0ZGQ5NzNjMQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDljNGJlOWRkNTI2NDkyM2JiZGI0ODY2YWVjYWZmZWEyYjRjMGIyMDE2YTZm
10
- OTMwYzJkOTQ4M2VmNmExYzQ5ZTI3YzkwMTkwMDMwZDIxOTFlYWI3Y2RmZDky
11
- ZGEzNTcxMWUzODljODA1MTA0YTFkMDZhMzczZjE3MjE0ZjVjZDY=
9
+ M2M5MDkwOGNjYTBiYmU2YzcxMDFjM2YzNzMyN2U5ZGMzZDc5NjRlNTZkYzU2
10
+ M2NjNDE5ZjNjMWU3Yzc4YzAyM2ZjN2RmMDE3YWZmZGI1OWM2NDMxNzg2ZTY5
11
+ OTE4MDYzZDcxZWVmMzY2NDY4NzM4OWNiYWNmZjA5OTJmMjk4NzE=
12
12
  data.tar.gz: !binary |-
13
- YjE1MDQxMWYyYmMzMWM2NjdlZjFmYzQ5ZmU4YWE5YWEyNDQ4MzRkZGYzZTcw
14
- NDAxM2YxZTdjYTZjYmIwYjBkMmI5NWE0OGM3N2IwYzljZDgwMzJlZTc3NGIx
15
- YzJjNzI1ZDJhMDVlY2FmZGRiNDcwNTRmNGE3ZDgwNGUzMDc2MWU=
13
+ NzYyYjdjODA1ZTQwZjBiNmViYWEwY2YwOGI2MDJlY2IxN2FkMWVjODYwMmY0
14
+ YTRhMGVhYTNhYmZjYjZlZGJiYTZjZGJiZGNhM2NkNmZhNTIxZGU0MWFlYmI0
15
+ YzRkZDcyMGI0MWUyOTI3N2JjYjljM2U0ZTg2OWJlZmQ3ODIxOWI=
data/Gemfile CHANGED
@@ -1,22 +1,3 @@
1
1
  source ENV['GEM_SOURCE'] || "https://rubygems.org"
2
2
 
3
- def location_for(place, fake_version = nil)
4
- if place =~ /^(git:[^#]*)#(.*)/
5
- [fake_version, { :git => $1, :branch => $2, :require => false }].compact
6
- elsif place =~ /^file:\/\/(.*)/
7
- ['>= 0', { :path => File.expand_path($1), :require => false }]
8
- else
9
- [place, { :require => false }]
10
- end
11
- end
12
-
13
- scooter_version = ENV['SCOOTER_VERSION']
14
- if ENV['GEM_SOURCE'] =~ /rubygems\.delivery\.puppetlabs\.net/
15
- if scooter_version
16
- gem 'scooter', *location_for(scooter_version)
17
- else
18
- gem 'scooter', '~> 2.0'
19
- end
20
- end
21
-
22
3
  gemspec
data/HISTORY.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # default - History
2
2
  ## Tags
3
- * [LATEST - 24 Feb, 2016 (e714b1eb)](#LATEST)
3
+ * [LATEST - 9 Mar, 2016 (571ab630)](#LATEST)
4
+ * [2.35.0 - 24 Feb, 2016 (b20fa892)](#2.35.0)
4
5
  * [2.34.0 - 10 Feb, 2016 (b897a98a)](#2.34.0)
5
6
  * [2.33.0 - 27 Jan, 2016 (0dd8505a)](#2.33.0)
6
7
  * [2.32.1 - 14 Jan, 2016 (8c394fdb)](#2.32.1)
@@ -110,7 +111,93 @@
110
111
  * [pe1.2 - 6 Sep, 2011 (ba3dadd2)](#pe1.2)
111
112
 
112
113
  ## Details
113
- ### <a name = "LATEST">LATEST - 24 Feb, 2016 (e714b1eb)
114
+ ### <a name = "LATEST">LATEST - 9 Mar, 2016 (571ab630)
115
+
116
+ * (GEM) update beaker version to 2.36.0 (571ab630)
117
+
118
+ * Merge pull request #1073 from kevpl/bkr308_beaker_pe_create (8b6be6f9)
119
+
120
+
121
+ ```
122
+ Merge pull request #1073 from kevpl/bkr308_beaker_pe_create
123
+
124
+ (BKR-308) moved PE-specific functionality to beaker-pe
125
+ ```
126
+ * Merge pull request #1074 from objectverbobject/BKR-451 (c9102673)
127
+
128
+
129
+ ```
130
+ Merge pull request #1074 from objectverbobject/BKR-451
131
+
132
+ (BKR-451) Fix broken logger warnings
133
+ ```
134
+ * Merge pull request #1072 from kevpl/bkr669_cisco7_install (0dc2537d)
135
+
136
+
137
+ ```
138
+ Merge pull request #1072 from kevpl/bkr669_cisco7_install
139
+
140
+ (BKR-669) added cisco-7 install release repo support
141
+ ```
142
+ * Merge pull request #1075 from petems/maint-fix_error_in_beaker_docker (033e6f80)
143
+
144
+
145
+ ```
146
+ Merge pull request #1075 from petems/maint-fix_error_in_beaker_docker
147
+
148
+ (maint) Improves error message for Docker failure
149
+ ```
150
+ * (maint) Improves error message for Docker failure (1a50d4ec)
151
+
152
+
153
+ ```
154
+ (maint) Improves error message for Docker failure
155
+
156
+ * Frontload the DOCKER_HOST variable, as it's the easiest thing to check
157
+ * boot2docker-cli is deprecated (https://github.com/boot2docker/boot2docker-cli#deprecated)
158
+ * Error could also occur on Windows
159
+ ```
160
+ * (BKR-451) Fix broken logger warnings (f998bbae)
161
+
162
+
163
+ ```
164
+ (BKR-451) Fix broken logger warnings
165
+
166
+ The `warning` methods in `deploy_package_repo` should have been simply
167
+ `warn`. This PR changes them to warn and adds appropriate spec testing
168
+ for the methods to ensure they `warn` correctly.
169
+ ```
170
+ * (BKR-308) added beaker-library DSL registry method (a6c72e80)
171
+
172
+ * (BKR-308) added beaker-pe dependency (68f62624)
173
+
174
+ * (BKR-308) removed scooter dependency (62579f89)
175
+
176
+ * (BKR-308) removed PE-specific functionality (449a08e3)
177
+
178
+
179
+ ```
180
+ (BKR-308) removed PE-specific functionality
181
+
182
+ moved into beaker-pe library
183
+ ```
184
+ * (BKR-669) added cisco-7 install release repo support (8aeebb0d)
185
+
186
+ * Merge pull request #1070 from pinkypie/BKR-671 (fd26aa9d)
187
+
188
+
189
+ ```
190
+ Merge pull request #1070 from pinkypie/BKR-671
191
+
192
+ (BKR-671) - Add error handing for Beaker failing to acquire a VM from vmpooler
193
+ ```
194
+ * (BKR-671) - Add spec test for change to provision method. (9688cd21)
195
+
196
+ * (BKR-671) - Add error handing for Beaker failing to acquire a VM from vmpooler. (40d2db32)
197
+
198
+ ### <a name = "2.35.0">2.35.0 - 24 Feb, 2016 (b20fa892)
199
+
200
+ * (HISTORY) update beaker history for gem release 2.35.0 (b20fa892)
114
201
 
115
202
  * (GEM) update beaker version to 2.35.0 (e714b1eb)
116
203
 
@@ -44,6 +44,7 @@ Gem::Specification.new do |s|
44
44
  s.add_runtime_dependency 'beaker-answers', '~> 0.0'
45
45
  s.add_runtime_dependency 'stringify-hash', '~> 0.0'
46
46
  s.add_runtime_dependency 'beaker-hiera', '~> 0.0'
47
+ s.add_runtime_dependency 'beaker-pe', '~> 0.0'
47
48
 
48
49
  # Optional provisioner specific support
49
50
  s.add_runtime_dependency 'rbvmomi', '~> 1.8'
@@ -3,6 +3,7 @@
3
3
  require "beaker/dsl/#{lib}"
4
4
  end
5
5
 
6
+ require 'beaker-pe'
6
7
  module Beaker
7
8
  # This is a catch all module for including Puppetlabs home grown testing
8
9
  # DSL. This module is mixed into {Beaker::TestCase} and can be
@@ -79,5 +80,10 @@ module Beaker
79
80
  include Beaker::DSL::Helpers
80
81
  include Beaker::DSL::InstallUtils
81
82
  include Beaker::DSL::Patterns
83
+ include Beaker::DSL::PE
84
+
85
+ def self.register(helper_module)
86
+ include helper_module
87
+ end
82
88
  end
83
89
  end
@@ -1,13 +1,14 @@
1
- [ 'foss', 'pe', 'puppet', 'ezbake', 'module' ].each do |lib|
1
+ [ 'foss', 'puppet', 'ezbake', 'module' ].each do |lib|
2
2
  require "beaker/dsl/install_utils/#{lib}_utils"
3
3
  end
4
+ require "beaker/dsl/install_utils/pe_defaults"
4
5
 
5
6
  module Beaker
6
7
  module DSL
7
8
  # Collection of installation methods and support
8
9
  module InstallUtils
9
10
  include DSL::InstallUtils::PuppetUtils
10
- include DSL::InstallUtils::PEUtils
11
+ include DSL::InstallUtils::PEDefaults
11
12
  include DSL::InstallUtils::FOSSUtils
12
13
  include DSL::InstallUtils::ModuleUtils
13
14
  include DSL::InstallUtils::EZBakeUtils
@@ -849,8 +849,14 @@ module Beaker
849
849
  [opts[:release_yum_repo_url], repo_name, variant_url_value, version]
850
850
 
851
851
  if variant == 'cisco'
852
- # cisco requires using yum to install the repo
853
- host.install_package( remote )
852
+ if version == '5'
853
+ # cisco requires using yum to install the repo
854
+ host.install_package( remote )
855
+ end
856
+ if version == '7'
857
+ # cisco 7 requires using yum to localinstall the repo
858
+ on host, "yum -y localinstall #{remote}"
859
+ end
854
860
  else
855
861
  host.install_package_with_rpm( remote, '--replacepkgs',
856
862
  { :package_proxy => opts[:package_proxy] } )
@@ -209,7 +209,7 @@ module Unix::Pkg
209
209
  codename = self['platform'].codename
210
210
 
211
211
  if codename.nil?
212
- @logger.warning "Could not determine codename for debian platform #{self['platform']}. Skipping deployment of repo #{name}"
212
+ @logger.warn "Could not determine codename for debian platform #{self['platform']}. Skipping deployment of repo #{name}"
213
213
  return
214
214
  end
215
215
 
@@ -248,7 +248,7 @@ module Unix::Pkg
248
248
  # params
249
249
  def deploy_package_repo(path, name, version)
250
250
  if not File.exists? path
251
- @logger.warning "Was asked to deploy package repository from #{path}, but it doesn't exist!"
251
+ @logger.warn "Was asked to deploy package repository from #{path}, but it doesn't exist!"
252
252
  return
253
253
  end
254
254
 
@@ -23,7 +23,7 @@ module Beaker
23
23
  begin
24
24
  ::Docker.validate_version!
25
25
  rescue Excon::Errors::SocketError => e
26
- raise "Docker instance not connectable.\nError was: #{e}\nIf you are on OSX, you might not have Boot2Docker setup correctly\nCheck your DOCKER_HOST variable has been set"
26
+ raise "Docker instance not connectable.\nError was: #{e}\nCheck your DOCKER_HOST variable has been set\nIf you are on OSX or Windows, you might not have Docker Machine setup correctly: https://docs.docker.com/machine/\n"
27
27
  end
28
28
 
29
29
  # Pass on all the logging from docker-api to the beaker logger instance
@@ -87,6 +87,14 @@ module Beaker
87
87
  })
88
88
  end
89
89
 
90
+ # Get host info hash from parsed json response
91
+ # @param [Hash] parsed_response hash
92
+ # @param [String] template string
93
+ # @return [Hash] Host info hash
94
+ def get_host_info(parsed_response, template)
95
+ parsed_response[template]
96
+ end
97
+
90
98
  def provision
91
99
  request_payload = {}
92
100
  start = Time.now
@@ -127,6 +135,10 @@ module Beaker
127
135
  domain = parsed_response['domain']
128
136
 
129
137
  @hosts.each_with_index do |h, i|
138
+ # If the requested host template is not available on vmpooler
139
+ if get_host_info(parsed_response, h['template']).nil?
140
+ raise "Vmpooler.provision - requested host #{h['template']} not available"
141
+ end
130
142
  if parsed_response[h['template']]['hostname'].is_a?(Array)
131
143
  hostname = parsed_response[h['template']]['hostname'].shift
132
144
  else
@@ -1,5 +1,5 @@
1
1
  module Beaker
2
2
  module Version
3
- STRING = '2.35.0'
3
+ STRING = '2.36.0'
4
4
  end
5
5
  end
@@ -630,6 +630,37 @@ describe ClassMixedWithDSLInstallUtils do
630
630
 
631
631
  end
632
632
 
633
+ describe '#install_puppetlabs_release_repo_on' do
634
+ let( :host ) do
635
+ FakeHost.create( 'fakevm', platform.to_s )
636
+ end
637
+
638
+ before :each do
639
+ allow( subject ).to receive( :options ) { opts }
640
+ end
641
+
642
+ context 'on cisco platforms' do
643
+ context 'version 5' do
644
+ let( :platform ) { Beaker::Platform.new( 'cisco-5-x86_64' ) }
645
+
646
+ it 'calls host.install_package' do
647
+ expect( host ).to receive( :install_package ).with( /\.rpm$/ )
648
+ subject.install_puppetlabs_release_repo_on( host )
649
+ end
650
+ end
651
+
652
+ context 'version 7' do
653
+ let( :platform ) { Beaker::Platform.new( 'cisco-7-x86_64' ) }
654
+
655
+ it 'uses yum localinstall to install the package' do
656
+ expect( subject ).to receive( :on ).with( host, /^yum.*localinstall.*\.rpm$/ )
657
+ subject.install_puppetlabs_release_repo_on( host )
658
+ end
659
+ end
660
+ end
661
+
662
+ end
663
+
633
664
  describe "#install_puppetlabs_dev_repo" do
634
665
  let( :package_name ) { "puppet" }
635
666
  let( :package_version ) { "7.5.6" }
@@ -28,8 +28,61 @@ module Beaker
28
28
  let (:logger) { double( 'logger' ).as_null_object }
29
29
  let (:instance) { UnixPkgTest.new(opts, logger) }
30
30
 
31
- context "check_for_package" do
31
+ context 'Package deployment tests' do
32
+ path = '/some/file/path'
33
+ name = 'package_name'
34
+ version = '1.0.0'
35
+
36
+ describe '#deploy_package_repo' do
37
+
38
+ it 'returns a warning if there is no file at the path specified' do
39
+ expect(logger).to receive(:warn)
40
+ allow(File).to receive(:exists?).with(path).and_return(false)
41
+ instance.deploy_package_repo(path,name,version)
42
+ end
43
+
44
+ it 'calls #deploy_apt_repo for debian systems' do
45
+ @opts = {'platform' => 'ubuntu-is-me'}
46
+ expect(instance).to receive(:deploy_apt_repo)
47
+ allow(File).to receive(:exists?).with(path).and_return(true)
48
+ instance.deploy_package_repo(path,name,version)
49
+ end
50
+
51
+ it 'calls #deploy_yum_repo for el systems' do
52
+ @opts = {'platform' => 'el-is-me'}
53
+ expect(instance).to receive(:deploy_yum_repo)
54
+ allow(File).to receive(:exists?).with(path).and_return(true)
55
+ instance.deploy_package_repo(path,name,version)
56
+ end
57
+
58
+ it 'calls #deploy_zyp_repo for sles systems' do
59
+ @opts = {'platform' => 'sles-is-me'}
60
+ expect(instance).to receive(:deploy_zyp_repo)
61
+ allow(File).to receive(:exists?).with(path).and_return(true)
62
+ instance.deploy_package_repo(path,name,version)
63
+ end
32
64
 
65
+ it 'raises an error for unsupported systems' do
66
+ @opts = {'platform' => 'windows-is-me'}
67
+ allow(File).to receive(:exists?).with(path).and_return(true)
68
+ expect{instance.deploy_package_repo(path,name,version)}.to raise_error(RuntimeError)
69
+ end
70
+ end
71
+
72
+ describe '#deploy_apt_repo' do
73
+
74
+ it 'warns and exits when no codename exists for the debian platform' do
75
+ @opts = {'platform' => 'ubuntu-is-me'}
76
+ expect(logger).to receive(:warn)
77
+ allow(@opts['platform']).to receive(:codename).and_return(nil)
78
+ expect(instance).to receive(:deploy_apt_repo).and_return(instance.deploy_apt_repo(path,name,version))
79
+ allow(File).to receive(:exists?).with(path).and_return(true)
80
+ instance.deploy_package_repo(path,name,version)
81
+ end
82
+ end
83
+ end
84
+
85
+ context "check_for_package" do
33
86
  it "checks correctly on sles" do
34
87
  @opts = {'platform' => 'sles-is-me'}
35
88
  pkg = 'sles_package'
@@ -93,6 +93,8 @@ module Beaker
93
93
  end
94
94
  it 'should fail when docker not present' do
95
95
  expect { docker }.to raise_error(RuntimeError, /Docker instance not connectable./)
96
+ expect { docker }.to raise_error(RuntimeError, /Check your DOCKER_HOST variable has been set/)
97
+ expect { docker }.to raise_error(RuntimeError, /If you are on OSX or Windows, you might not have Docker Machine setup correctly/)
96
98
  expect { docker }.to raise_error(RuntimeError, /Error was: oops/)
97
99
  end
98
100
  end
@@ -73,6 +73,17 @@ module Beaker
73
73
  expect( host['vmhostname'] ).to be === 'pool'
74
74
  end
75
75
  end
76
+
77
+ it 'raises an error when a host template is not found in returned json' do
78
+ vmpooler = Beaker::Vmpooler.new( make_hosts, make_opts )
79
+ host = vmpooler.instance_variable_get(:@hosts)[0][:template]
80
+
81
+ allow( vmpooler ).to receive( :require ).and_return( true )
82
+ allow( vmpooler ).to receive( :sleep ).and_return( true )
83
+ allow( vmpooler ).to receive(:get_host_info).and_return(nil)
84
+
85
+ expect {vmpooler.provision}.to raise_error RuntimeError,"Vmpooler.provision - requested host #{host} not available"
86
+ end
76
87
  end
77
88
 
78
89
  describe "#cleanup" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.35.0
4
+ version: 2.36.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppetlabs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-24 00:00:00.000000000 Z
11
+ date: 2016-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -290,6 +290,20 @@ dependencies:
290
290
  - - ~>
291
291
  - !ruby/object:Gem::Version
292
292
  version: '0.0'
293
+ - !ruby/object:Gem::Dependency
294
+ name: beaker-pe
295
+ requirement: !ruby/object:Gem::Requirement
296
+ requirements:
297
+ - - ~>
298
+ - !ruby/object:Gem::Version
299
+ version: '0.0'
300
+ type: :runtime
301
+ prerelease: false
302
+ version_requirements: !ruby/object:Gem::Requirement
303
+ requirements:
304
+ - - ~>
305
+ - !ruby/object:Gem::Version
306
+ version: '0.0'
293
307
  - !ruby/object:Gem::Dependency
294
308
  name: rbvmomi
295
309
  requirement: !ruby/object:Gem::Requirement
@@ -590,7 +604,6 @@ files:
590
604
  - lib/beaker/dsl/install_utils/foss_utils.rb
591
605
  - lib/beaker/dsl/install_utils/module_utils.rb
592
606
  - lib/beaker/dsl/install_utils/pe_defaults.rb
593
- - lib/beaker/dsl/install_utils/pe_utils.rb
594
607
  - lib/beaker/dsl/install_utils/puppet_utils.rb
595
608
  - lib/beaker/dsl/install_utils/windows_utils.rb
596
609
  - lib/beaker/dsl/outcomes.rb
@@ -664,7 +677,6 @@ files:
664
677
  - lib/beaker/options/options_file_parser.rb
665
678
  - lib/beaker/options/options_hash.rb
666
679
  - lib/beaker/options/parser.rb
667
- - lib/beaker/options/pe_version_scraper.rb
668
680
  - lib/beaker/options/presets.rb
669
681
  - lib/beaker/options/validator.rb
670
682
  - lib/beaker/perf.rb
@@ -695,7 +707,6 @@ files:
695
707
  - spec/beaker/dsl/install_utils/foss_utils_spec.rb
696
708
  - spec/beaker/dsl/install_utils/module_utils_spec.rb
697
709
  - spec/beaker/dsl/install_utils/pe_defaults_spec.rb
698
- - spec/beaker/dsl/install_utils/pe_utils_spec.rb
699
710
  - spec/beaker/dsl/install_utils/puppet_utils_spec.rb
700
711
  - spec/beaker/dsl/install_utils/windows_utils_spec.rb
701
712
  - spec/beaker/dsl/outcomes_spec.rb
@@ -753,7 +764,6 @@ files:
753
764
  - spec/beaker/options/options_file_parser_spec.rb
754
765
  - spec/beaker/options/options_hash_spec.rb
755
766
  - spec/beaker/options/parser_spec.rb
756
- - spec/beaker/options/pe_version_scaper_spec.rb
757
767
  - spec/beaker/options/presets_spec.rb
758
768
  - spec/beaker/options/validator_spec.rb
759
769
  - spec/beaker/perf_spec.rb