beaker 2.20.0 → 2.21.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 +223 -2
- data/LICENSE +1 -1
- data/acceptance/fixtures/package/deb/pl-puppetserver-latest-lucid.list +1 -0
- data/acceptance/fixtures/package/deb/pl-puppetserver-latest-precise.list +1 -0
- data/acceptance/fixtures/package/deb/pl-puppetserver-latest-squeeze.list +1 -0
- data/acceptance/fixtures/package/deb/pl-puppetserver-latest-trusty.list +1 -0
- data/acceptance/fixtures/package/deb/pl-puppetserver-latest-vivid.list +1 -0
- data/acceptance/fixtures/package/deb/pl-puppetserver-latest-wheezy.list +1 -0
- data/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-el-6-i386.repo +6 -0
- data/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-el-6-x86_64.repo +6 -0
- data/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-el-7-i386.repo +6 -0
- data/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-el-7-x86_64.repo +6 -0
- data/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-20-i386.repo +6 -0
- data/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-20-x86_64.repo +6 -0
- data/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-21-i386.repo +6 -0
- data/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-21-x86_64.repo +6 -0
- data/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-22-i386.repo +6 -0
- data/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-22-x86_64.repo +6 -0
- data/acceptance/pre_suite/puppet_git/install.rb +1 -0
- data/acceptance/tests/base/packages.rb +74 -0
- data/acceptance/tests/base/packages_unix.rb +50 -0
- data/acceptance/tests/{foss_utils → dsl/install_utils}/clone_git_repo_on.rb +3 -2
- data/lib/beaker/dsl/install_utils/aio_defaults.rb +11 -2
- data/lib/beaker/dsl/install_utils/module_utils.rb +4 -0
- data/lib/beaker/dsl/install_utils/puppet_utils.rb +39 -13
- data/lib/beaker/host/pswindows/exec.rb +8 -0
- data/lib/beaker/host/unix/exec.rb +1 -0
- data/lib/beaker/host/unix/pkg.rb +2 -14
- data/lib/beaker/host/windows/exec.rb +1 -1
- data/lib/beaker/host_prebuilt_steps.rb +11 -0
- data/lib/beaker/hypervisor/openstack.rb +3 -0
- data/lib/beaker/version.rb +1 -1
- data/spec/beaker/dsl/install_utils/module_utils_spec.rb +1 -1
- data/spec/beaker/host/windows/exec_spec.rb +5 -4
- metadata +21 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Y2I5OGQ5MGE4YzNkOTJjZWEyYTdkNGY0NjA3ZDJkNmExNmYwMjNjYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODFkYTk5MzgxNzc3MjZjMWNhMjA3NjBjYjhjYjhmNjQxYzNjZDZjNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZGM5NDBkMTA3MDAxMWJjMTI1NWQyOTlhOWUzYjUyNDhhMGM0N2QyMjdlZjAw
|
10
|
+
MGM0MDMxY2M1MDkxNmE4ZWM4YTY5MGNmYjJkMDljNjJjMjM3MzhiNjMwYzBj
|
11
|
+
YjYxZDNkY2VlNmUwN2IyYzA1YTk4ZTZjYWUzOWNlMTlkMzIwM2E=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Y2E5YTZiZGVhMjdmYmEwZmE4OTYxM2EyMzU3NzY0MzRiZTc4NzFkYTJiMDU1
|
14
|
+
YzlkZjRjYTZhNGZlMDI3YmRiNWYzZDk2YzdiNWY2NzZiYTQyNjY4YzM3OTdk
|
15
|
+
NTc5ODM2Yzg1ZjVmNGM0MmFjZjFiMjBhYWM4NWUzZDEyN2RkZWQ=
|
data/HISTORY.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# default - History
|
2
2
|
## Tags
|
3
|
-
* [LATEST -
|
3
|
+
* [LATEST - 26 Aug, 2015 (a6ef010f)](#LATEST)
|
4
|
+
* [2.20.0 - 17 Aug, 2015 (8a419e98)](#2.20.0)
|
4
5
|
* [2.19.0 - 13 Aug, 2015 (80897129)](#2.19.0)
|
5
6
|
* [2.18.3 - 28 Jul, 2015 (d9a02474)](#2.18.3)
|
6
7
|
* [2.18.2 - 27 Jul, 2015 (c84f6f23)](#2.18.2)
|
@@ -92,7 +93,227 @@
|
|
92
93
|
* [pe1.2 - 6 Sep, 2011 (ba3dadd2)](#pe1.2)
|
93
94
|
|
94
95
|
## Details
|
95
|
-
### <a name = "LATEST">LATEST -
|
96
|
+
### <a name = "LATEST">LATEST - 26 Aug, 2015 (a6ef010f)
|
97
|
+
|
98
|
+
* (GEM) update beaker version to 2.21.0 (a6ef010f)
|
99
|
+
|
100
|
+
* Merge pull request #933 from sschneid/license_update (978b2ede)
|
101
|
+
|
102
|
+
|
103
|
+
```
|
104
|
+
Merge pull request #933 from sschneid/license_update
|
105
|
+
|
106
|
+
(maint) Update license copyright
|
107
|
+
```
|
108
|
+
* Merge pull request #932 from anodelman/win-fix (a5b8f291)
|
109
|
+
|
110
|
+
|
111
|
+
```
|
112
|
+
Merge pull request #932 from anodelman/win-fix
|
113
|
+
|
114
|
+
(BKR-293) PowerShell Hangs on Windows 2008 R2 WMF 5.0 Beta
|
115
|
+
```
|
116
|
+
* Merge pull request #919 from colinPL/pkg_acceptance (cb6fa705)
|
117
|
+
|
118
|
+
|
119
|
+
```
|
120
|
+
Merge pull request #919 from colinPL/pkg_acceptance
|
121
|
+
|
122
|
+
(maint) Add Package Acceptance Tests
|
123
|
+
```
|
124
|
+
* (maint) Update license copyright (ed0a84ec)
|
125
|
+
|
126
|
+
* Merge pull request #926 from anodelman/aio-paths (dce6c683)
|
127
|
+
|
128
|
+
|
129
|
+
```
|
130
|
+
Merge pull request #926 from anodelman/aio-paths
|
131
|
+
|
132
|
+
(BKR-395) Calling `remove_defaults_on` twice with `type: aio` in...
|
133
|
+
```
|
134
|
+
* Merge pull request #931 from colinPL/bkr452_deb_code (9885aab1)
|
135
|
+
|
136
|
+
|
137
|
+
```
|
138
|
+
Merge pull request #931 from colinPL/bkr452_deb_code
|
139
|
+
|
140
|
+
(BRK-452) Use Platform To Get Code Name
|
141
|
+
```
|
142
|
+
* (BKR-293) PowerShell Hangs on Windows 2008 R2 WMF 5.0 Beta (0d99ed70)
|
143
|
+
|
144
|
+
|
145
|
+
```
|
146
|
+
(BKR-293) PowerShell Hangs on Windows 2008 R2 WMF 5.0 Beta
|
147
|
+
|
148
|
+
- beaker powershell regressions discovered while working on this bug,
|
149
|
+
mostly around ensuring that we are using the correct path separator on
|
150
|
+
pswindowns machines
|
151
|
+
```
|
152
|
+
* Merge pull request #929 from puppetlabs/maint/fix-git-install-load-path-issue (f1e1ef00)
|
153
|
+
|
154
|
+
|
155
|
+
```
|
156
|
+
Merge pull request #929 from puppetlabs/maint/fix-git-install-load-path-issue
|
157
|
+
|
158
|
+
(MAINT) Fix acceptance puppet_git load path
|
159
|
+
```
|
160
|
+
* Merge pull request #927 from anodelman/maint (87b094d1)
|
161
|
+
|
162
|
+
|
163
|
+
```
|
164
|
+
Merge pull request #927 from anodelman/maint
|
165
|
+
|
166
|
+
(BKR-449) beaker acceptance base smoketest intermittant failure...
|
167
|
+
```
|
168
|
+
* (maint) fix old issue with clone_git_repo_on test (27bae4b5)
|
169
|
+
|
170
|
+
|
171
|
+
```
|
172
|
+
(maint) fix old issue with clone_git_repo_on test
|
173
|
+
|
174
|
+
Prior to this change clone_git_repo_on acceptance test would fail as we
|
175
|
+
reverted the method's behavior to be backwards compatible. it appears
|
176
|
+
this tests is not getting run in CI. Also add install_utils to the
|
177
|
+
load_path so the user doesn't have to.
|
178
|
+
```
|
179
|
+
* (BRK-452) Use Platform To Get Code Name (518f25ae)
|
180
|
+
|
181
|
+
|
182
|
+
```
|
183
|
+
(BRK-452) Use Platform To Get Code Name
|
184
|
+
|
185
|
+
The unix/pkg.rb had its own mapping of platform to debian code name.
|
186
|
+
However, this is available through the Platform class. This commit
|
187
|
+
removes the duplicate data in pkg.rb and uses self['platform'].codename
|
188
|
+
in its place.
|
189
|
+
```
|
190
|
+
* (maint) Add vivid Repo Fixture (fc5afde6)
|
191
|
+
|
192
|
+
|
193
|
+
```
|
194
|
+
(maint) Add vivid Repo Fixture
|
195
|
+
|
196
|
+
Add repo fixture for Ubuntu 15.04 (vivid).
|
197
|
+
```
|
198
|
+
* (MAINT) Fix acceptance puppet_git load path (efa36129)
|
199
|
+
|
200
|
+
|
201
|
+
```
|
202
|
+
(MAINT) Fix acceptance puppet_git load path
|
203
|
+
|
204
|
+
Prior to this commit, running the acceptance tests locally without specifying a
|
205
|
+
specific load path would result in a require failure if attempting to test against
|
206
|
+
puppet installed via git.
|
207
|
+
|
208
|
+
This updates the load path to fix the problem.
|
209
|
+
```
|
210
|
+
* (maint) Add trusty Repo Template (c5ed7a0d)
|
211
|
+
|
212
|
+
|
213
|
+
```
|
214
|
+
(maint) Add trusty Repo Template
|
215
|
+
|
216
|
+
Add repo fixture for trusty instances.
|
217
|
+
```
|
218
|
+
* (BKR-449) beaker acceptance base smoketest intermittant failure... (f626b057)
|
219
|
+
|
220
|
+
|
221
|
+
```
|
222
|
+
(BKR-449) beaker acceptance base smoketest intermittant failure...
|
223
|
+
|
224
|
+
...on ubuntu 1504
|
225
|
+
|
226
|
+
- when attempting to reconnect post reboot we are getting into a
|
227
|
+
blocking state, most likely an issue with the Net::SSH gem
|
228
|
+
- just give some breathing room before moving on from a reboot and
|
229
|
+
everything is okay
|
230
|
+
```
|
231
|
+
* (maint) Add Missing Fedora Templates (485dcefa)
|
232
|
+
|
233
|
+
|
234
|
+
```
|
235
|
+
(maint) Add Missing Fedora Templates
|
236
|
+
|
237
|
+
Add missing fedora rpm repo templates for packaging tests.
|
238
|
+
```
|
239
|
+
* Merge pull request #921 from mcanevet/fix/hack_etc_host_on_openstack (cf09c58b)
|
240
|
+
|
241
|
+
|
242
|
+
```
|
243
|
+
Merge pull request #921 from mcanevet/fix/hack_etc_host_on_openstack
|
244
|
+
|
245
|
+
(BKR-443) Hack /etc/hosts when using openstack
|
246
|
+
```
|
247
|
+
* Merge pull request #893 from biemond/solaris-fixes (b402911a)
|
248
|
+
|
249
|
+
|
250
|
+
```
|
251
|
+
Merge pull request #893 from biemond/solaris-fixes
|
252
|
+
|
253
|
+
BKR-408 Supporting solaris as a beakernode
|
254
|
+
```
|
255
|
+
* (BKR-395) Calling `remove_defaults_on` twice with `type: aio` in... (97cbc1a9)
|
256
|
+
|
257
|
+
|
258
|
+
```
|
259
|
+
(BKR-395) Calling `remove_defaults_on` twice with `type: aio` in...
|
260
|
+
|
261
|
+
...config file throws exception
|
262
|
+
|
263
|
+
- ensure that we don't blow away the PATH and break the world
|
264
|
+
```
|
265
|
+
* (BKR-443) Hack /etc/hosts when using openstack (a701c7cc)
|
266
|
+
|
267
|
+
* (maint) Exclude OS X From Most Things (c9c224aa)
|
268
|
+
|
269
|
+
|
270
|
+
```
|
271
|
+
(maint) Exclude OS X From Most Things
|
272
|
+
|
273
|
+
Exclude OS X systems from running the generic and unix-specific package
|
274
|
+
tests. A special test suite will need to be created for these systems.
|
275
|
+
```
|
276
|
+
* (maint) Change assert Method; Workaround debian Check for Package (09b7c9fb)
|
277
|
+
|
278
|
+
|
279
|
+
```
|
280
|
+
(maint) Change assert Method; Workaround debian Check for Package
|
281
|
+
|
282
|
+
assert_equal(true,...) is the same as just assert(...). Change all
|
283
|
+
of those matching calls to just assert.
|
284
|
+
|
285
|
+
beaker can incorrectly report a package as being installed when in fact it is not. This is specific to debian systems. As a work around to the above, debian systems will use check_for_command to determine whether the specific package is installed.
|
286
|
+
```
|
287
|
+
* (maint) Add Package Acceptance Tests (a9919557)
|
288
|
+
|
289
|
+
|
290
|
+
```
|
291
|
+
(maint) Add Package Acceptance Tests
|
292
|
+
|
293
|
+
Add acceptance tests that exercise the host packages functionality. There are two files: one for all hosts and one targeting unix hosts specifically.
|
294
|
+
|
295
|
+
This includes fixtures for support the deploy_*_repo methods.
|
296
|
+
```
|
297
|
+
* BKR-408 Supporting solaris as a beakernode #893 (45f1f6c5)
|
298
|
+
|
299
|
+
|
300
|
+
```
|
301
|
+
BKR-408 Supporting solaris as a beakernode #893
|
302
|
+
|
303
|
+
- copy certs to solaris root home folder /
|
304
|
+
- gsed of CSW to allow ssh root login
|
305
|
+
- restart sshd daemon
|
306
|
+
|
307
|
+
solaris 11 fixes
|
308
|
+
|
309
|
+
- root home is /root and not /
|
310
|
+
- PermitRootLogin in solaris 11 is not in comment
|
311
|
+
- change security of the user root for solaris else no ssh login without
|
312
|
+
password
|
313
|
+
```
|
314
|
+
### <a name = "2.20.0">2.20.0 - 17 Aug, 2015 (8a419e98)
|
315
|
+
|
316
|
+
* (HISTORY) update beaker history for gem release 2.20.0 (8a419e98)
|
96
317
|
|
97
318
|
* (GEM) update beaker version to 2.20.0 (1d735a7a)
|
98
319
|
|
data/LICENSE
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
deb http://nightlies.puppetlabs.com/puppetserver-latest/repos/apt/lucid lucid PC1
|
@@ -0,0 +1 @@
|
|
1
|
+
deb http://nightlies.puppetlabs.com/puppetserver-latest/repos/apt/precise precise PC1
|
@@ -0,0 +1 @@
|
|
1
|
+
deb http://nightlies.puppetlabs.com/puppetserver-latest/repos/apt/squeeze squeeze PC1
|
@@ -0,0 +1 @@
|
|
1
|
+
deb http://nightlies.puppetlabs.com/puppetserver-latest/repos/apt/trusty trusty PC1
|
@@ -0,0 +1 @@
|
|
1
|
+
deb http://nightlies.puppetlabs.com/puppetserver-latest/repos/apt/vivid vivid PC1
|
@@ -0,0 +1 @@
|
|
1
|
+
deb http://nightlies.puppetlabs.com/puppetserver-latest/repos/apt/wheezy wheezy PC1
|
@@ -0,0 +1,74 @@
|
|
1
|
+
test_name 'confirm packages on hosts behave correctly'
|
2
|
+
confine :except, :platform => %w(osx)
|
3
|
+
|
4
|
+
def get_host_pkg(host)
|
5
|
+
case
|
6
|
+
when host['platform'] =~ /sles-10/
|
7
|
+
Beaker::HostPrebuiltSteps::SLES10_PACKAGES
|
8
|
+
when host['platform'] =~ /sles-/
|
9
|
+
Beaker::HostPrebuiltSteps::SLES_PACKAGES
|
10
|
+
when host['platform'] =~ /debian/
|
11
|
+
Beaker::HostPrebuiltSteps::DEBIAN_PACKAGES
|
12
|
+
when host['platform'] =~ /cumulus/
|
13
|
+
Beaker::HostPrebuiltSteps::CUMULUS_PACKAGES
|
14
|
+
when (host['platform'] =~ /windows/ and host.is_cygwin?)
|
15
|
+
Beaker::HostPrebuiltSteps::WINDOWS_PACKAGES
|
16
|
+
when (host['platform'] =~ /windows/ and not host.is_cygwin?)
|
17
|
+
Beaker::HostPrebuiltSteps::PSWINDOWS_PACKAGES
|
18
|
+
when host['platform'] =~ /freebsd/
|
19
|
+
Beaker::HostPrebuiltSteps::FREEBSD_PACKAGES
|
20
|
+
when host['platform'] =~ /openbsd/
|
21
|
+
Beaker::HostPrebuiltSteps::OPENBSD_PACKAGES
|
22
|
+
else
|
23
|
+
Beaker::HostPrebuiltSteps::UNIX_PACKAGES
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
step '#check_for_command : can determine where a command exists'
|
29
|
+
hosts.each do |host|
|
30
|
+
logger.debug "echo package should be installed on #{host}"
|
31
|
+
assert(host.check_for_command('echo'), "'echo' should be a command")
|
32
|
+
logger.debug("doesnotexist package should not be installed on #{host}")
|
33
|
+
assert_equal(false, host.check_for_command('doesnotexist'), '"doesnotexist" should not be a command')
|
34
|
+
end
|
35
|
+
|
36
|
+
step '#check_for_package : can determine if a package is installed'
|
37
|
+
hosts.each do |host|
|
38
|
+
package = get_host_pkg(host)[0]
|
39
|
+
|
40
|
+
logger.debug "#{package} package should be installed on #{host}"
|
41
|
+
assert(host.check_for_package(package), "'#{package}' should be installed")
|
42
|
+
logger.debug("doesnotexist package should not be installed on #{host}")
|
43
|
+
assert_equal(false, host.check_for_package('doesnotexist'), '"doesnotexist" should not be installed')
|
44
|
+
end
|
45
|
+
|
46
|
+
step '#install_package and #uninstall_package : remove and install a package successfully'
|
47
|
+
hosts.each do |host|
|
48
|
+
# this works on Windows as well, althought it pulls in
|
49
|
+
# a lot of dependencies.
|
50
|
+
package = 'zsh'
|
51
|
+
|
52
|
+
if host['platform'] =~ /solaris/
|
53
|
+
logger.debug("#{package} should be uninstalled on #{host}")
|
54
|
+
host.uninstall_package(package)
|
55
|
+
assert_equal(false, host.check_for_package(package), "'#{package}' should not be installed")
|
56
|
+
end
|
57
|
+
|
58
|
+
assert_equal(false, host.check_for_package(package), "'#{package}' not should be installed")
|
59
|
+
logger.debug("#{package} should be installed on #{host}")
|
60
|
+
host.install_package(package)
|
61
|
+
assert(host.check_for_package(package), "'#{package}' should be installed")
|
62
|
+
|
63
|
+
# windows does not support uninstall_package
|
64
|
+
unless host['platform'] =~ /windows/
|
65
|
+
logger.debug("#{package} should be uninstalled on #{host}")
|
66
|
+
host.uninstall_package(package)
|
67
|
+
if host['platform'] =~ /debian/
|
68
|
+
assert_equal(false, host.check_for_command(package), "'#{package}' should not be installed or available")
|
69
|
+
else
|
70
|
+
assert_equal(false, host.check_for_package(package), "'#{package}' should not be installed")
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
test_name 'confirm unix-specific package methods work'
|
2
|
+
confine :except, :platform => %w(windows solaris osx)
|
3
|
+
|
4
|
+
current_dir = File.dirname(__FILE__)
|
5
|
+
pkg_fixtures = File.expand_path(File.join(current_dir, '../../fixtures/package'))
|
6
|
+
pkg_name = 'puppetserver'
|
7
|
+
|
8
|
+
def clean_file(host, file)
|
9
|
+
if host.file_exist?(file)
|
10
|
+
on(host, "rm -rf #{file}")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
step '#update_apt_if_needed : can execute without raising an error'
|
15
|
+
hosts.each do |host|
|
16
|
+
host.update_apt_if_needed
|
17
|
+
end
|
18
|
+
|
19
|
+
step '#deploy_apt_repo : deploy puppet-server nightly repo'
|
20
|
+
hosts.each do |host|
|
21
|
+
|
22
|
+
if host['platform'] =~ /debian|ubuntu/
|
23
|
+
pkg_file = "/etc/apt/sources.list.d/#{pkg_name}.list"
|
24
|
+
|
25
|
+
clean_file(host, pkg_file)
|
26
|
+
host.deploy_apt_repo(pkg_fixtures, 'puppetserver', 'latest')
|
27
|
+
assert(host.file_exist?(pkg_file), 'apt file should exist')
|
28
|
+
clean_file(host, pkg_file)
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
step '#deploy_yum_repo : deploy puppet-server nightly repo'
|
34
|
+
hosts.each do |host|
|
35
|
+
|
36
|
+
if host['platform'] =~ /el/
|
37
|
+
pkg_file = "/etc/yum.repos.d/#{pkg_name}.repo"
|
38
|
+
|
39
|
+
clean_file(host, pkg_file)
|
40
|
+
host.deploy_yum_repo(pkg_fixtures, pkg_name, 'latest')
|
41
|
+
assert(host.file_exist?(pkg_file), 'yum file should exist')
|
42
|
+
clean_file(host, pkg_file)
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
step '#deploy_package_repo : deploy puppet-server nightly repo'
|
48
|
+
hosts.each do |host|
|
49
|
+
host.deploy_package_repo(pkg_fixtures, 'puppetserver', 'latest')
|
50
|
+
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
begin
|
2
|
+
$LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib'))
|
2
3
|
require 'beaker/acceptance/install_utils'
|
3
4
|
extend Beaker::Acceptance::InstallUtils
|
4
5
|
end
|
@@ -40,10 +41,10 @@ hosts.each do |host|
|
|
40
41
|
|
41
42
|
step 'should find fork name from the correct environment variable'
|
42
43
|
results = clone_git_repo_on(host, "#{testdir}", extract_repo_info_from(build_git_url('puppet')))
|
43
|
-
assert_match( /github\.com
|
44
|
+
assert_match( /github\.com\/fail/, result.cmd, 'Did not find correct fork name')
|
44
45
|
assert_equal( 1, result.exit_code, 'Did not produce error exit_code of 1')
|
45
46
|
|
46
47
|
step 'should clone hiera from correct fork'
|
47
48
|
results = clone_git_repo_on(host, "#{testdir}", extract_repo_info_from(build_git_url('hiera')))
|
48
|
-
assert_match( /From
|
49
|
+
assert_match( /From.*github\.com\/puppetlabs\/hiera/, result.output, 'Did not find clone')
|
49
50
|
end
|
@@ -21,6 +21,11 @@ module Beaker
|
|
21
21
|
'distmoduledir' => '`cygpath -smF 35`/PuppetLabs/code/modules',
|
22
22
|
# sitemoduledir not included (check PUP-4049 for more info)
|
23
23
|
},
|
24
|
+
'pwindows' => { #pure windows
|
25
|
+
'puppetbindir' => '"C:\\Program Files (x86)\\Puppet Labs\\Puppet\\bin";"C:\\Program Files\\Puppet Labs\\Puppet\\bin"',
|
26
|
+
'privatebindir' => '"C:\\Program Files (x86)\\Puppet Labs\\Puppet\\sys\\ruby\\bin";"C:\\Program Files\\Puppet Labs\\Puppet\\sys\\ruby\\bin"',
|
27
|
+
'distmoduledir' => 'C:\\ProgramData\\PuppetLabs\\code\\environments\\production\\modules',
|
28
|
+
}
|
24
29
|
}
|
25
30
|
|
26
31
|
# Add the appropriate aio defaults to the host object so that they can be accessed using host[option], set host[:type] = aio
|
@@ -43,7 +48,9 @@ module Beaker
|
|
43
48
|
# or a role (String or Symbol) that identifies one or more hosts.
|
44
49
|
def add_aio_defaults_on(hosts)
|
45
50
|
block_on hosts do | host |
|
46
|
-
if host
|
51
|
+
if host.is_powershell?
|
52
|
+
platform = 'pwindows'
|
53
|
+
elsif host['platform'] =~ /windows/
|
47
54
|
platform = 'windows'
|
48
55
|
else
|
49
56
|
platform = 'unix'
|
@@ -67,7 +74,9 @@ module Beaker
|
|
67
74
|
# or a role (String or Symbol) that identifies one or more hosts.
|
68
75
|
def remove_aio_defaults_on(hosts)
|
69
76
|
block_on hosts do | host |
|
70
|
-
if host
|
77
|
+
if host.is_powershell?
|
78
|
+
platform = 'pswindows'
|
79
|
+
elsif host['platform'] =~ /windows/
|
71
80
|
platform = 'windows'
|
72
81
|
else
|
73
82
|
platform = 'unix'
|
@@ -110,6 +110,7 @@ module Beaker
|
|
110
110
|
opts = {:source => './',
|
111
111
|
:target_module_path => host['distmoduledir'],
|
112
112
|
:ignore_list => PUPPET_MODULE_INSTALL_IGNORE}.merge(opts)
|
113
|
+
|
113
114
|
ignore_list = build_ignore_list(opts)
|
114
115
|
target_module_dir = on( host, "echo #{opts[:target_module_path]}" ).stdout.chomp
|
115
116
|
source_path = File.expand_path( opts[:source] )
|
@@ -122,6 +123,9 @@ module Beaker
|
|
122
123
|
end
|
123
124
|
|
124
125
|
target_path = File.join(target_module_dir, module_name)
|
126
|
+
if host.is_powershell? #make sure our slashes are correct
|
127
|
+
target_path = target_path.gsub(/\//,'\\')
|
128
|
+
end
|
125
129
|
|
126
130
|
opts[:protocol] ||= 'scp'
|
127
131
|
case opts[:protocol]
|
@@ -6,6 +6,32 @@ module Beaker
|
|
6
6
|
#
|
7
7
|
module PuppetUtils
|
8
8
|
|
9
|
+
#Given a type return an understood host type
|
10
|
+
#@param [String] type The host type to be normalized
|
11
|
+
#@return [String] The normalized type
|
12
|
+
#
|
13
|
+
#@example
|
14
|
+
# normalize_type('pe-aio')
|
15
|
+
# 'pe'
|
16
|
+
#@example
|
17
|
+
# normalize_type('git')
|
18
|
+
# 'foss'
|
19
|
+
#@example
|
20
|
+
# normalize_type('foss-internal')
|
21
|
+
# 'foss'
|
22
|
+
def normalize_type type
|
23
|
+
case type
|
24
|
+
when /(\A|-)(git)|(foss)(\Z|-)/
|
25
|
+
'foss'
|
26
|
+
when /(\A|-)pe(\Z|-)/
|
27
|
+
'pe'
|
28
|
+
when /(\A|-)aio(\Z|-)/
|
29
|
+
'aio'
|
30
|
+
else
|
31
|
+
nil
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
9
35
|
#Given a host construct a PATH that includes puppetbindir, facterbindir and hierabindir
|
10
36
|
# @param [Host] host A single host to construct pathing for
|
11
37
|
def construct_puppet_path(host)
|
@@ -28,7 +54,8 @@ module Beaker
|
|
28
54
|
# or a role (String or Symbol) that identifies one or more hosts.
|
29
55
|
def add_puppet_paths_on(hosts)
|
30
56
|
block_on hosts do | host |
|
31
|
-
|
57
|
+
puppet_path = construct_puppet_path(host)
|
58
|
+
host.add_env_var('PATH', puppet_path)
|
32
59
|
host.add_env_var('PATH', 'PATH') # don't destroy the path!
|
33
60
|
end
|
34
61
|
end
|
@@ -39,7 +66,9 @@ module Beaker
|
|
39
66
|
# or a role (String or Symbol) that identifies one or more hosts.
|
40
67
|
def remove_puppet_paths_on(hosts)
|
41
68
|
block_on hosts do | host |
|
42
|
-
|
69
|
+
puppet_path = construct_puppet_path(host)
|
70
|
+
host.delete_env_var('PATH', puppet_path)
|
71
|
+
host.add_env_var('PATH', 'PATH') # don't destroy the path!
|
43
72
|
end
|
44
73
|
end
|
45
74
|
|
@@ -74,15 +103,8 @@ module Beaker
|
|
74
103
|
# clean up the naming conventions here (some teams use foss-package, git-whatever, we need
|
75
104
|
# to correctly handle that
|
76
105
|
# don't worry about aio, that happens in the aio_version? check
|
77
|
-
host_type =
|
78
|
-
|
79
|
-
'foss'
|
80
|
-
when /(\A|-)pe(\Z|-)/
|
81
|
-
'pe'
|
82
|
-
else
|
83
|
-
nil
|
84
|
-
end
|
85
|
-
if host_type
|
106
|
+
host_type = normalize_type(host_type)
|
107
|
+
if host_type and host_type !~ /aio/
|
86
108
|
add_method = "add_#{host_type}_defaults_on"
|
87
109
|
if self.respond_to?(add_method, host)
|
88
110
|
self.send(add_method, host)
|
@@ -111,12 +133,16 @@ module Beaker
|
|
111
133
|
def remove_defaults_on( hosts )
|
112
134
|
block_on hosts do |host|
|
113
135
|
if host['type']
|
136
|
+
# clean up the naming conventions here (some teams use foss-package, git-whatever, we need
|
137
|
+
# to correctly handle that
|
138
|
+
# don't worry about aio, that happens in the aio_version? check
|
139
|
+
host_type = normalize_type(host['type'])
|
114
140
|
remove_puppet_paths_on(hosts)
|
115
|
-
remove_method = "remove_#{
|
141
|
+
remove_method = "remove_#{host_type}_defaults_on"
|
116
142
|
if self.respond_to?(remove_method, host)
|
117
143
|
self.send(remove_method, host)
|
118
144
|
else
|
119
|
-
raise "cannot remove defaults of type #{
|
145
|
+
raise "cannot remove defaults of type #{host_type} associated with host #{host.name} (#{remove_method} not present)"
|
120
146
|
end
|
121
147
|
if aio_version?(host)
|
122
148
|
remove_aio_defaults_on(host)
|
@@ -4,6 +4,8 @@ module PSWindows::Exec
|
|
4
4
|
|
5
5
|
def reboot
|
6
6
|
exec(Beaker::Command.new("shutdown /r /t 0"), :expect_connection_failure => true)
|
7
|
+
# rebooting on windows is slooooow
|
8
|
+
sleep(40)
|
7
9
|
end
|
8
10
|
|
9
11
|
ABS_CMD = 'c:\\\\windows\\\\system32\\\\cmd.exe'
|
@@ -18,6 +20,8 @@ module PSWindows::Exec
|
|
18
20
|
end
|
19
21
|
|
20
22
|
def rm_rf path
|
23
|
+
# ensure that we have the right slashes for windows
|
24
|
+
path = path.gsub(/\//, '\\')
|
21
25
|
execute("del /s /q #{path}")
|
22
26
|
end
|
23
27
|
|
@@ -26,6 +30,9 @@ module PSWindows::Exec
|
|
26
30
|
# @param [String] dest the destination path
|
27
31
|
# @param [Boolean] rm Remove the destination prior to move
|
28
32
|
def mv(orig, dest, rm=true)
|
33
|
+
# ensure that we have the right slashes for windows
|
34
|
+
orig = orig.gsub(/\//,'\\')
|
35
|
+
dest = dest.gsub(/\//,'\\')
|
29
36
|
rm_rf dest unless !rm
|
30
37
|
execute("move /y #{orig} #{dest}")
|
31
38
|
end
|
@@ -120,6 +127,7 @@ module PSWindows::Exec
|
|
120
127
|
if val.empty?
|
121
128
|
return ''
|
122
129
|
else
|
130
|
+
val = val.split(/\n/)[0] # only take the first result
|
123
131
|
if clean
|
124
132
|
val.gsub(/#{key}=/,'')
|
125
133
|
else
|
data/lib/beaker/host/unix/pkg.rb
CHANGED
@@ -168,19 +168,6 @@ module Unix::Pkg
|
|
168
168
|
end
|
169
169
|
end
|
170
170
|
|
171
|
-
# Debian repositories contain packages for all architectures, so we
|
172
|
-
# need to map to an architecturless name for each platform
|
173
|
-
DEBIAN_PLATFORM_CODENAMES = {
|
174
|
-
'debian-6-amd64' => 'squeeze',
|
175
|
-
'debian-6-i386' => 'squeeze',
|
176
|
-
'debian-7-amd64' => 'wheezy',
|
177
|
-
'debian-7-i386' => 'wheezy',
|
178
|
-
'ubuntu-10.04-amd64' => 'lucid',
|
179
|
-
'ubuntu-10.04-i386' => 'lucid',
|
180
|
-
'ubuntu-12.04-amd64' => 'precise',
|
181
|
-
'ubuntu-12.04-i386' => 'precise',
|
182
|
-
}
|
183
|
-
|
184
171
|
# Deploy apt configuration generated by the packaging tooling
|
185
172
|
#
|
186
173
|
# @note Due to the debian use of codenames in repos, the
|
@@ -190,7 +177,8 @@ module Unix::Pkg
|
|
190
177
|
# @note See {Beaker::DSL::Helpers::HostHelpers#deploy_package_repo} for info on
|
191
178
|
# params
|
192
179
|
def deploy_apt_repo(path, name, version)
|
193
|
-
codename =
|
180
|
+
codename = self['platform'].codename
|
181
|
+
|
194
182
|
if codename.nil?
|
195
183
|
@logger.warning "Could not determine codename for debian platform #{self['platform']}. Skipping deployment of repo #{name}"
|
196
184
|
return
|
@@ -5,7 +5,7 @@ module Windows::Exec
|
|
5
5
|
exec(Beaker::Command.new('shutdown /r /t 0 /d p:4:1 /c "Beaker::Host reboot command issued"'), :expect_connection_failure => true)
|
6
6
|
# rebooting on windows is sloooooow
|
7
7
|
# give it some breathing room before attempting a reconnect
|
8
|
-
sleep(
|
8
|
+
sleep(40)
|
9
9
|
end
|
10
10
|
|
11
11
|
ABS_CMD = 'c:\\\\windows\\\\system32\\\\cmd.exe'
|
@@ -324,6 +324,10 @@ module Beaker
|
|
324
324
|
host.exec(Command.new('sudo cp -r .ssh /root/.'), {:pty => true})
|
325
325
|
elsif host['platform'] =~ /openbsd/
|
326
326
|
host.exec(Command.new('sudo cp -r .ssh /root/.'), {:pty => true})
|
327
|
+
elsif host['platform'] =~ /solaris-10/
|
328
|
+
host.exec(Command.new('sudo cp -r .ssh /.'), {:pty => true})
|
329
|
+
elsif host['platform'] =~ /solaris-11/
|
330
|
+
host.exec(Command.new('sudo cp -r .ssh /root/.'), {:pty => true})
|
327
331
|
else
|
328
332
|
host.exec(Command.new('sudo su -c "cp -r .ssh /root/."'), {:pty => true})
|
329
333
|
end
|
@@ -369,6 +373,11 @@ module Beaker
|
|
369
373
|
host.exec(Command.new("sudo sed -i -e 's/#PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config"), {:pty => true} )
|
370
374
|
elsif host['platform'] =~ /openbsd/
|
371
375
|
host.exec(Command.new("sudo perl -pi -e 's/^PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config"), {:pty => true} )
|
376
|
+
elsif host['platform'] =~ /solaris-10/
|
377
|
+
host.exec(Command.new("sudo gsed -i -e 's/#PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config"), {:pty => true} )
|
378
|
+
elsif host['platform'] =~ /solaris-11/
|
379
|
+
host.exec(Command.new("sudo rolemod -K type=normal root"), {:pty => true} )
|
380
|
+
host.exec(Command.new("sudo gsed -i -e 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config"), {:pty => true} )
|
372
381
|
elsif not host.is_powershell?
|
373
382
|
host.exec(Command.new("sudo su -c \"sed -ri 's/^#?PermitRootLogin no|^#?PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config\""), {:pty => true})
|
374
383
|
else
|
@@ -383,6 +392,8 @@ module Beaker
|
|
383
392
|
host.exec(Command.new("sudo -E /sbin/service sshd reload"), {:pty => true})
|
384
393
|
elsif host['platform'] =~ /(free|open)bsd/
|
385
394
|
host.exec(Command.new("sudo /etc/rc.d/sshd restart"))
|
395
|
+
elsif host['platform'] =~ /solaris/
|
396
|
+
host.exec(Command.new("sudo -E svcadm restart network/ssh"), {:pty => true} )
|
386
397
|
else
|
387
398
|
logger.warn("Attempting to update ssh on non-supported platform: #{host.name}: #{host['platform']}")
|
388
399
|
end
|
data/lib/beaker/version.rb
CHANGED
@@ -187,7 +187,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
187
187
|
expect( subject ).to receive(:on).with(host, "echo C:\\ProgramData\\PuppetLabs\\puppet\\etc\\modules" ).and_return( result )
|
188
188
|
|
189
189
|
expect( subject ).to receive(:scp_to).with(host, "/opt/testmodule2", "C:\\ProgramData\\PuppetLabs\\puppet\\etc\\modules", {:ignore => ignore_list})
|
190
|
-
expect( host ).to receive(:mv).with('C:\\ProgramData\\PuppetLabs\\puppet\\etc\\modules/testmodule2', 'C:\\ProgramData\\PuppetLabs\\puppet\\etc\\modules
|
190
|
+
expect( host ).to receive(:mv).with('C:\\ProgramData\\PuppetLabs\\puppet\\etc\\modules/testmodule2', 'C:\\ProgramData\\PuppetLabs\\puppet\\etc\\modules\\testmodule')
|
191
191
|
|
192
192
|
subject.copy_module_to(host, {:module_name => 'testmodule', :source => '/opt/testmodule2'})
|
193
193
|
end
|
@@ -28,7 +28,8 @@ module Beaker
|
|
28
28
|
|
29
29
|
it "deletes" do
|
30
30
|
path = '/path/to/delete'
|
31
|
-
|
31
|
+
corrected_path = '\\path\\to\\delete'
|
32
|
+
expect( instance ).to receive(:execute).with("del /s /q #{corrected_path}").and_return(0)
|
32
33
|
expect( instance.rm_rf(path) ).to be === 0
|
33
34
|
end
|
34
35
|
end
|
@@ -38,14 +39,14 @@ module Beaker
|
|
38
39
|
let(:destination) { '/destination/path/of/content' }
|
39
40
|
|
40
41
|
it 'rm first' do
|
41
|
-
expect( instance ).to receive(:execute).with("del /s /q #{destination}").and_return(0)
|
42
|
-
expect( instance ).to receive(:execute).with("move /y #{origin} #{destination}").and_return(0)
|
42
|
+
expect( instance ).to receive(:execute).with("del /s /q #{destination.gsub(/\//, '\\')}").and_return(0)
|
43
|
+
expect( instance ).to receive(:execute).with("move /y #{origin.gsub(/\//, '\\')} #{destination.gsub(/\//, '\\')}").and_return(0)
|
43
44
|
expect( instance.mv(origin, destination) ).to be === 0
|
44
45
|
|
45
46
|
end
|
46
47
|
|
47
48
|
it 'does not rm' do
|
48
|
-
expect( instance ).to receive(:execute).with("move /y #{origin} #{destination}").and_return(0)
|
49
|
+
expect( instance ).to receive(:execute).with("move /y #{origin.gsub(/\//, '\\')} #{destination.gsub(/\//, '\\')}").and_return(0)
|
49
50
|
expect( instance.mv(origin, destination, false) ).to be === 0
|
50
51
|
end
|
51
52
|
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.
|
4
|
+
version: 2.21.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-08-
|
11
|
+
date: 2015-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -418,6 +418,22 @@ files:
|
|
418
418
|
- acceptance/fixtures/module/spec/spec_helper_acceptance.rb
|
419
419
|
- acceptance/fixtures/module/tests/init.pp
|
420
420
|
- acceptance/fixtures/module/vendor/bundle/ruby/gems.txt
|
421
|
+
- acceptance/fixtures/package/deb/pl-puppetserver-latest-lucid.list
|
422
|
+
- acceptance/fixtures/package/deb/pl-puppetserver-latest-precise.list
|
423
|
+
- acceptance/fixtures/package/deb/pl-puppetserver-latest-squeeze.list
|
424
|
+
- acceptance/fixtures/package/deb/pl-puppetserver-latest-trusty.list
|
425
|
+
- acceptance/fixtures/package/deb/pl-puppetserver-latest-vivid.list
|
426
|
+
- acceptance/fixtures/package/deb/pl-puppetserver-latest-wheezy.list
|
427
|
+
- acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-el-6-i386.repo
|
428
|
+
- acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-el-6-x86_64.repo
|
429
|
+
- acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-el-7-i386.repo
|
430
|
+
- acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-el-7-x86_64.repo
|
431
|
+
- acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-20-i386.repo
|
432
|
+
- acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-20-x86_64.repo
|
433
|
+
- acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-21-i386.repo
|
434
|
+
- acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-21-x86_64.repo
|
435
|
+
- acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-22-i386.repo
|
436
|
+
- acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-22-x86_64.repo
|
421
437
|
- acceptance/lib/beaker/acceptance/install_utils.rb
|
422
438
|
- acceptance/pre_suite/README.md
|
423
439
|
- acceptance/pre_suite/pe/install.rb
|
@@ -426,7 +442,9 @@ files:
|
|
426
442
|
- acceptance/pre_suite/puppet_pkg/install.rb
|
427
443
|
- acceptance/tests/base/README.md
|
428
444
|
- acceptance/tests/base/host.rb
|
429
|
-
- acceptance/tests/
|
445
|
+
- acceptance/tests/base/packages.rb
|
446
|
+
- acceptance/tests/base/packages_unix.rb
|
447
|
+
- acceptance/tests/dsl/install_utils/clone_git_repo_on.rb
|
430
448
|
- acceptance/tests/hypervisor/communication.rb
|
431
449
|
- acceptance/tests/puppet/README.md
|
432
450
|
- acceptance/tests/puppet/install_smoke.rb
|