beaker 2.16.0 → 2.17.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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDFkMzY5NTRmMTYyNWI3NzhhZTBkNDUyZDQwNDE4ZGQ4ZTYzOWE0MA==
4
+ YjMwMzYyMmMwOThkODRiYzdjZjgwNTVkYjA0NmMzNGY0NWIyZDc1Yg==
5
5
  data.tar.gz: !binary |-
6
- MmYyODFjZTYzNGM1NmRhYzRiZjNiZDIzMDEzOTdkMmI3ZDI5Y2JiZg==
6
+ MDZlZmUxYzc2ZDhkMWY2MDY2NjU0ODUyYzJkYjhiZWJiZWU2OGI2Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjAyZTMxYjQ5YTZhOWQwZjM4N2NlYTVjYmEzMDg4MGZjNzgyYTYzNGUwNDk2
10
- MDliNmY1NjYzMGY0MDE5YjE1NTc2YjdjZTRkNjk1ZmYyNWJmMzQ0ZDkxNTJh
11
- NWMyMjBjYWMzY2I1MzVhYzYyNDQ1ZmI2MDFkOTI0YTEyYTFiNGM=
9
+ MWVhZmE0MjA1MWRhZThhNzAxZGVjMmM3YTUwMjRjYzhjN2NhOTg3N2IwODU1
10
+ NTU2ODc4Y2U3NmMyNTRkMjhlMWUyMDUzZWZkMTYzOGM3ZTRiNWM3NjA2Mzg2
11
+ MmY4ZGI1MDU1ZmUyZTBjYTM0NDE5NzY1MGEwNjM4NWYzNDhmNTA=
12
12
  data.tar.gz: !binary |-
13
- Yzc2NWU5OTQ3OWZlNGU2MzhlYTNhM2I0NThmOGU0NWRkZTgwM2EzMTQxYmMz
14
- ODQwOTEwYWFiYWEzYzQ5MWJiY2NjZTk2NDRlZjk3YTg1MzFjMDQ0OTViM2Ey
15
- YTY0YTdkMTYwMDhhYzFlNjkyM2VlOWRiMzBhOTlmODRhZjVkNWY=
13
+ NzE0OWNkMTBmNGRiYmQ0YmVjMDZjMTViYmNjNzBjMTY4OTMwNDViZWUwOThm
14
+ NzI5MjhmZTA1M2QwMzJjYmQwMDcyM2IwZmU0NjEzMjg5MmY5NjliMGE2ZDky
15
+ MWE0YTI2MDQ4MWY1ZTY3OGMzOTNmNjc3YjI1ZTVjOThlNzM3MWI=
data/HISTORY.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # default - History
2
2
  ## Tags
3
- * [LATEST - 6 Jul, 2015 (6b0a9ca2)](#LATEST)
3
+ * [LATEST - 10 Jul, 2015 (745d9116)](#LATEST)
4
+ * [2.16.0 - 6 Jul, 2015 (b3e76227)](#2.16.0)
4
5
  * [2.15.1 - 1 Jul, 2015 (cd6f0bab)](#2.15.1)
5
6
  * [2.15.0 - 1 Jul, 2015 (07c416fb)](#2.15.0)
6
7
  * [2.14.1 - 5 Jun, 2015 (35026603)](#2.14.1)
@@ -85,7 +86,109 @@
85
86
  * [pe1.2 - 6 Sep, 2011 (ba3dadd2)](#pe1.2)
86
87
 
87
88
  ## Details
88
- ### <a name = "LATEST">LATEST - 6 Jul, 2015 (6b0a9ca2)
89
+ ### <a name = "LATEST">LATEST - 10 Jul, 2015 (745d9116)
90
+
91
+ * (GEM) update beaker version to 2.17.0 (745d9116)
92
+
93
+ * Merge pull request #884 from justinstoller/maint/master/moar-puppet-agent (7ba09f8f)
94
+
95
+
96
+ ```
97
+ Merge pull request #884 from justinstoller/maint/master/moar-puppet-agent
98
+
99
+ (maint) Allow PE puppet-agent installs on custom roles
100
+ ```
101
+ * (maint) Allow PE puppet-agent installs on custom roles (cfe9c834)
102
+
103
+
104
+ ```
105
+ (maint) Allow PE puppet-agent installs on custom roles
106
+
107
+ Previously we installed puppet-agent on a host if there was the agent
108
+ role and no other role assigned to it. This prevents assigning a
109
+ puppet-agent node the "default" role to be used as the default test
110
+ target, or allow any other custom roles.
111
+
112
+ To allow assigning the "default" or custom roles to a puppet-agent node
113
+ we list the non-puppet-agnet roles we know how to generate installation answers
114
+ for and use that list to determine what nodes are puppet-agent or not.
115
+ ```
116
+ * Merge pull request #883 from anodelman/puppetservice (2822e415)
117
+
118
+
119
+ ```
120
+ Merge pull request #883 from anodelman/puppetservice
121
+
122
+ (BKR-390) Scooter pipeline is using pe-httpd instead of pe-puppetserver
123
+ ```
124
+ * Merge pull request #882 from anodelman/osx (b64ee262)
125
+
126
+
127
+ ```
128
+ Merge pull request #882 from anodelman/osx
129
+
130
+ (BKR-388) Beaker::Host::Mac#touch returns non-existent path
131
+ ```
132
+ * Merge pull request #879 from anodelman/maint (df169767)
133
+
134
+
135
+ ```
136
+ Merge pull request #879 from anodelman/maint
137
+
138
+ (BKR-386) beaker does not work with host_preserved.yaml file anymore
139
+ ```
140
+ * (BKR-390) Scooter pipeline is using pe-httpd instead of pe-puppetserver (3a7830cc)
141
+
142
+
143
+ ```
144
+ (BKR-390) Scooter pipeline is using pe-httpd instead of pe-puppetserver
145
+
146
+ - only use aio defaults on agents that are not master, database or
147
+ dashboard (was previously using aio defaults/paths on all hosts
148
+ identified as being >= 4.0)
149
+ ```
150
+ * (BKR-388) Beaker::Host::Mac#touch returns non-existent path (21e885e0)
151
+
152
+
153
+ ```
154
+ (BKR-388) Beaker::Host::Mac#touch returns non-existent path
155
+
156
+ - ensure that the mac host.touch method returns a correct, absolute
157
+ path to the touch command
158
+ ```
159
+ * Merge pull request #859 from vindir/feature/instancestores (a3429c39)
160
+
161
+
162
+ ```
163
+ Merge pull request #859 from vindir/feature/instancestores
164
+
165
+ (BKR-348) AWS: Adding instance storage support
166
+ ```
167
+ * (BKR-386) beaker does not work with host_preserved.yaml file anymore (c1b471fc)
168
+
169
+
170
+ ```
171
+ (BKR-386) beaker does not work with host_preserved.yaml file anymore
172
+
173
+ - puppet-agent installation was causing a 'version' argument to be added
174
+ to the preserved host file, causing beaker to output --version
175
+ information upon re-use of that file
176
+ - fix is just renaming --version to use beaker_version instead of
177
+ version as a flag
178
+ ```
179
+ * (BKR-348) instance storage now supported (e607b2d5)
180
+
181
+
182
+ ```
183
+ (BKR-348) instance storage now supported
184
+
185
+ AMIs using the instance storage root device type are now supported
186
+ allowing users who don't want/need EBS backed AMIs to add nodesets
187
+ more easily.
188
+ ```
189
+ ### <a name = "2.16.0">2.16.0 - 6 Jul, 2015 (b3e76227)
190
+
191
+ * (HISTORY) update beaker history for gem release 2.16.0 (b3e76227)
89
192
 
90
193
  * (GEM) update beaker version to 2.16.0 (6b0a9ca2)
91
194
 
data/lib/beaker/cli.rb CHANGED
@@ -16,6 +16,8 @@ module Beaker
16
16
  @logger = Beaker::Logger.new(@options)
17
17
  @options[:logger] = @logger
18
18
  @options[:timestamp] = @timestamp
19
+ @options[:beaker_version] = Beaker::Version::STRING
20
+ beaker_version_string = VERSION_STRING % @options[:beaker_version]
19
21
  @execute = true
20
22
 
21
23
  if @options[:help]
@@ -23,11 +25,13 @@ module Beaker
23
25
  @execute = false
24
26
  return
25
27
  end
26
- if @options[:version]
27
- @logger.notify(VERSION_STRING % Beaker::Version::STRING)
28
+ if @options[:beaker_version_print]
29
+ @logger.notify(beaker_version_string)
28
30
  @execute = false
29
31
  return
30
32
  end
33
+ @logger.info("Beaker!")
34
+ @logger.info(beaker_version_string)
31
35
  @logger.info(@options.dump)
32
36
  if @options[:parse_only]
33
37
  @execute = false
@@ -35,8 +35,9 @@ module Beaker
35
35
  # or a role (String or Symbol) that identifies one or more hosts.
36
36
  def configure_foss_defaults_on( hosts )
37
37
  block_on hosts do |host|
38
- if (host[:version] && (not version_is_less(host[:version], '4.0'))) or host['type'] && host['type'] =~ /aio/
39
- # add foss defaults to host
38
+ if (not_controller(host) && host[:version] && (not version_is_less(host[:version], '4.0'))) \
39
+ or (host['type'] && host['type'] =~ /aio/)
40
+ # add aio defaults to host
40
41
  add_aio_defaults_on(host)
41
42
  else
42
43
  add_foss_defaults_on(host)
@@ -26,7 +26,8 @@ module Beaker
26
26
  # or a role (String or Symbol) that identifies one or more hosts.
27
27
  def configure_pe_defaults_on( hosts )
28
28
  block_on hosts do |host|
29
- if (host[:pe_ver] && (not version_is_less(host[:pe_ver], '4.0'))) or (host['type'] && host['type'] =~ /aio/)
29
+ if (not_controller(host) && host[:pe_ver] && (not version_is_less(host[:pe_ver], '4.0'))) \
30
+ or (host['type'] && host['type'] =~ /aio/)
30
31
  # add pe defaults to host
31
32
  add_aio_defaults_on(host)
32
33
  else
@@ -508,8 +509,9 @@ module Beaker
508
509
  def create_agent_specified_arrays(hosts)
509
510
  hosts_agent_only = []
510
511
  hosts_not_agent_only = []
512
+ non_agent_only_roles = %w(master database dashboard console frictionless)
511
513
  hosts.each do |host|
512
- if host['roles'] && host['roles'].length == 1 && host['roles'][0] == 'agent'
514
+ if host['roles'].none? {|role| non_agent_only_roles.include?(role) }
513
515
  hosts_agent_only << host
514
516
  else
515
517
  hosts_not_agent_only << host
@@ -89,6 +89,35 @@ module Beaker
89
89
  find_host_with_role :default
90
90
  end
91
91
 
92
+ # Determine if host is not a controller, does not have roles 'master',
93
+ # 'dashboard' or 'database'.
94
+ #
95
+ # @return [Boolean] True if agent-only, false otherwise
96
+ #
97
+ # @example Basic usage
98
+ # if not_controller(host)
99
+ # puts "this host isn't in charge!"
100
+ # end
101
+ #
102
+ def not_controller(host)
103
+ controllers = ['dashboard', 'database', 'master', 'console']
104
+ matched_roles = host['roles'].select { |v| controllers.include?(v) }
105
+ matched_roles.length == 0
106
+ end
107
+
108
+ # Determine if this host is exclusively an agent (only has a single role 'agent')
109
+ #
110
+ #
111
+ # @return [Boolean] True if agent-only, false otherwise
112
+ #
113
+ # @example Basic usage
114
+ # if agent_only(host)
115
+ # puts "this host is ONLY an agent!"
116
+ # end
117
+ def agent_only(host)
118
+ host['roles'].length == 1 && host['roles'].include?('agent')
119
+ end
120
+
92
121
  #Create a new role method for a given arbitrary role name. Makes it possible to be able to run
93
122
  #commands without having to refer to role by String or Symbol. Will not add a new method
94
123
  #definition if the name is already in use.
@@ -5,10 +5,11 @@ end
5
5
  module Mac
6
6
  class Host < Unix::Host
7
7
 
8
- [ 'user', 'group', 'pkg' ].each do |lib|
8
+ [ 'exec', 'user', 'group', 'pkg' ].each do |lib|
9
9
  require "beaker/host/mac/#{lib}"
10
10
  end
11
11
 
12
+ include Mac::Exec
12
13
  include Mac::User
13
14
  include Mac::Group
14
15
  include Mac::Pkg
@@ -0,0 +1,8 @@
1
+ module Mac::Exec
2
+ include Beaker::CommandFactory
3
+
4
+ def touch(file, abs=true)
5
+ (abs ? '/usr/bin/touch' : 'touch') + " #{file}"
6
+ end
7
+
8
+ end
@@ -268,23 +268,27 @@ module Beaker
268
268
  raise RuntimeError, "Image not found: #{image_id}"
269
269
  end
270
270
 
271
+ @logger.notify("Image Storage Type: #{image.root_device_type}")
272
+
271
273
  # Transform the images block_device_mappings output into a format
272
274
  # ready for a create.
273
- orig_bdm = image.block_device_mappings()
274
- @logger.notify("aws-sdk: Image block_device_mappings: #{orig_bdm.to_hash}")
275
275
  block_device_mappings = []
276
- orig_bdm.each do |device_name, rest|
277
- block_device_mappings << {
278
- :device_name => device_name,
279
- :ebs => {
280
- # Change the default size of the root volume.
281
- :volume_size => host['volume_size'] || rest[:volume_size],
282
- # This is required to override the images default for
283
- # delete_on_termination, forcing all volumes to be deleted once the
284
- # instance is terminated.
285
- :delete_on_termination => true,
276
+ if image.root_device_type == :ebs
277
+ orig_bdm = image.block_device_mappings()
278
+ @logger.notify("aws-sdk: Image block_device_mappings: #{orig_bdm.to_hash}")
279
+ orig_bdm.each do |device_name, rest|
280
+ block_device_mappings << {
281
+ :device_name => device_name,
282
+ :ebs => {
283
+ # Change the default size of the root volume.
284
+ :volume_size => host['volume_size'] || rest[:volume_size],
285
+ # This is required to override the images default for
286
+ # delete_on_termination, forcing all volumes to be deleted once the
287
+ # instance is terminated.
288
+ :delete_on_termination => true,
289
+ }
286
290
  }
287
- }
291
+ end
288
292
  end
289
293
 
290
294
  security_group = ensure_group(vpc || region, Beaker::EC2Helper.amiports(host))
@@ -304,9 +308,9 @@ module Beaker
304
308
  :instance_type => amisize,
305
309
  :disable_api_termination => false,
306
310
  :instance_initiated_shutdown_behavior => "terminate",
307
- :block_device_mappings => block_device_mappings,
308
311
  :subnet => subnet_id,
309
312
  }
313
+ config[:block_device_mappings] = block_device_mappings if image.root_device_type == :ebs
310
314
  region.instances.create(config)
311
315
  end
312
316
 
@@ -191,7 +191,7 @@ module Beaker
191
191
  end
192
192
 
193
193
  opts.on('--version', 'Report currently running version of beaker' ) do
194
- @cmd_options[:version] = true
194
+ @cmd_options[:beaker_version_print] = true
195
195
  end
196
196
 
197
197
  opts.on('--parse-only', 'Display beaker parsed options and exit' ) do
@@ -190,7 +190,7 @@ module Beaker
190
190
  # overwrite defaults with command line and file options
191
191
  @options = @options.merge(cmd_line_and_file_options)
192
192
 
193
- if not @options[:help] and not @options[:version]
193
+ if not @options[:help] and not @options[:beaker_version_print]
194
194
  #read the hosts file that contains the node configuration and hypervisor info
195
195
  hosts_options = Beaker::Options::HostsFileParser.parse_hosts_file(@options[:hosts_file])
196
196
 
@@ -1,5 +1,5 @@
1
1
  module Beaker
2
2
  module Version
3
- STRING = '2.16.0'
3
+ STRING = '2.17.0'
4
4
  end
5
5
  end
@@ -75,11 +75,19 @@ describe ClassMixedWithDSLInstallUtils do
75
75
  subject.configure_foss_defaults_on( hosts )
76
76
  end
77
77
 
78
- it 'uses aio paths for hosts of version >= 4.0' do
78
+ it 'uses aio paths for hosts of version >= 4.0, except for master/database/dashboard' do
79
+ agents = []
80
+ not_agents = []
79
81
  hosts.each do |host|
80
82
  host[:version] = '4.0'
83
+ if subject.agent_only(host)
84
+ agents << host
85
+ else
86
+ not_agents << host
87
+ end
81
88
  end
82
- expect(subject).to receive(:add_aio_defaults_on).exactly(hosts.length).times
89
+ expect(subject).to receive(:add_aio_defaults_on).exactly(agents.length).times
90
+ expect(subject).to receive(:add_foss_defaults_on).exactly(not_agents.length).times
83
91
  expect(subject).to receive(:add_puppet_paths_on).exactly(hosts.length).times
84
92
 
85
93
  subject.configure_foss_defaults_on( hosts )
@@ -52,7 +52,7 @@ describe ClassMixedWithDSLInstallUtils do
52
52
  subject.configure_pe_defaults_on( hosts )
53
53
  end
54
54
 
55
- it 'uses foss paths for hosts of type pe' do
55
+ it 'uses pe paths for hosts of type pe' do
56
56
  hosts.each do |host|
57
57
  host[:type] = 'pe'
58
58
  end
@@ -69,11 +69,19 @@ describe ClassMixedWithDSLInstallUtils do
69
69
  subject.configure_pe_defaults_on( hosts )
70
70
  end
71
71
 
72
- it 'uses aio paths for hosts of version >= 4.0' do
72
+ it 'uses aio paths for hosts of version >= 4.0, except for master/dashboard/database' do
73
+ agents = []
74
+ not_agents = []
73
75
  hosts.each do |host|
74
76
  host[:pe_ver] = '4.0'
77
+ if subject.agent_only(host)
78
+ agents << host
79
+ else
80
+ not_agents << host
81
+ end
75
82
  end
76
- expect(subject).to receive(:add_aio_defaults_on).exactly(hosts.length).times
83
+ expect(subject).to receive(:add_aio_defaults_on).exactly(agents.length).times
84
+ expect(subject).to receive(:add_pe_defaults_on).exactly(not_agents.length).times
77
85
  expect(subject).to receive(:add_puppet_paths_on).exactly(hosts.length).times
78
86
 
79
87
  subject.configure_pe_defaults_on( hosts )
@@ -458,7 +466,11 @@ describe ClassMixedWithDSLInstallUtils do
458
466
  expect( subject ).to receive( :install_puppet_agent_pe_promoted_repo_on ).with( hosts[2],
459
467
  {:puppet_agent_version=>nil, :puppet_agent_sha=>nil, :pe_ver=>nil, :puppet_collection=>nil} ).once
460
468
  hosts.each do |host|
461
- expect( subject ).to receive( :add_aio_defaults_on ).with( host ).once
469
+ if subject.agent_only(host)
470
+ expect( subject ).to receive( :add_aio_defaults_on ).with( host ).once
471
+ else
472
+ expect( subject ).to receive( :add_pe_defaults_on ).with( host ).once
473
+ end
462
474
  expect( subject ).to receive( :sign_certificate_for ).with( host ).once
463
475
  expect( subject ).to receive( :stop_agent_on ).with( host ).once
464
476
  expect( subject ).to receive( :on ).with( host, /puppet agent -t/, :acceptable_exit_codes => [0,2] ).once
@@ -651,4 +663,87 @@ describe ClassMixedWithDSLInstallUtils do
651
663
 
652
664
  end
653
665
 
666
+ describe 'create_agent_specified_arrays' do
667
+ let(:master) { make_host( 'master', { :platform => 'linux',
668
+ :pe_ver => '4.0',
669
+ :roles => ['master', 'agent']})}
670
+ let(:db) { make_host( 'db', { :platform => 'linux',
671
+ :pe_ver => '4.0',
672
+ :roles => ['database', 'agent']})}
673
+ let(:console) { make_host( 'console', { :platform => 'linux',
674
+ :pe_ver => '4.0',
675
+ :roles => ['dashboard', 'agent']})}
676
+ let(:monolith) { make_host( 'monolith', { :platform => 'linux',
677
+ :pe_ver => '4.0',
678
+ :roles => %w(master dashboard database)})}
679
+ let(:frictionless) { make_host( 'frictionless', { :platform => 'linux',
680
+ :pe_ver => '4.0',
681
+ :roles => ['agent', 'frictionless']})}
682
+ let(:agent1) { make_host( 'agent1', { :platform => 'linux',
683
+ :pe_ver => '4.0',
684
+ :roles => ['agent']})}
685
+ let(:agent2) { make_host( 'agent2', { :platform => 'linux',
686
+ :pe_ver => '4.0',
687
+ :roles => ['agent']})}
688
+ let(:default_agent) { make_host( 'default', { :platform => 'linux',
689
+ :pe_ver => '4.0',
690
+ :roles => ['default', 'agent']})}
691
+ let(:masterless) { make_host( 'masterless', { :platform => 'linux',
692
+ :pe_ver => '4.0',
693
+ :roles => ['agent', 'masterless']})}
694
+ let(:compiler) { make_host( 'compiler', { :platform => 'linux',
695
+ :pe_ver => '4.0',
696
+ :roles => ['agent', 'compile_master']})}
697
+
698
+ it 'sorts hosts with common PE roles' do
699
+ these_hosts = [master, db, console, agent1, frictionless]
700
+ agent_only, non_agent = subject.create_agent_specified_arrays(these_hosts)
701
+ expect(agent_only.length).to be 1
702
+ expect(agent_only).to include(agent1)
703
+ expect(non_agent.length).to be 4
704
+ expect(non_agent).to include(master)
705
+ expect(non_agent).to include(db)
706
+ expect(non_agent).to include(console)
707
+ expect(non_agent).to include(frictionless)
708
+ end
709
+
710
+ # Possibly needed for NetDev and Scale testing
711
+ it 'defaults to classifying custom roles as "agent only"' do
712
+ these_hosts = [monolith, compiler, agent1, agent2]
713
+ agent_only, non_agent = subject.create_agent_specified_arrays(these_hosts)
714
+ expect(agent_only.length).to be 3
715
+ expect(agent_only).to include(agent1)
716
+ expect(agent_only).to include(agent2)
717
+ expect(agent_only).to include(compiler)
718
+ expect(non_agent.length).to be 1
719
+ expect(non_agent).to include(monolith)
720
+ end
721
+
722
+ # Most common form of module testing
723
+ it 'allows a puppet-agent host to be the default test target' do
724
+ these_hosts = [monolith, default_agent]
725
+ agent_only, non_agent = subject.create_agent_specified_arrays(these_hosts)
726
+ expect(agent_only.length).to be 1
727
+ expect(agent_only).to include(default_agent)
728
+ expect(non_agent.length).to be 1
729
+ expect(non_agent).to include(monolith)
730
+ end
731
+
732
+ # Preferred module on commit scenario
733
+ it 'handles masterless scenarios' do
734
+ these_hosts = [masterless]
735
+ agent_only, non_agent = subject.create_agent_specified_arrays(these_hosts)
736
+ expect(agent_only.length).to be 1
737
+ expect(non_agent).to be_empty
738
+ end
739
+
740
+ # IIRC, this is the basic PE integration smoke test
741
+ it 'handles agent-only-less scenarios' do
742
+ these_hosts = [monolith, frictionless]
743
+ agent_only, non_agent = subject.create_agent_specified_arrays(these_hosts)
744
+ expect(agent_only).to be_empty
745
+ expect(non_agent.length).to be 2
746
+ end
747
+ end
748
+
654
749
  end
@@ -96,6 +96,25 @@ describe ClassMixedWithDSLRoles do
96
96
  expect( subject.database ).to be_nil
97
97
  end
98
98
  end
99
+ describe '#not_controller' do
100
+ it 'returns true when a host does not have the roles master/database/dashboard' do
101
+ expect( subject.not_controller(agent1) ).to be == true
102
+ end
103
+ it 'returns false when a host has one of the roles master/database/dashboard' do
104
+ expect( subject.not_controller(a_and_dash) ).to be == false
105
+ end
106
+ end
107
+ describe '#agent_only' do
108
+ it 'returns true when a host has the single role agent' do
109
+ expect( subject.agent_only(agent1) ).to be == true
110
+ end
111
+ it 'returns false when a host has more than a single role' do
112
+ expect( subject.agent_only(a_and_dash) ).to be == false
113
+ end
114
+ it 'returns false when a host has the role master' do
115
+ expect( subject.agent_only(master) ).to be == false
116
+ end
117
+ end
99
118
  describe '#default' do
100
119
  it 'returns the default host when one is specified' do
101
120
  @hosts = [ db, agent1, agent2, default, master]
@@ -364,6 +364,24 @@ module Beaker
364
364
 
365
365
  end
366
366
 
367
+ end
368
+
369
+ describe "#touch" do
370
+
371
+ it "generates the right absolute command for a windows host" do
372
+ @platform = 'windows'
373
+ expect( host.touch('touched_file') ).to be == "c:\\\\windows\\\\system32\\\\cmd.exe /c echo. 2> touched_file"
374
+ end
375
+
376
+ it "generates the right absolute command for a unix host" do
377
+ @platform = 'centos'
378
+ expect( host.touch('touched_file') ).to be == "/bin/touch touched_file"
379
+ end
380
+
381
+ it "generates the right absolute command for an osx host" do
382
+ @platform = 'osx'
383
+ expect( host.touch('touched_file') ).to be == "/usr/bin/touch touched_file"
384
+ end
367
385
 
368
386
  end
369
387
 
@@ -7,7 +7,7 @@ module Beaker
7
7
  let(:parser) {Beaker::Options::CommandLineParser.new}
8
8
  let(:test_opts) {["-h", "vcloud.cfg", "--debug", "--tests", "test.rb", "--help"]}
9
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", "--tag", "1,2,3", "--exclude-tag", "4,5,6", "--xml-time-order"]}
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, :tag_includes => "1,2,3", :tag_excludes => "4,5,6", :xml_time_enabled => true}}
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, :beaker_version_print=>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, :tag_includes => "1,2,3", :tag_excludes => "4,5,6", :xml_time_enabled => true}}
11
11
  let(:validate_true) {["--validate"]}
12
12
  let(:validate_false) {["--no-validate"]}
13
13
  let(:configure_true) {['--configure']}
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.16.0
4
+ version: 2.17.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-07-07 00:00:00.000000000 Z
11
+ date: 2015-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -448,6 +448,7 @@ files:
448
448
  - lib/beaker/host/freebsd.rb
449
449
  - lib/beaker/host/freebsd/exec.rb
450
450
  - lib/beaker/host/mac.rb
451
+ - lib/beaker/host/mac/exec.rb
451
452
  - lib/beaker/host/mac/group.rb
452
453
  - lib/beaker/host/mac/pkg.rb
453
454
  - lib/beaker/host/mac/user.rb