beaker 2.17.0 → 2.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/HISTORY.md +79 -2
- data/acceptance/tests/base/host.rb +19 -0
- data/lib/beaker/dsl/install_utils/aio_defaults.rb +1 -0
- data/lib/beaker/dsl/install_utils/foss_utils.rb +1 -1
- data/lib/beaker/dsl/install_utils/pe_defaults.rb +1 -1
- data/lib/beaker/dsl/install_utils/pe_utils.rb +10 -4
- data/lib/beaker/dsl/roles.rb +25 -3
- data/lib/beaker/host/unix/exec.rb +3 -3
- data/lib/beaker/hypervisor/openstack.rb +74 -2
- data/lib/beaker/version.rb +1 -1
- data/spec/beaker/dsl/install_utils/foss_utils_spec.rb +1 -0
- data/spec/beaker/dsl/install_utils/pe_utils_spec.rb +59 -11
- data/spec/beaker/dsl/roles_spec.rb +32 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZmM2NTk1MjNkOGFiMGQ2ZDM3MGYxZjcxNDcxNzU1MTliMTAyOWMxMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTlhMDZiNzc1MTAxODg4ODk4OGEzMzA1MmMzZDA0Mzc5NmRlYmRjNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OTZhYzg1Njk2NGJkZGM1NDY5MDAwYTQ5Njg1ZTQ4YzFlNWZlYjdiYWY0NWZm
|
10
|
+
ODRhMjM1NGQxOWFjMmZmMzdiMmQwYzUyMWY4YTlmNGRmYzdlNDM5YTI5OGIw
|
11
|
+
N2Q5ZGNlNzJiNTAzM2EzYjc3NWQzNTU1ZWZmOWY1ZDIyMjM0Y2Y=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzFjMTMyMWI0NWU5ZmIzMmE1NTA5YTRiZjVkNzcwMGRjOWFiMDNiNTZhZDZh
|
14
|
+
YmEzZWJiNmMyMmY4MTllZTZhOTBlMjk3M2Q5ZmFiNWU4MzcwZWE0N2EwMTll
|
15
|
+
NDA1Y2NkYTliYTE2NDczNWJjODE0ZTM0MTdmMmExNjk3NWM0NTE=
|
data/HISTORY.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# default - History
|
2
2
|
## Tags
|
3
|
-
* [LATEST -
|
3
|
+
* [LATEST - 13 Jul, 2015 (268ce21e)](#LATEST)
|
4
|
+
* [2.17.0 - 10 Jul, 2015 (aaac4771)](#2.17.0)
|
4
5
|
* [2.16.0 - 6 Jul, 2015 (b3e76227)](#2.16.0)
|
5
6
|
* [2.15.1 - 1 Jul, 2015 (cd6f0bab)](#2.15.1)
|
6
7
|
* [2.15.0 - 1 Jul, 2015 (07c416fb)](#2.15.0)
|
@@ -86,7 +87,83 @@
|
|
86
87
|
* [pe1.2 - 6 Sep, 2011 (ba3dadd2)](#pe1.2)
|
87
88
|
|
88
89
|
## Details
|
89
|
-
### <a name = "LATEST">LATEST -
|
90
|
+
### <a name = "LATEST">LATEST - 13 Jul, 2015 (268ce21e)
|
91
|
+
|
92
|
+
* (GEM) update beaker version to 2.18.0 (268ce21e)
|
93
|
+
|
94
|
+
* Merge pull request #887 from kevpl/bkr394_aio_mixedinstall (28f9d26d)
|
95
|
+
|
96
|
+
|
97
|
+
```
|
98
|
+
Merge pull request #887 from kevpl/bkr394_aio_mixedinstall
|
99
|
+
|
100
|
+
(BKR-394) added support for 3.8/AIO mixed installations
|
101
|
+
```
|
102
|
+
* Merge pull request #888 from justinstoller/maint/master/BKR-397_use_yum (a76abdd9)
|
103
|
+
|
104
|
+
|
105
|
+
```
|
106
|
+
Merge pull request #888 from justinstoller/maint/master/BKR-397_use_yum
|
107
|
+
|
108
|
+
(BKR-397) Use yum for installing pe promoted puppet-agent
|
109
|
+
```
|
110
|
+
* (BKR-397) Use yum for installing pe promoted puppet-agent (d6d37145)
|
111
|
+
|
112
|
+
|
113
|
+
```
|
114
|
+
(BKR-397) Use yum for installing pe promoted puppet-agent
|
115
|
+
|
116
|
+
Previously we used the rpm command to install a local rpm file. However
|
117
|
+
puppet-agent requires dmidecode for EL platforms and this dependency
|
118
|
+
won't be resolved by using rpm.
|
119
|
+
|
120
|
+
This commit uses yum's localinstal command to install the local rpm file
|
121
|
+
so that dependencies are resolved.
|
122
|
+
```
|
123
|
+
* Merge pull request #858 from spjmurray/openstack_cinder_volumes (f5ecb177)
|
124
|
+
|
125
|
+
|
126
|
+
```
|
127
|
+
Merge pull request #858 from spjmurray/openstack_cinder_volumes
|
128
|
+
|
129
|
+
(BKR-347) Openstack: Add support for cinder attached volumes
|
130
|
+
```
|
131
|
+
* (BKR-394) added support for 3.8/AIO mixed installations (d715cb1d)
|
132
|
+
|
133
|
+
* Merge pull request #881 from anodelman/env-support (788aae5c)
|
134
|
+
|
135
|
+
|
136
|
+
```
|
137
|
+
Merge pull request #881 from anodelman/env-support
|
138
|
+
|
139
|
+
(BKR-387) environment not being preserved between ssh connections...
|
140
|
+
```
|
141
|
+
* (BKR-387) environment not being preserved between ssh connections... (41e64c50)
|
142
|
+
|
143
|
+
|
144
|
+
```
|
145
|
+
(BKR-387) environment not being preserved between ssh connections...
|
146
|
+
|
147
|
+
... on debian
|
148
|
+
|
149
|
+
- mirror the env to /etc/profile.d/beaker_env.sh
|
150
|
+
- add and acceptance test to ensure that environment variables are
|
151
|
+
preserved between ssh connections for a SUT
|
152
|
+
```
|
153
|
+
* (BKR-347) Openstack: Add support for cinder attached volumes (4c2c5f23)
|
154
|
+
|
155
|
+
|
156
|
+
```
|
157
|
+
(BKR-347) Openstack: Add support for cinder attached volumes
|
158
|
+
|
159
|
+
Implement the storage array feature introduced for vagrant virtual box
|
160
|
+
to OpenStack users. Unlike virtual box the bus type is outside of our
|
161
|
+
control. If you need SCSI support this must be attached to the image
|
162
|
+
in glance. How to do this is in the method documentation
|
163
|
+
```
|
164
|
+
### <a name = "2.17.0">2.17.0 - 10 Jul, 2015 (aaac4771)
|
165
|
+
|
166
|
+
* (HISTORY) update beaker history for gem release 2.17.0 (aaac4771)
|
90
167
|
|
91
168
|
* (GEM) update beaker version to 2.17.0 (745d9116)
|
92
169
|
|
@@ -42,6 +42,25 @@ hosts.each do |host|
|
|
42
42
|
assert_match(/TEST=3(;|:)2(;|:)1$/, val, "add_env_var can correctly add env vars")
|
43
43
|
end
|
44
44
|
|
45
|
+
step "#add_env_var : can preserve an environment between ssh connections"
|
46
|
+
hosts.each do |host|
|
47
|
+
host.clear_env_var("test")
|
48
|
+
logger.debug("add TEST=1")
|
49
|
+
host.add_env_var("TEST", "1")
|
50
|
+
logger.debug("add TEST=1 again (shouldn't create duplicate entry)")
|
51
|
+
host.add_env_var("test", "1")
|
52
|
+
logger.debug("add test=2")
|
53
|
+
host.add_env_var("test", "2")
|
54
|
+
logger.debug("ensure that TEST env var has correct setting")
|
55
|
+
logger.debug("add test=3")
|
56
|
+
host.add_env_var("test", "3")
|
57
|
+
logger.debug("close the connection")
|
58
|
+
host.close
|
59
|
+
logger.debug("ensure that TEST env var has correct setting")
|
60
|
+
val = host.get_env_var("test")
|
61
|
+
assert_match(/TEST=3(;|:)2(;|:)1$/, val, "can preserve an environment between ssh connections")
|
62
|
+
end
|
63
|
+
|
45
64
|
step "#delete_env_var : can delete an environment"
|
46
65
|
hosts.each do |host|
|
47
66
|
logger.debug("remove TEST=3")
|
@@ -1143,7 +1143,7 @@ module Beaker
|
|
1143
1143
|
case variant
|
1144
1144
|
when /^(fedora|el|centos|sles)$/
|
1145
1145
|
on host, "tar -zxvf #{onhost_copied_download} -C #{onhost_copy_base}"
|
1146
|
-
on host, "
|
1146
|
+
on host, "yum --nogpgcheck localinstall -y #{onhost_copied_file}"
|
1147
1147
|
when /^(debian|ubuntu|cumulus)$/
|
1148
1148
|
on host, "tar -zxvf #{onhost_copied_download} -C #{onhost_copy_base}"
|
1149
1149
|
on host, "dpkg -i --force-all #{onhost_copied_file}"
|
@@ -32,7 +32,7 @@ module Beaker
|
|
32
32
|
'puppetbin' => '/opt/puppet/bin/puppet',
|
33
33
|
'puppetbindir' => '/opt/puppet/bin',
|
34
34
|
'puppetsbindir' => '/opt/puppet/sbin',
|
35
|
-
'privatebindir' => '/opt/
|
35
|
+
'privatebindir' => '/opt/puppet/bin',
|
36
36
|
'puppetvardir' => '/var/opt/lib/pe-puppet',
|
37
37
|
'hieradatadir' => '/var/lib/hiera',
|
38
38
|
'hieraconf' => '/etc/puppetlabs/puppet/hiera.yaml',
|
@@ -26,9 +26,7 @@ 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
|
30
|
-
or (host['type'] && host['type'] =~ /aio/)
|
31
|
-
# add pe defaults to host
|
29
|
+
if host[:pe_ver] && aio_version?(host) or (host['type'] && host['type'] =~ /aio/)
|
32
30
|
add_aio_defaults_on(host)
|
33
31
|
else
|
34
32
|
add_pe_defaults_on(host)
|
@@ -502,6 +500,10 @@ module Beaker
|
|
502
500
|
# @note should only be called against versions 4.0+, as this method
|
503
501
|
# assumes AIO packages will be required.
|
504
502
|
#
|
503
|
+
# @note agent_only hosts with the :pe_ver setting < 4.0 will not be
|
504
|
+
# included in the agent_only array, as AIO install can only happen
|
505
|
+
# in versions > 4.0
|
506
|
+
#
|
505
507
|
# @api private
|
506
508
|
# @return [Array<Host>, Array<Host>]
|
507
509
|
# the array of hosts to do an agent_only install on and
|
@@ -512,7 +514,11 @@ module Beaker
|
|
512
514
|
non_agent_only_roles = %w(master database dashboard console frictionless)
|
513
515
|
hosts.each do |host|
|
514
516
|
if host['roles'].none? {|role| non_agent_only_roles.include?(role) }
|
515
|
-
|
517
|
+
if !aio_version?(host)
|
518
|
+
hosts_not_agent_only << host
|
519
|
+
else
|
520
|
+
hosts_agent_only << host
|
521
|
+
end
|
516
522
|
else
|
517
523
|
hosts_not_agent_only << host
|
518
524
|
end
|
data/lib/beaker/dsl/roles.rb
CHANGED
@@ -107,15 +107,37 @@ module Beaker
|
|
107
107
|
|
108
108
|
# Determine if this host is exclusively an agent (only has a single role 'agent')
|
109
109
|
#
|
110
|
-
#
|
111
|
-
# @return [Boolean] True if agent-only, false otherwise
|
110
|
+
# @param [Host] host Beaker host to check
|
112
111
|
#
|
113
112
|
# @example Basic usage
|
114
113
|
# if agent_only(host)
|
115
114
|
# puts "this host is ONLY an agent!"
|
116
115
|
# end
|
116
|
+
#
|
117
|
+
# @return [Boolean] True if agent-only, false otherwise
|
117
118
|
def agent_only(host)
|
118
|
-
|
119
|
+
host['roles'].length == 1 && host['roles'].include?('agent')
|
120
|
+
end
|
121
|
+
|
122
|
+
# Determine whether a host has an AIO version or not. If a host :pe_ver
|
123
|
+
# is not specified, then it is open-ended, and as such, can be an AIO
|
124
|
+
# version depending on the context.
|
125
|
+
#
|
126
|
+
# @note aio version is just a base-line condition. If you want to check
|
127
|
+
# that a host is an aio agent, refer to {#aio_agent?}.
|
128
|
+
#
|
129
|
+
# @return [Boolean] whether or not a host is AIO-capable
|
130
|
+
def aio_version?(host)
|
131
|
+
return !( host[:pe_ver] && version_is_less(host[:pe_ver], '4.0') )
|
132
|
+
end
|
133
|
+
|
134
|
+
# Determine if the host is an AIO agent
|
135
|
+
#
|
136
|
+
# @param [Host] host Beaker host to check
|
137
|
+
#
|
138
|
+
# @return [Boolean] whether this host is an AIO agent or not
|
139
|
+
def aio_agent?(host)
|
140
|
+
aio_version?(host) && agent_only(host)
|
119
141
|
end
|
120
142
|
|
121
143
|
#Create a new role method for a given arbitrary role name. Makes it possible to be able to run
|
@@ -70,10 +70,10 @@ module Unix::Exec
|
|
70
70
|
end
|
71
71
|
|
72
72
|
# Converts the provided environment file to a new shell script in /etc/profile.d, then sources that file.
|
73
|
-
# This is for sles based hosts.
|
73
|
+
# This is for sles and debian based hosts.
|
74
74
|
# @param [String] env_file The ssh environment file to read from
|
75
75
|
def mirror_env_to_profile_d env_file
|
76
|
-
if self[:platform] =~ /sles
|
76
|
+
if self[:platform] =~ /sles-|debian/
|
77
77
|
@logger.debug("mirroring environment to /etc/profile.d on sles platform host")
|
78
78
|
cur_env = exec(Beaker::Command.new("cat #{env_file}")).stdout
|
79
79
|
shell_env = ''
|
@@ -88,7 +88,7 @@ module Unix::Exec
|
|
88
88
|
exec(Beaker::Command.new("source #{self[:profile_d_env_file]}"))
|
89
89
|
else
|
90
90
|
#noop
|
91
|
-
@logger.debug("will not mirror environment to /etc/profile.d on non-sles platform host")
|
91
|
+
@logger.debug("will not mirror environment to /etc/profile.d on non-sles/debian platform host")
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
@@ -59,9 +59,9 @@ module Beaker
|
|
59
59
|
@network_client ||= Fog::Network.new(networkoptionhash)
|
60
60
|
|
61
61
|
if not @network_client
|
62
|
-
|
63
62
|
raise "Unable to create OpenStack Network instance (api_key: #{@options[:openstack_api_key]}, username: #{@options[:openstack_username]}, auth_url: #{@options[:openstack_auth_url]}, tenant: #{@options[:openstack_tenant]})"
|
64
|
-
|
63
|
+
end
|
64
|
+
|
65
65
|
end
|
66
66
|
|
67
67
|
#Provided a flavor name return the OpenStack id for that flavor
|
@@ -88,6 +88,75 @@ module Beaker
|
|
88
88
|
@network_client.networks.find { |x| x.name == n } || raise("Couldn't find network: #{n}")
|
89
89
|
end
|
90
90
|
|
91
|
+
# Create a volume client on request
|
92
|
+
# @return [Fog::OpenStack::Volume] OpenStack volume client
|
93
|
+
def volume_client_create
|
94
|
+
options = {
|
95
|
+
:provider => :openstack,
|
96
|
+
:openstack_api_key => @options[:openstack_api_key],
|
97
|
+
:openstack_username => @options[:openstack_username],
|
98
|
+
:openstack_auth_url => @options[:openstack_auth_url],
|
99
|
+
:openstack_tenant => @options[:openstack_tenant],
|
100
|
+
:openstack_region => @options[:openstack_region],
|
101
|
+
}
|
102
|
+
@volume_client ||= Fog::Volume.new(options)
|
103
|
+
unless @volume_client
|
104
|
+
raise "Unable to create OpenStack Volume instance"\
|
105
|
+
" (api_key: #{@options[:openstack_api_key]},"\
|
106
|
+
" username: #{@options[:openstack_username]},"\
|
107
|
+
" auth_url: #{@options[:openstack_auth_url]},"\
|
108
|
+
" tenant: #{@options[:openstack_tenant]})"
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
# Create and attach dynamic volumes
|
113
|
+
#
|
114
|
+
# Creates an array of volumes and attaches them to the current host.
|
115
|
+
# The host bus type is determined by the image type, so by default
|
116
|
+
# devices appear as /dev/vdb, /dev/vdc etc. Setting the glance
|
117
|
+
# properties hw_disk_bus=scsi, hw_scsi_model=virtio-scsi will present
|
118
|
+
# them as /dev/sdb, /dev/sdc (or 2:0:0:1, 2:0:0:2 in SCSI addresses)
|
119
|
+
#
|
120
|
+
# @param host [Hash] thet current host defined in the nodeset
|
121
|
+
# @param vm [Fog::Compute::OpenStack::Server] the server to attach to
|
122
|
+
def provision_storage host, vm
|
123
|
+
if host['volumes']
|
124
|
+
# Lazily create the volume client if needed
|
125
|
+
volume_client_create
|
126
|
+
host['volumes'].keys.each_with_index do |volume, index|
|
127
|
+
@logger.debug "Creating volume #{volume} for OpenStack host #{host.name}"
|
128
|
+
|
129
|
+
# The node defintion file defines volume sizes in MB (due to precedent
|
130
|
+
# with the vagrant virtualbox implementation) however OpenStack requires
|
131
|
+
# this translating into GB
|
132
|
+
openstack_size = host['volumes'][volume]['size'].to_i / 1000
|
133
|
+
|
134
|
+
# Create the volume and wait for it to become available
|
135
|
+
vol = @volume_client.volumes.create(
|
136
|
+
:size => openstack_size,
|
137
|
+
:display_name => volume,
|
138
|
+
:description => "Beaker volume: host=#{host.name} volume=#{volume}",
|
139
|
+
)
|
140
|
+
vol.wait_for { ready? }
|
141
|
+
|
142
|
+
# Fog needs a device name to attach as, so invent one. The guest
|
143
|
+
# doesn't pay any attention to this
|
144
|
+
device = "/dev/vd#{('b'.ord + index).chr}"
|
145
|
+
vm.attach_volume(vol.id, device)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
# Detach and delete guest volumes
|
151
|
+
# @param vm [Fog::Compute::OpenStack::Server] the server to detach from
|
152
|
+
def cleanup_storage vm
|
153
|
+
vm.volumes.each do |vol|
|
154
|
+
@logger.debug "Deleting volume #{vol.name} for OpenStack host #{vm.name}"
|
155
|
+
vm.detach_volume(vol.id)
|
156
|
+
vol.destroy
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
91
160
|
#Create new instances in OpenStack
|
92
161
|
def provision
|
93
162
|
@logger.notify "Provisioning OpenStack"
|
@@ -171,6 +240,8 @@ module Beaker
|
|
171
240
|
|
172
241
|
#enable root if user is not root
|
173
242
|
enable_root(host)
|
243
|
+
|
244
|
+
provision_storage(host, vm)
|
174
245
|
end
|
175
246
|
end
|
176
247
|
|
@@ -178,6 +249,7 @@ module Beaker
|
|
178
249
|
def cleanup
|
179
250
|
@logger.notify "Cleaning up OpenStack"
|
180
251
|
@vms.each do |vm|
|
252
|
+
cleanup_storage(vm)
|
181
253
|
@logger.debug "Release floating IPs for OpenStack host #{vm.name}"
|
182
254
|
floating_ips = vm.all_addresses # fetch and release its floating IPs
|
183
255
|
floating_ips.each do |address|
|
data/lib/beaker/version.rb
CHANGED
@@ -69,19 +69,11 @@ 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
|
73
|
-
agents = []
|
74
|
-
not_agents = []
|
72
|
+
it 'uses aio paths for hosts of version >= 4.0' do
|
75
73
|
hosts.each do |host|
|
76
74
|
host[:pe_ver] = '4.0'
|
77
|
-
if subject.agent_only(host)
|
78
|
-
agents << host
|
79
|
-
else
|
80
|
-
not_agents << host
|
81
75
|
end
|
82
|
-
|
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
|
76
|
+
expect(subject).to receive(:add_aio_defaults_on).exactly(hosts.length).times
|
85
77
|
expect(subject).to receive(:add_puppet_paths_on).exactly(hosts.length).times
|
86
78
|
|
87
79
|
subject.configure_pe_defaults_on( hosts )
|
@@ -466,7 +458,62 @@ describe ClassMixedWithDSLInstallUtils do
|
|
466
458
|
expect( subject ).to receive( :install_puppet_agent_pe_promoted_repo_on ).with( hosts[2],
|
467
459
|
{:puppet_agent_version=>nil, :puppet_agent_sha=>nil, :pe_ver=>nil, :puppet_collection=>nil} ).once
|
468
460
|
hosts.each do |host|
|
469
|
-
|
461
|
+
expect( subject ).to receive( :add_aio_defaults_on ).with( host ).once
|
462
|
+
expect( subject ).to receive( :sign_certificate_for ).with( host ).once
|
463
|
+
expect( subject ).to receive( :stop_agent_on ).with( host ).once
|
464
|
+
expect( subject ).to receive( :on ).with( host, /puppet agent -t/, :acceptable_exit_codes => [0,2] ).once
|
465
|
+
end
|
466
|
+
#wait for puppetdb to start
|
467
|
+
expect( subject ).to receive( :sleep_until_puppetdb_started ).with( hosts[0] ).once#wait for all hosts to appear in the dashboard
|
468
|
+
#run puppet agent now that installation is complete
|
469
|
+
expect( subject ).to receive( :on ).with( hosts, /puppet agent/, :acceptable_exit_codes => [0,2] ).once
|
470
|
+
subject.do_install( hosts, opts )
|
471
|
+
end
|
472
|
+
|
473
|
+
it 'can perform a 4/3 mixed installation with AIO and -non agents' do
|
474
|
+
hosts = make_hosts({
|
475
|
+
:pe_ver => '4.0',
|
476
|
+
:roles => ['agent'],
|
477
|
+
}, 3)
|
478
|
+
hosts[0][:roles] = ['master', 'database', 'dashboard']
|
479
|
+
hosts[1][:platform] = 'windows'
|
480
|
+
hosts[2][:platform] = Beaker::Platform.new('el-6-x86_64')
|
481
|
+
hosts[2][:pe_ver] = '3.8'
|
482
|
+
|
483
|
+
allow( subject ).to receive( :hosts ).and_return( hosts )
|
484
|
+
allow( subject ).to receive( :options ).and_return(Beaker::Options::Presets.new.presets)
|
485
|
+
allow( subject ).to receive( :on ).and_return( Beaker::Result.new( {}, '' ) )
|
486
|
+
allow( subject ).to receive( :fetch_pe ).and_return( true )
|
487
|
+
allow( subject ).to receive( :create_remote_file ).and_return( true )
|
488
|
+
allow( subject ).to receive( :sign_certificate_for ).and_return( true )
|
489
|
+
allow( subject ).to receive( :stop_agent_on ).and_return( true )
|
490
|
+
allow( subject ).to receive( :sleep_until_puppetdb_started ).and_return( true )
|
491
|
+
allow( subject ).to receive( :max_version ).with(anything, '3.8').and_return('4.0')
|
492
|
+
allow( subject ).to receive( :version_is_less ).with('4.0', '4.0').and_return( false )
|
493
|
+
allow( subject ).to receive( :version_is_less ).with('4.0', '3.4').and_return( false )
|
494
|
+
allow( subject ).to receive( :version_is_less ).with('4.0', '3.0').and_return( false )
|
495
|
+
allow( subject ).to receive( :version_is_less ).with('3.99', '4.0').and_return( true )
|
496
|
+
allow( subject ).to receive( :version_is_less ).with('3.8', '4.0').and_return( true )
|
497
|
+
# pe_ver is only set on the hosts for this test, not the opt
|
498
|
+
allow( subject ).to receive( :version_is_less ).with('4.0', '3.99').and_return( true )
|
499
|
+
allow( subject ).to receive( :wait_for_host_in_dashboard ).and_return( true )
|
500
|
+
allow( subject ).to receive( :puppet_agent ) do |arg|
|
501
|
+
"puppet agent #{arg}"
|
502
|
+
end
|
503
|
+
allow( subject ).to receive( :puppet ) do |arg|
|
504
|
+
"puppet #{arg}"
|
505
|
+
end
|
506
|
+
|
507
|
+
allow( subject ).to receive( :hosts ).and_return( hosts )
|
508
|
+
#create answers file per-host, except windows
|
509
|
+
expect( subject ).to receive( :create_remote_file ).with( hosts[0], /answers/, /q/ ).once
|
510
|
+
#run installer on all hosts
|
511
|
+
expect( subject ).to receive( :on ).with( hosts[0], /puppet-enterprise-installer/ ).once
|
512
|
+
expect( subject ).to receive( :install_puppet_agent_pe_promoted_repo_on ).with( hosts[1],
|
513
|
+
{:puppet_agent_version=>nil, :puppet_agent_sha=>nil, :pe_ver=>nil, :puppet_collection=>nil} ).once
|
514
|
+
expect( subject ).to receive( :on ).with( hosts[2], /puppet-enterprise-installer/ ).once
|
515
|
+
hosts.each do |host|
|
516
|
+
if subject.aio_version?(host)
|
470
517
|
expect( subject ).to receive( :add_aio_defaults_on ).with( host ).once
|
471
518
|
else
|
472
519
|
expect( subject ).to receive( :add_pe_defaults_on ).with( host ).once
|
@@ -481,6 +528,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
481
528
|
expect( subject ).to receive( :on ).with( hosts, /puppet agent/, :acceptable_exit_codes => [0,2] ).once
|
482
529
|
subject.do_install( hosts, opts )
|
483
530
|
end
|
531
|
+
|
484
532
|
end
|
485
533
|
|
486
534
|
describe 'do_higgs_install' do
|
@@ -115,6 +115,38 @@ describe ClassMixedWithDSLRoles do
|
|
115
115
|
expect( subject.agent_only(master) ).to be == false
|
116
116
|
end
|
117
117
|
end
|
118
|
+
describe '#aio_version?' do
|
119
|
+
it 'returns true if the host doesn\'t have a :pe_ver' do
|
120
|
+
agent1[:pe_ver] = nil
|
121
|
+
expect( subject.aio_version?(agent1) ).to be === true
|
122
|
+
end
|
123
|
+
it 'returns false if the host :pe_ver is set < 4.0' do
|
124
|
+
agent1[:pe_ver] = '3.8'
|
125
|
+
expect( subject.aio_version?(agent1) ).to be === false
|
126
|
+
end
|
127
|
+
it 'returns true if the host :pe_ver is 4.0' do
|
128
|
+
agent1[:pe_ver] = '4.0'
|
129
|
+
expect( subject.aio_version?(agent1) ).to be === true
|
130
|
+
end
|
131
|
+
it 'returns true if the host :pe_ver is 2015.5' do
|
132
|
+
agent1[:pe_ver] = '2015.5'
|
133
|
+
expect( subject.aio_version?(agent1) ).to be === true
|
134
|
+
end
|
135
|
+
end
|
136
|
+
describe '#aio_agent?' do
|
137
|
+
it 'returns false if agent_only check doesn\'t pass' do
|
138
|
+
agent1[:roles] = ['agent', 'headless']
|
139
|
+
expect( subject.aio_agent?(agent1) ).to be === false
|
140
|
+
end
|
141
|
+
it 'returns false if aio_capable? check doesn\'t pass' do
|
142
|
+
agent1[:pe_ver] = '3.8'
|
143
|
+
expect( subject.aio_agent?(agent1) ).to be === false
|
144
|
+
end
|
145
|
+
it 'returns true if both checks pass' do
|
146
|
+
agent1[:pe_ver] = '4.0'
|
147
|
+
expect( subject.aio_agent?(agent1) ).to be === true
|
148
|
+
end
|
149
|
+
end
|
118
150
|
describe '#default' do
|
119
151
|
it 'returns the default host when one is specified' do
|
120
152
|
@hosts = [ db, agent1, agent2, default, master]
|
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.
|
4
|
+
version: 2.18.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-
|
11
|
+
date: 2015-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|