beaker 2.13.0 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. checksums.yaml +8 -8
  2. data/Gemfile +19 -0
  3. data/HISTORY.md +335 -2
  4. data/acceptance/pre_suite/puppet_git/install.rb +2 -2
  5. data/lib/beaker/answers.rb +45 -2
  6. data/lib/beaker/answers/version20.rb +9 -9
  7. data/lib/beaker/answers/version28.rb +9 -9
  8. data/lib/beaker/answers/version30.rb +19 -19
  9. data/lib/beaker/answers/version32.rb +1 -1
  10. data/lib/beaker/answers/version34.rb +4 -4
  11. data/lib/beaker/answers/version40.rb +1 -1
  12. data/lib/beaker/cli.rb +11 -4
  13. data/lib/beaker/command.rb +4 -2
  14. data/lib/beaker/command_factory.rb +5 -1
  15. data/lib/beaker/dsl/helpers/host_helpers.rb +17 -5
  16. data/lib/beaker/dsl/install_utils.rb +3 -2
  17. data/lib/beaker/dsl/install_utils/aio_defaults.rb +86 -0
  18. data/lib/beaker/dsl/install_utils/foss_defaults.rb +163 -0
  19. data/lib/beaker/dsl/install_utils/foss_utils.rb +988 -0
  20. data/lib/beaker/dsl/install_utils/pe_defaults.rb +139 -0
  21. data/lib/beaker/dsl/install_utils/pe_utils.rb +140 -38
  22. data/lib/beaker/dsl/install_utils/puppet_utils.rb +26 -751
  23. data/lib/beaker/dsl/structure.rb +7 -1
  24. data/lib/beaker/host.rb +35 -58
  25. data/lib/beaker/host/freebsd.rb +4 -16
  26. data/lib/beaker/host/mac.rb +3 -39
  27. data/lib/beaker/host/mac/pkg.rb +2 -1
  28. data/lib/beaker/host/pswindows.rb +2 -28
  29. data/lib/beaker/host/unix.rb +3 -51
  30. data/lib/beaker/host/unix/pkg.rb +34 -33
  31. data/lib/beaker/host/windows.rb +1 -45
  32. data/lib/beaker/host_prebuilt_steps.rb +11 -24
  33. data/lib/beaker/hypervisor/aixer.rb +1 -1
  34. data/lib/beaker/hypervisor/docker.rb +43 -4
  35. data/lib/beaker/hypervisor/openstack.rb +1 -0
  36. data/lib/beaker/hypervisor/solaris.rb +1 -1
  37. data/lib/beaker/hypervisor/vmpooler.rb +19 -8
  38. data/lib/beaker/network_manager.rb +5 -4
  39. data/lib/beaker/options/command_line_parser.rb +9 -9
  40. data/lib/beaker/options/parser.rb +21 -17
  41. data/lib/beaker/options/presets.rb +0 -33
  42. data/lib/beaker/platform.rb +7 -3
  43. data/lib/beaker/ssh_connection.rb +1 -1
  44. data/lib/beaker/version.rb +1 -1
  45. data/spec/beaker/answers_spec.rb +13 -8
  46. data/spec/beaker/cli_spec.rb +6 -6
  47. data/spec/beaker/command_spec.rb +18 -0
  48. data/spec/beaker/dsl/helpers/puppet_helpers_spec.rb +2 -0
  49. data/spec/beaker/dsl/install_utils/{puppet_utils_spec.rb → foss_utils_spec.rb} +34 -21
  50. data/spec/beaker/dsl/install_utils/pe_utils_spec.rb +2 -0
  51. data/spec/beaker/dsl/structure_spec.rb +8 -0
  52. data/spec/beaker/host/unix/pkg_spec.rb +15 -10
  53. data/spec/beaker/host_prebuilt_steps_spec.rb +1 -1
  54. data/spec/beaker/host_spec.rb +3 -54
  55. data/spec/beaker/hypervisor/docker_spec.rb +2 -0
  56. data/spec/beaker/hypervisor/vmpooler_spec.rb +67 -10
  57. data/spec/beaker/options/command_line_parser_spec.rb +2 -2
  58. data/spec/beaker/options/parser_spec.rb +35 -24
  59. data/spec/beaker/options/presets_spec.rb +0 -26
  60. data/spec/helpers.rb +5 -5
  61. data/spec/mocks.rb +1 -2
  62. metadata +7 -3
@@ -430,7 +430,7 @@ describe Beaker do
430
430
  it "can exec the get_ip command" do
431
431
  host = make_host('name', { :stdout => "192.168.2.130\n" } )
432
432
 
433
- expect( Beaker::Command ).to receive( :new ).with( "ip a|awk '/global/{print$2}' | cut -d/ -f1 | head -1" ).once
433
+ expect( Beaker::Command ).to receive( :new ).with( "ip a|awk '/global/{print$2}' | cut -d/ -f1 | head -1", [], {:prepend_cmds=>nil, :cmdexe=>false} ).once
434
434
 
435
435
  expect( subject.get_ip( host ) ).to be === "192.168.2.130"
436
436
 
@@ -230,7 +230,7 @@ module Beaker
230
230
 
231
231
  describe "executing commands" do
232
232
  let(:command) { Beaker::Command.new('ls') }
233
- let(:host) { Beaker::Host.create('host', make_host_opts('host', options.merge(platform))) }
233
+ let(:host) { Beaker::Host.create('host', {}, make_host_opts('host', options.merge(platform))) }
234
234
  let(:result) { Beaker::Result.new(host, 'ls') }
235
235
 
236
236
  before :each do
@@ -572,13 +572,13 @@ module Beaker
572
572
 
573
573
  rsync_args = [ 'source', 'target', ['-az', "-e \"ssh -i #{key} -p 22 -o 'StrictHostKeyChecking no'\"", "--exclude '.bundle'"] ]
574
574
 
575
- expect( host ).to receive(:to_s).and_return('host.example.org')
575
+ expect( host ).to receive(:reachable_name).and_return('default.ip.address')
576
576
 
577
577
  expect( Rsync ).to receive(:run).with( *rsync_args ).and_return(Beaker::Result.new(host, 'output!'))
578
578
 
579
579
  host.do_rsync_to *args
580
580
 
581
- expect(Rsync.host).to eq('root@host.example.org')
581
+ expect(Rsync.host).to eq('root@default.ip.address')
582
582
  end
583
583
 
584
584
  it 'throws an IOError when the file given doesn\'t exist' do
@@ -590,56 +590,5 @@ module Beaker
590
590
  expect( "#{host}" ).to be === 'name'
591
591
  end
592
592
 
593
- context 'merging defaults' do
594
- it 'knows the difference between foss and pe' do
595
- @options = { :type => 'pe' }
596
- expect( host['puppetpath'] ).to be === '/etc/puppetlabs/puppet'
597
- end
598
-
599
- end
600
-
601
- context 'deprecating host keys' do
602
-
603
- describe '#build_deprecated_keys' do
604
-
605
- it 'returns the correct array for a unix host' do
606
- expect( host.build_deprecated_keys().include?(:puppetvardir) ).to be_truthy
607
- end
608
-
609
- it 'returns the correct array for a windows host' do
610
- @platform = 'windows-xp-me-bla'
611
- expect( host.build_deprecated_keys().include?(:hieraconf) ).to be_truthy
612
- end
613
-
614
- it 'can be called on an unsupported host type without an error being thrown' do
615
- @options = { :is_cygwin => false }
616
- @platform = 'windows-stuff-stuff'
617
- expect{ host.build_deprecated_keys() }.not_to raise_error
618
- expect( host.build_deprecated_keys().empty? ).to be_truthy
619
- end
620
-
621
- it 'returns an empty array for unsupported host types' do
622
- @options = { :is_cygwin => false }
623
- @platform = 'windows-stuff-stuff'
624
- expect( host.build_deprecated_keys().empty? ).to be_truthy
625
- end
626
-
627
- end
628
-
629
- describe '#[]' do
630
-
631
- it 'does not log for a key that isn\'t deprecated' do
632
- expect( host ).to receive( :@logger ).exactly(0).times
633
- host['puppetbindir']
634
- end
635
-
636
- it 'logs the warning message for a deprecated key' do
637
- expect( host.instance_variable_get(:@logger) ).to receive( :warn ).once
638
- host['hierapuppetlibdir']
639
- end
640
-
641
- end
642
-
643
- end
644
593
  end
645
594
  end
@@ -59,6 +59,7 @@ module Beaker
59
59
 
60
60
  let (:docker) { ::Beaker::Docker.new( hosts, options ) }
61
61
  let(:docker_options) { nil }
62
+ let (:version) { {"ApiVersion"=>"1.18", "Arch"=>"amd64", "GitCommit"=>"4749651", "GoVersion"=>"go1.4.2", "KernelVersion"=>"3.16.0-37-generic", "Os"=>"linux", "Version"=>"1.6.0"} }
62
63
 
63
64
  before :each do
64
65
  # Stub out all of the docker-api gem. we should never really call it
@@ -67,6 +68,7 @@ module Beaker
67
68
  allow( ::Docker ).to receive(:options).and_return(docker_options)
68
69
  allow( ::Docker ).to receive(:options=)
69
70
  allow( ::Docker ).to receive(:logger=)
71
+ allow( ::Docker ).to receive(:version).and_return(version)
70
72
  allow( ::Docker::Image ).to receive(:build).and_return(image)
71
73
  allow( ::Docker::Container ).to receive(:create).and_return(container)
72
74
  allow_any_instance_of( ::Docker::Container ).to receive(:start)
@@ -7,13 +7,14 @@ module Beaker
7
7
  vms = make_hosts()
8
8
  MockVsphereHelper.set_config( fog_file_contents )
9
9
  MockVsphereHelper.set_vms( vms )
10
- stub_const( "VsphereHelper", MockVsphereHelper )
11
- stub_const( "Net", MockNet )
10
+ stub_const( "VsphereHelper", MockVsphereHelper )
11
+ stub_const( "Net", MockNet )
12
12
  allow( JSON ).to receive( :parse ) do |arg|
13
13
  arg
14
14
  end
15
15
  allow( Socket ).to receive( :getaddrinfo ).and_return( true )
16
- allow_any_instance_of( Beaker::Vmpooler ).to receive(:load_credentials).and_return(fog_file_contents)
16
+ allow_any_instance_of( Beaker::Vmpooler ).to \
17
+ receive(:load_credentials).and_return(fog_file_contents)
17
18
  end
18
19
 
19
20
  describe '#get_template_url' do
@@ -23,7 +24,7 @@ module Beaker
23
24
  uri = vmpooler.get_template_url("http://pooling.com", "template")
24
25
  expect( uri ).to be === "http://pooling.com/vm/template"
25
26
  end
26
-
27
+
27
28
  it 'adds a missing scheme to a given URL' do
28
29
  vmpooler = Beaker::Vmpooler.new( make_hosts, make_opts )
29
30
  uri = vmpooler.get_template_url("pooling.com", "template")
@@ -39,13 +40,11 @@ module Beaker
39
40
  vmpooler = Beaker::Vmpooler.new( make_hosts, make_opts )
40
41
  expect{ vmpooler.get_template_url("pooling.com", "t!e&m*p(l\\a/t e")}.to raise_error ArgumentError
41
42
  end
42
-
43
43
  end
44
44
 
45
45
  describe "#provision" do
46
46
 
47
- it 'provisions hosts from the pool' do
48
-
47
+ it 'provisions hosts from the pool' do
49
48
  vmpooler = Beaker::Vmpooler.new( make_hosts, make_opts )
50
49
  allow( vmpooler ).to receive( :require ).and_return( true )
51
50
  allow( vmpooler ).to receive( :sleep ).and_return( true )
@@ -55,9 +54,7 @@ module Beaker
55
54
  hosts.each do | host |
56
55
  expect( host['vmhostname'] ).to be === 'pool'
57
56
  end
58
-
59
57
  end
60
-
61
58
  end
62
59
 
63
60
  describe "#cleanup" do
@@ -78,10 +75,70 @@ module Beaker
78
75
  expect( vm.runtime.powerState ).to be === "poweredOn" #handed back to the pool, stays on
79
76
  end
80
77
  end
78
+ end
79
+ end
81
80
 
81
+ describe Vmpooler do
82
82
 
83
+ before :each do
84
+ vms = make_hosts()
85
+ MockVsphereHelper.set_config( fog_file_contents )
86
+ MockVsphereHelper.set_vms( vms )
87
+ stub_const( "VsphereHelper", MockVsphereHelper )
88
+ stub_const( "Net", MockNet )
89
+ allow( JSON ).to receive( :parse ) do |arg|
90
+ arg
91
+ end
92
+ allow( Socket ).to receive( :getaddrinfo ).and_return( true )
83
93
  end
84
94
 
85
- end
95
+ describe "#load_credentials" do
96
+
97
+ it 'continues without credentials when fog file is missing' do
98
+ allow_any_instance_of( Beaker::Vmpooler ).to \
99
+ receive(:read_fog_file).and_raise(Errno::ENOENT.new)
100
+
101
+ vmpooler = Beaker::Vmpooler.new( make_hosts, make_opts )
102
+ expect( vmpooler.credentials ).to be == {}
103
+ end
104
+
105
+ it 'continues without credentials when fog file is empty' do
106
+ allow_any_instance_of( Beaker::Vmpooler ).to \
107
+ receive(:read_fog_file).and_return(false)
86
108
 
109
+ vmpooler = Beaker::Vmpooler.new( make_hosts, make_opts )
110
+ expect( vmpooler.credentials ).to be == {}
111
+ end
112
+
113
+ it 'continues without credentials when fog file contains no :default section' do
114
+ data = { :some => { :other => :data } }
115
+
116
+ allow_any_instance_of( Beaker::Vmpooler ).to \
117
+ receive(:read_fog_file).and_return(data)
118
+
119
+ vmpooler = Beaker::Vmpooler.new( make_hosts, make_opts )
120
+ expect( vmpooler.credentials ).to be == { }
121
+ end
122
+
123
+ it 'continues without credentials when fog file :default section has no :vmpooler_token' do
124
+ data = { :default => { :something_else => "TOKEN" } }
125
+
126
+ allow_any_instance_of( Beaker::Vmpooler ).to \
127
+ receive(:read_fog_file).and_return(data)
128
+
129
+ vmpooler = Beaker::Vmpooler.new( make_hosts, make_opts )
130
+ expect( vmpooler.credentials ).to be == { }
131
+ end
132
+
133
+ it 'stores vmpooler token when found in fog file' do
134
+ data = { :default => { :vmpooler_token => "TOKEN" } }
135
+
136
+ allow_any_instance_of( Beaker::Vmpooler ).to \
137
+ receive(:read_fog_file).and_return(data)
138
+
139
+ vmpooler = Beaker::Vmpooler.new( make_hosts, make_opts )
140
+ expect( vmpooler.credentials ).to be == { :vmpooler_token => "TOKEN" }
141
+ end
142
+ end
143
+ end
87
144
  end
@@ -6,8 +6,8 @@ module Beaker
6
6
 
7
7
  let(:parser) {Beaker::Options::CommandLineParser.new}
8
8
  let(:test_opts) {["-h", "vcloud.cfg", "--debug", "--tests", "test.rb", "--help"]}
9
- let(:full_opts_in) {["--hosts", "host.cfg", "--options", "opts_file", "--type", "pe", "--helper", "path_to_helper", "--load-path", "load_path", "--tests", "test1.rb,test2.rb,test3.rb", "--pre-suite", "pre_suite.rb", "--post-suite", "post_suite.rb", "--no-provision", "--preserve-hosts", "always", "--root-keys", "--keyfile", "../.ssh/id_rsa", "--install", "gitrepopath", "-m", "module", "-q", "--dry-run", "--no-ntp", "--repo-proxy", "--add-el-extras", "--config", "anotherfile.cfg", "--fail-mode", "fast", "--no-color", "--version", "--log-level", "info", "--package-proxy", "http://192.168.100.1:3128", "--collect-perf-data", "--parse-only", "--validate", "--timeout", "40", "--log-prefix", "pants", "--configure"]}
10
- let(:full_opts_out) {{:hosts_file=>"anotherfile.cfg",:options_file=>"opts_file", :type => "pe", :helper => "path_to_helper", :load_path => "load_path", :tests => "test1.rb,test2.rb,test3.rb", :pre_suite => "pre_suite.rb", :post_suite => "post_suite.rb", :provision=>false, :preserve_hosts => "always", :root_keys=>true, :keyfile => "../.ssh/id_rsa", :install => "gitrepopath", :modules=>"module", :quiet=>true, :dry_run=>true, :timesync=>false, :repo_proxy=>true, :add_el_extras=>true, :fail_mode => "fast", :color=>false, :version=>true, :log_level => "info", :package_proxy => "http://192.168.100.1:3128", :collect_perf_data=>true, :parse_only=>true, :validate=>true, :timeout => "40", :log_prefix => "pants", :configure => true}}
9
+ let(:full_opts_in) {["--hosts", "host.cfg", "--options", "opts_file", "--helper", "path_to_helper", "--load-path", "load_path", "--tests", "test1.rb,test2.rb,test3.rb", "--pre-suite", "pre_suite.rb", "--post-suite", "post_suite.rb", "--no-provision", "--preserve-hosts", "always", "--root-keys", "--keyfile", "../.ssh/id_rsa", "--install", "gitrepopath", "-m", "module", "-q", "--dry-run", "--no-ntp", "--repo-proxy", "--add-el-extras", "--config", "anotherfile.cfg", "--fail-mode", "fast", "--no-color", "--version", "--log-level", "info", "--package-proxy", "http://192.168.100.1:3128", "--collect-perf-data", "--parse-only", "--validate", "--timeout", "40", "--log-prefix", "pants", "--configure"]}
10
+ let(:full_opts_out) {{:hosts_file=>"anotherfile.cfg",:options_file=>"opts_file", :helper => "path_to_helper", :load_path => "load_path", :tests => "test1.rb,test2.rb,test3.rb", :pre_suite => "pre_suite.rb", :post_suite => "post_suite.rb", :provision=>false, :preserve_hosts => "always", :root_keys=>true, :keyfile => "../.ssh/id_rsa", :install => "gitrepopath", :modules=>"module", :quiet=>true, :dry_run=>true, :timesync=>false, :repo_proxy=>true, :add_el_extras=>true, :fail_mode => "fast", :color=>false, :version=>true, :log_level => "info", :package_proxy => "http://192.168.100.1:3128", :collect_perf_data=>true, :parse_only=>true, :validate=>true, :timeout => "40", :log_prefix => "pants", :configure => true}}
11
11
  let(:validate_true) {["--validate"]}
12
12
  let(:validate_false) {["--no-validate"]}
13
13
  let(:configure_true) {['--configure']}
@@ -167,10 +167,6 @@ module Beaker
167
167
  expect{parser.parse_args(args)}.to raise_error(ArgumentError)
168
168
  end
169
169
 
170
- it "ensures that type is one of pe/git" do
171
- args = ["-h", hosts_path, "--log-level", "debug", "--type", "unkowns"]
172
- expect{parser.parse_args(args)}.to raise_error(ArgumentError)
173
- end
174
170
  end
175
171
 
176
172
  context "set_default_host!" do
@@ -215,16 +211,22 @@ module Beaker
215
211
 
216
212
  describe "normalize_args" do
217
213
  let(:hosts) do
218
- {
214
+ Beaker::Options::OptionsHash.new.merge({
219
215
  'HOSTS' => {
220
216
  :master => {
221
217
  :roles => ["master","agent","arbitrary_role"],
218
+ :platform => 'el-7-x86_64',
219
+ :user => 'root',
222
220
  },
223
221
  :agent => {
224
222
  :roles => ["agent","default","other_abitrary_role"],
223
+ :platform => 'el-7-x86_64',
224
+ :user => 'root',
225
225
  },
226
- }
227
- }
226
+ },
227
+ 'fail_mode' => 'slow',
228
+ 'preserve_hosts' => 'always',
229
+ })
228
230
  end
229
231
 
230
232
  def fake_hosts_file_for_platform(hosts, platform)
@@ -237,34 +239,43 @@ module Beaker
237
239
  end
238
240
 
239
241
  shared_examples_for(:a_platform_supporting_only_agents) do |platform,type|
240
- let(:args) { ["--type", type] }
241
242
 
242
- it "restricts #{platform} hosts to agent for #{type}" do
243
+ it "restricts #{platform} hosts to agent" do
244
+ args = []
243
245
  hosts_file = fake_hosts_file_for_platform(hosts, platform)
244
246
  args << "--hosts" << hosts_file
245
247
  expect { parser.parse_args(args) }.to raise_error(ArgumentError, /#{platform}.*may not have roles 'master', 'dashboard', or 'database'/)
246
248
  end
247
249
  end
248
250
 
249
- context "for pe" do
250
- it_should_behave_like(:a_platform_supporting_only_agents, 'solaris-version-arch', 'pe')
251
- it_should_behave_like(:a_platform_supporting_only_agents, 'windows-version-arch', 'pe')
252
- it_should_behave_like(:a_platform_supporting_only_agents, 'el-4-arch', 'pe')
251
+ context "restricts agents" do
252
+ it_should_behave_like(:a_platform_supporting_only_agents, 'windows-version-arch')
253
+ it_should_behave_like(:a_platform_supporting_only_agents, 'el-4-arch')
253
254
  end
254
255
 
255
- context "for foss" do
256
- it_should_behave_like(:a_platform_supporting_only_agents, 'windows-version-arch', 'git')
257
- it_should_behave_like(:a_platform_supporting_only_agents, 'el-4-arch', 'git')
258
-
259
- it "allows master role for solaris" do
260
- hosts_file = fake_hosts_file_for_platform(hosts, 'solaris-version-arch')
261
- args = ["--type", "git", "--hosts", hosts_file]
262
- options_hash = parser.parse_args(args)
263
- expect(options_hash[:HOSTS][:master][:platform]).to match(/solaris/)
264
- expect(options_hash[:HOSTS][:master][:roles]).to include('master')
265
- expect(options_hash[:type]).to eq('git')
256
+ context "ssh user" do
257
+
258
+ it 'uses the ssh[:user] if it is provided' do
259
+ hosts['HOSTS'][:master][:ssh] = { :user => 'hello' }
260
+ parser.instance_variable_set(:@options, hosts)
261
+ parser.normalize_args
262
+ expect( hosts['HOSTS'][:master][:user] ).to be == 'hello'
263
+ end
264
+
265
+ it 'uses default user if there is an ssh hash, but no ssh[:user]' do
266
+ hosts['HOSTS'][:master][:ssh] = { :hello => 'hello' }
267
+ parser.instance_variable_set(:@options, hosts)
268
+ parser.normalize_args
269
+ expect( hosts['HOSTS'][:master][:user] ).to be == 'root'
270
+ end
271
+
272
+ it 'uses default user if no ssh hash' do
273
+ parser.instance_variable_set(:@options, hosts)
274
+ parser.normalize_args
275
+ expect( hosts['HOSTS'][:master][:user] ).to be == 'root'
266
276
  end
267
277
  end
278
+
268
279
  end
269
280
  end
270
281
  end
@@ -19,32 +19,6 @@ module Beaker
19
19
  expect(presets.presets).to be_instance_of(Beaker::Options::OptionsHash)
20
20
  end
21
21
 
22
- describe 'when setting the type as pe from the environment' do
23
- describe 'sets type to pe if...' do
24
- it 'env var is set to "true"' do
25
- munged = presets.format_found_env_vars( {:is_pe => 'true'} )
26
- expect( munged[:type] ).to be == 'pe'
27
- end
28
- it 'env var is set to "yes"' do
29
- munged = presets.format_found_env_vars( {:is_pe => 'yes'} )
30
- expect( munged[:type] ).to be == 'pe'
31
- end
32
- end
33
- describe 'sets type to foss if...' do
34
- it 'env var is set to "false"' do
35
- munged = presets.format_found_env_vars( {:is_pe => 'true'} )
36
- expect( munged[:type] ).to be == 'pe'
37
- end
38
- it 'env var is set to "no"' do
39
- munged = presets.format_found_env_vars( {:is_pe => 'yes'} )
40
- expect( munged[:type] ).to be == 'pe'
41
- end
42
- end
43
- it 'does not set type otherwise' do
44
- munged = presets.format_found_env_vars( {:is_pe => nil} )
45
- expect( munged[:type] ).to be == nil
46
- end
47
- end
48
22
  end
49
23
  end
50
24
  end
@@ -50,7 +50,7 @@ module HostHelpers
50
50
  opts = Beaker::Options::Presets.new
51
51
  opts.presets.merge( opts.env_vars ).merge( { :logger => logger,
52
52
  :host_config => 'sample.config',
53
- :type => :foss,
53
+ :type => nil,
54
54
  :pooling_api => 'http://vcloud.delivery.puppetlabs.net/',
55
55
  :datastore => 'instance0',
56
56
  :folder => 'Delivery/Quality Assurance/Staging/Dynamic',
@@ -77,12 +77,12 @@ module HostHelpers
77
77
  make_opts.merge( { 'HOSTS' => { name => opts } } ).merge( opts )
78
78
  end
79
79
 
80
- def make_host name, opts
81
- opts = HOST_DEFAULTS.merge(opts)
80
+ def make_host name, host_hash
81
+ host_hash = Beaker::Options::OptionsHash.new.merge(HOST_DEFAULTS.merge(host_hash))
82
82
 
83
- host = Beaker::Host.create( name, make_host_opts(name, opts) )
83
+ host = Beaker::Host.create( name, host_hash, make_opts)
84
84
 
85
- allow(host).to receive( :exec ).and_return( generate_result( name, opts ) )
85
+ allow(host).to receive( :exec ).and_return( generate_result( name, host_hash ) )
86
86
  host
87
87
  end
88
88
 
@@ -77,8 +77,7 @@ module FakeHost
77
77
 
78
78
  def self.create(name = 'fakevm', platform = 'redhat-version-arch', options = {})
79
79
  options_hash = Beaker::Options::OptionsHash.new.merge(options)
80
- options_hash['HOSTS'] = { name => { 'platform' => Beaker::Platform.new(platform) } }
81
- host = Beaker::Host.create(name, options_hash)
80
+ host = Beaker::Host.create(name, { 'platform' => Beaker::Platform.new(platform) } , options_hash)
82
81
  host.extend(MockedExec)
83
82
  host
84
83
  end
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.13.0
4
+ version: 2.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppetlabs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-29 00:00:00.000000000 Z
11
+ date: 2015-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -411,8 +411,12 @@ files:
411
411
  - lib/beaker/dsl/helpers/tk_helpers.rb
412
412
  - lib/beaker/dsl/helpers/web_helpers.rb
413
413
  - lib/beaker/dsl/install_utils.rb
414
+ - lib/beaker/dsl/install_utils/aio_defaults.rb
414
415
  - lib/beaker/dsl/install_utils/ezbake_utils.rb
416
+ - lib/beaker/dsl/install_utils/foss_defaults.rb
417
+ - lib/beaker/dsl/install_utils/foss_utils.rb
415
418
  - lib/beaker/dsl/install_utils/module_utils.rb
419
+ - lib/beaker/dsl/install_utils/pe_defaults.rb
416
420
  - lib/beaker/dsl/install_utils/pe_utils.rb
417
421
  - lib/beaker/dsl/install_utils/puppet_utils.rb
418
422
  - lib/beaker/dsl/outcomes.rb
@@ -510,9 +514,9 @@ files:
510
514
  - spec/beaker/dsl/helpers/test_helpers_spec.rb
511
515
  - spec/beaker/dsl/helpers/tk_helpers_spec.rb
512
516
  - spec/beaker/dsl/helpers/web_helpers_spec.rb
517
+ - spec/beaker/dsl/install_utils/foss_utils_spec.rb
513
518
  - spec/beaker/dsl/install_utils/module_utils_spec.rb
514
519
  - spec/beaker/dsl/install_utils/pe_utils_spec.rb
515
- - spec/beaker/dsl/install_utils/puppet_utils_spec.rb
516
520
  - spec/beaker/dsl/outcomes_spec.rb
517
521
  - spec/beaker/dsl/roles_spec.rb
518
522
  - spec/beaker/dsl/structure_spec.rb