beaker 2.5.1 → 2.6.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 +8 -8
- data/HISTORY.md +184 -2
- data/acceptance/fixtures/README.md +3 -0
- data/acceptance/fixtures/module/Gemfile +12 -0
- data/acceptance/fixtures/module/README.md +79 -0
- data/acceptance/fixtures/module/Rakefile +18 -0
- data/acceptance/fixtures/module/lib/empty.txt +1 -0
- data/acceptance/fixtures/module/manifests/init.pp +41 -0
- data/acceptance/fixtures/module/metadata.json +14 -0
- data/acceptance/fixtures/module/spec/acceptance/demo_spec.rb +72 -0
- data/acceptance/fixtures/module/spec/acceptance/nodesets/centos-59-x64.yml +10 -0
- data/acceptance/fixtures/module/spec/acceptance/nodesets/centos-64-x64-pe.yml +12 -0
- data/acceptance/fixtures/module/spec/acceptance/nodesets/centos-64-x64.yml +10 -0
- data/acceptance/fixtures/module/spec/acceptance/nodesets/centos-65-x64.yml +10 -0
- data/acceptance/fixtures/module/spec/acceptance/nodesets/default.yml +10 -0
- data/acceptance/fixtures/module/spec/acceptance/nodesets/fedora-18-x64.yml +10 -0
- data/acceptance/fixtures/module/spec/acceptance/nodesets/internal-vpool.yml +17 -0
- data/acceptance/fixtures/module/spec/acceptance/nodesets/sles-11-x64.yml +10 -0
- data/acceptance/fixtures/module/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml +10 -0
- data/acceptance/fixtures/module/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml +10 -0
- data/acceptance/fixtures/module/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml +11 -0
- data/acceptance/fixtures/module/spec/acceptance/nodesets/ubuntu-server-14042-x64.yml +16 -0
- data/acceptance/fixtures/module/spec/classes/init_spec.rb +7 -0
- data/acceptance/fixtures/module/spec/spec_helper.rb +1 -0
- data/acceptance/fixtures/module/spec/spec_helper_acceptance.rb +38 -0
- data/acceptance/fixtures/module/tests/init.pp +12 -0
- data/acceptance/fixtures/module/vendor/bundle/ruby/gems.txt +1 -0
- data/acceptance/pre_suite/README.md +7 -0
- data/acceptance/tests/base/README.md +4 -0
- data/acceptance/tests/base/host.rb +154 -0
- data/acceptance/tests/puppet/README.md +3 -0
- data/lib/beaker/answers/version20.rb +1 -1
- data/lib/beaker/answers/version28.rb +1 -1
- data/lib/beaker/answers/version30.rb +1 -1
- data/lib/beaker/dsl/helpers.rb +12 -2
- data/lib/beaker/dsl/install_utils.rb +16 -6
- data/lib/beaker/host.rb +79 -13
- data/lib/beaker/host/pswindows/exec.rb +4 -0
- data/lib/beaker/host/unix.rb +3 -12
- data/lib/beaker/host/windows.rb +2 -11
- data/lib/beaker/host/windows/file.rb +1 -1
- data/lib/beaker/host/windows/pkg.rb +1 -1
- data/lib/beaker/host_prebuilt_steps.rb +1 -1
- data/lib/beaker/hypervisor.rb +4 -2
- data/lib/beaker/hypervisor/{vcloud_pooled.rb → vmpooler.rb} +10 -14
- data/lib/beaker/options/presets.rb +1 -0
- data/lib/beaker/version.rb +1 -1
- data/spec/beaker/dsl/helpers_spec.rb +16 -0
- data/spec/beaker/dsl/install_utils_spec.rb +7 -6
- data/spec/beaker/host_spec.rb +13 -11
- data/spec/beaker/hypervisor/hypervisor_spec.rb +2 -2
- data/spec/beaker/hypervisor/{vcloud_pooled_spec.rb → vmpooler_spec.rb} +20 -20
- metadata +33 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Yjk0OGJjNzMzZmM2NTA1OWFlMDRlNzI3YmM0MTI5MjUxZGQwNTU5MA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Mjk2ZDUyY2JkY2MzZTc2Yjg2YTcwYWNkN2RjZThjMmVjZWY0ZGU0Zg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTAwMDc2MTllMzg1NTU5ODQ0ODUxY2U3N2I5NGRiMTA3MGE3ZDQ4ZDFlMTQ1
|
10
|
+
Y2JmNTY0N2MxNmI0ZjUzYjE2ZDhkNTdhYWNmZDIxOWViMWYxNWNiZDlkN2Qx
|
11
|
+
YWQxMjVlNGZjZDA0OGEwODZjYmY0NjM3YjAwYzI2MDUyYTI4NWU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjZmZWZkYjYyMTkzN2Y1MmJiNmJiNjYxMDQ5ZWZjZTljNjFmNDU3N2M3MmIy
|
14
|
+
NGE4ZDAzYWNlZmIwNWVlMDQ4ODEzN2EyYTI5ZTEwOGU1N2NkMzRlNzk3ZjRj
|
15
|
+
YmE0YzU4NDAxMDFhNzM4ZjY2YTVlZWYyNjExMmMxYzU2MDg2YWE=
|
data/HISTORY.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# default - History
|
2
2
|
## Tags
|
3
|
-
* [LATEST -
|
3
|
+
* [LATEST - 12 Mar, 2015 (b63d3d11)](#LATEST)
|
4
|
+
* [beaker2.5.1 - 4 Mar, 2015 (009c2c63)](#beaker2.5.1)
|
4
5
|
* [beaker2.5.0 - 23 Feb, 2015 (c421cf95)](#beaker2.5.0)
|
5
6
|
* [beaker2.4.1 - 13 Feb, 2015 (84400ed1)](#beaker2.4.1)
|
6
7
|
* [beaker2.4.0 - 13 Feb, 2015 (bc5a6676)](#beaker2.4.0)
|
@@ -72,7 +73,188 @@
|
|
72
73
|
* [pe1.2 - 6 Sep, 2011 (ba3dadd2)](#pe1.2)
|
73
74
|
|
74
75
|
## Details
|
75
|
-
### <a name = "LATEST">LATEST -
|
76
|
+
### <a name = "LATEST">LATEST - 12 Mar, 2015 (b63d3d11)
|
77
|
+
|
78
|
+
* (GEM) update beaker version to 2.6.0 (b63d3d11)
|
79
|
+
|
80
|
+
* Merge pull request #741 from anodelman/maint (d797fe23)
|
81
|
+
|
82
|
+
|
83
|
+
```
|
84
|
+
Merge pull request #741 from anodelman/maint
|
85
|
+
|
86
|
+
(BKR-8) PE 3.8 on Sles11 can't find puppet in path after install...
|
87
|
+
```
|
88
|
+
* (BKR-8) PE 3.8 on Sles11 can't find puppet in path after install... (d53d1db9)
|
89
|
+
|
90
|
+
|
91
|
+
```
|
92
|
+
(BKR-8) PE 3.8 on Sles11 can't find puppet in path after install...
|
93
|
+
|
94
|
+
... completes successfully.
|
95
|
+
|
96
|
+
- add the ~/.ssh/environment to a /etc/profile.d/beaker_env.sh script
|
97
|
+
- ensure that beaker_env.sh is kept up to date and correct with state of
|
98
|
+
current env
|
99
|
+
```
|
100
|
+
* Merge pull request #666 from petems/MAINT-fix_mkdir_bug (9d59deab)
|
101
|
+
|
102
|
+
|
103
|
+
```
|
104
|
+
Merge pull request #666 from petems/MAINT-fix_mkdir_bug
|
105
|
+
|
106
|
+
(MAINT) Fix mkdir bug on PSWindows and fix test
|
107
|
+
```
|
108
|
+
* Merge pull request #738 from demophoon/fix/master/qeng-1970-custom-answers-windows-guard (80de6cbe)
|
109
|
+
|
110
|
+
|
111
|
+
```
|
112
|
+
Merge pull request #738 from demophoon/fix/master/qeng-1970-custom-answers-windows-guard
|
113
|
+
|
114
|
+
(QENG-1970) Guard against merging custom answers on Windows
|
115
|
+
```
|
116
|
+
* Merge pull request #739 from kevpl/qeng1969_aio_pathsupdate (c066aef1)
|
117
|
+
|
118
|
+
|
119
|
+
```
|
120
|
+
Merge pull request #739 from kevpl/qeng1969_aio_pathsupdate
|
121
|
+
|
122
|
+
(QENG-1969) fixed PE privatebindir default
|
123
|
+
```
|
124
|
+
* Merge pull request #730 from anodelman/acceptance (2ba9cd51)
|
125
|
+
|
126
|
+
|
127
|
+
```
|
128
|
+
Merge pull request #730 from anodelman/acceptance
|
129
|
+
|
130
|
+
(QENG-1869) create beaker host.rb acceptance tests
|
131
|
+
```
|
132
|
+
* Merge pull request #740 from anodelman/maint (24c90744)
|
133
|
+
|
134
|
+
|
135
|
+
```
|
136
|
+
Merge pull request #740 from anodelman/maint
|
137
|
+
|
138
|
+
(gh-702) sshd restart doesn't work with some el6...
|
139
|
+
```
|
140
|
+
* (gh-702) sshd restart doesn't work with some el6... (f3b9035f)
|
141
|
+
|
142
|
+
|
143
|
+
```
|
144
|
+
(gh-702) sshd restart doesn't work with some el6...
|
145
|
+
|
146
|
+
... variants especially centos - with vagrant provisioner
|
147
|
+
|
148
|
+
For centos6 & vagrant, this pull fixed it: https://github.com/puppetlabs/beaker/pull/545
|
149
|
+
& fixing https://github.com/puppetlabs/beaker/issues/656 re-broke it by undoing pull 545
|
150
|
+
|
151
|
+
- Instead of service sshd restart, service sshd reload fixes the issue.
|
152
|
+
Even systemctl takes reload.
|
153
|
+
```
|
154
|
+
* (QENG-1969) fixed PE privatebindir default (768b1ed0)
|
155
|
+
|
156
|
+
* (QENG-1970) Guard against merging custom answers on Windows (5c7e31c2)
|
157
|
+
|
158
|
+
|
159
|
+
```
|
160
|
+
(QENG-1970) Guard against merging custom answers on Windows
|
161
|
+
|
162
|
+
Before this commit Beaker would attempt to merge custom answers on
|
163
|
+
platforms where answers are not used. This commit guards against merging
|
164
|
+
custom answers unless there are already answers specified.
|
165
|
+
```
|
166
|
+
* Merge pull request #736 from kevpl/qeng1946_aio_pathsupdate (7d0cccf2)
|
167
|
+
|
168
|
+
|
169
|
+
```
|
170
|
+
Merge pull request #736 from kevpl/qeng1946_aio_pathsupdate
|
171
|
+
|
172
|
+
(QENG-1946) removed paths from AIO host defaults in windows & unix
|
173
|
+
```
|
174
|
+
* Merge pull request #735 from Iristyle/ticket/master/QENG-1955-Windows-File-exist-failures-on-Windows-2003 (a42d8ab5)
|
175
|
+
|
176
|
+
|
177
|
+
```
|
178
|
+
Merge pull request #735 from Iristyle/ticket/master/QENG-1955-Windows-File-exist-failures-on-Windows-2003
|
179
|
+
|
180
|
+
(QENG-1955) Windows::File.file_exist? fails on 2003
|
181
|
+
```
|
182
|
+
* (QENG-1955) Windows::File.file_exist? fails on 2003 (f21d2226)
|
183
|
+
|
184
|
+
|
185
|
+
```
|
186
|
+
(QENG-1955) Windows::File.file_exist? fails on 2003
|
187
|
+
|
188
|
+
- In 9c32cac7a7a5bf52f21b628b14ddba9bfc44510c a change was
|
189
|
+
introduced to add a new Windows::File.file_exist? method
|
190
|
+
that relied on using test -e. The code assumes that the
|
191
|
+
path does not contain spaces and does not need to be
|
192
|
+
quoted.
|
193
|
+
|
194
|
+
Unfortunately, this assumption is incorrect and causes
|
195
|
+
pre-suites to fail because this test is performed on
|
196
|
+
Puppets :vardir. On Windows, Puppets :vardir is always
|
197
|
+
rooted at %ALLUSERSPROFILE%\PuppetLabs
|
198
|
+
|
199
|
+
When running on Windows 2008 or higher, the
|
200
|
+
%ALLUSERSPROFILE% directory is C:\ProgramData\
|
201
|
+
|
202
|
+
However, on Windows 2003, the path structure is different
|
203
|
+
and that directory is located at
|
204
|
+
C:\Documents and Settings\All Users\Application Data
|
205
|
+
|
206
|
+
With an unquoted path passed to test -e a failure is
|
207
|
+
generated, which breaks Windows pre-suites on 2003.
|
208
|
+
```
|
209
|
+
* (QENG-1946) removed paths from AIO host defaults in windows & unix (0b7afd49)
|
210
|
+
|
211
|
+
* Merge pull request #729 from sschneid/rename_vcloudpooled_vmpooler (6cd29bbf)
|
212
|
+
|
213
|
+
|
214
|
+
```
|
215
|
+
Merge pull request #729 from sschneid/rename_vcloudpooled_vmpooler
|
216
|
+
|
217
|
+
(maint) VcloudPooled -> Vmpooler
|
218
|
+
```
|
219
|
+
* (maint) VcloudPooled -> Vmpooler (e1723437)
|
220
|
+
|
221
|
+
|
222
|
+
```
|
223
|
+
(maint) VcloudPooled -> Vmpooler
|
224
|
+
|
225
|
+
This PR renames the 'VcloudPooled' hypervisor to 'Vmpooler', and
|
226
|
+
includes a few fixups as ride-alongs:
|
227
|
+
|
228
|
+
- resourcepool, folder, datastore not needed for Vmpooler
|
229
|
+
- small syntax/wording changes
|
230
|
+
```
|
231
|
+
* (QENG-1869) create beaker host.rb acceptance tests (3474a114)
|
232
|
+
|
233
|
+
|
234
|
+
```
|
235
|
+
(QENG-1869) create beaker host.rb acceptance tests
|
236
|
+
|
237
|
+
- tests that exercise basic host.rb functionality
|
238
|
+
```
|
239
|
+
* (MAINT) Fixing mkdir_p POSH command (f57354de)
|
240
|
+
|
241
|
+
|
242
|
+
```
|
243
|
+
(MAINT) Fixing mkdir_p POSH command
|
244
|
+
|
245
|
+
Test was set to test for the wrong command:
|
246
|
+
|
247
|
+
|
248
|
+
ruby
|
249
|
+
.with("if not exist test\\test\\test (md )")
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
So the directory would never get made, as the `md` bit was empty. Fixed spec and code to create command
|
254
|
+
```
|
255
|
+
### <a name = "beaker2.5.1">beaker2.5.1 - 4 Mar, 2015 (009c2c63)
|
256
|
+
|
257
|
+
* (HISTORY) update beaker history for gem release 2.5.1 (009c2c63)
|
76
258
|
|
77
259
|
* (GEM) update beaker version to 2.5.1 (958ab02d)
|
78
260
|
|
@@ -0,0 +1,12 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 3.3']
|
4
|
+
gem 'puppet', puppetversion
|
5
|
+
gem 'puppetlabs_spec_helper', '>= 0.1.0'
|
6
|
+
gem 'puppet-lint', '>= 0.3.2'
|
7
|
+
gem 'facter', '>= 1.7.0'
|
8
|
+
|
9
|
+
group :system_tests do
|
10
|
+
gem 'beaker-rspec', :require => false
|
11
|
+
gem 'serverspec', :require => false
|
12
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# demo
|
2
|
+
|
3
|
+
#### Table of Contents
|
4
|
+
|
5
|
+
1. [Overview](#overview)
|
6
|
+
2. [Module Description - What the module does and why it is useful](#module-description)
|
7
|
+
3. [Setup - The basics of getting started with demo](#setup)
|
8
|
+
* [What demo affects](#what-demo-affects)
|
9
|
+
* [Setup requirements](#setup-requirements)
|
10
|
+
* [Beginning with demo](#beginning-with-demo)
|
11
|
+
4. [Usage - Configuration options and additional functionality](#usage)
|
12
|
+
5. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
|
13
|
+
5. [Limitations - OS compatibility, etc.](#limitations)
|
14
|
+
6. [Development - Guide for contributing to the module](#development)
|
15
|
+
|
16
|
+
## Overview
|
17
|
+
|
18
|
+
A one-maybe-two sentence summary of what the module does/what problem it solves.
|
19
|
+
This is your 30 second elevator pitch for your module. Consider including
|
20
|
+
OS/Puppet version it works with.
|
21
|
+
|
22
|
+
## Module Description
|
23
|
+
|
24
|
+
If applicable, this section should have a brief description of the technology
|
25
|
+
the module integrates with and what that integration enables. This section
|
26
|
+
should answer the questions: "What does this module *do*?" and "Why would I use
|
27
|
+
it?"
|
28
|
+
|
29
|
+
If your module has a range of functionality (installation, configuration,
|
30
|
+
management, etc.) this is the time to mention it.
|
31
|
+
|
32
|
+
## Setup
|
33
|
+
|
34
|
+
### What demo affects
|
35
|
+
|
36
|
+
* A list of files, packages, services, or operations that the module will alter,
|
37
|
+
impact, or execute on the system it's installed on.
|
38
|
+
* This is a great place to stick any warnings.
|
39
|
+
* Can be in list or paragraph form.
|
40
|
+
|
41
|
+
### Setup Requirements **OPTIONAL**
|
42
|
+
|
43
|
+
If your module requires anything extra before setting up (pluginsync enabled,
|
44
|
+
etc.), mention it here.
|
45
|
+
|
46
|
+
### Beginning with demo
|
47
|
+
|
48
|
+
The very basic steps needed for a user to get the module up and running.
|
49
|
+
|
50
|
+
If your most recent release breaks compatibility or requires particular steps
|
51
|
+
for upgrading, you may wish to include an additional section here: Upgrading
|
52
|
+
(For an example, see http://forge.puppetlabs.com/puppetlabs/firewall).
|
53
|
+
|
54
|
+
## Usage
|
55
|
+
|
56
|
+
Put the classes, types, and resources for customizing, configuring, and doing
|
57
|
+
the fancy stuff with your module here.
|
58
|
+
|
59
|
+
## Reference
|
60
|
+
|
61
|
+
Here, list the classes, types, providers, facts, etc contained in your module.
|
62
|
+
This section should include all of the under-the-hood workings of your module so
|
63
|
+
people know what the module is touching on their system but don't need to mess
|
64
|
+
with things. (We are working on automating this section!)
|
65
|
+
|
66
|
+
## Limitations
|
67
|
+
|
68
|
+
This is where you list OS compatibility, version compatibility, etc.
|
69
|
+
|
70
|
+
## Development
|
71
|
+
|
72
|
+
Since your module is awesome, other users will want to play with it. Let them
|
73
|
+
know what the ground rules for contributing are.
|
74
|
+
|
75
|
+
## Release Notes/Contributors/Etc **Optional**
|
76
|
+
|
77
|
+
If you aren't using changelog, put your release notes here (though you should
|
78
|
+
consider using changelog). You may also add any additional sections you feel are
|
79
|
+
necessary or important to include here. Please use the `## ` header.
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'puppetlabs_spec_helper/rake_tasks'
|
3
|
+
require 'puppet-lint/tasks/puppet-lint'
|
4
|
+
PuppetLint.configuration.send('disable_80chars')
|
5
|
+
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]
|
6
|
+
|
7
|
+
desc "Validate manifests, templates, and ruby files"
|
8
|
+
task :validate do
|
9
|
+
Dir['manifests/**/*.pp'].each do |manifest|
|
10
|
+
sh "puppet parser validate --noop #{manifest}"
|
11
|
+
end
|
12
|
+
Dir['spec/**/*.rb','lib/**/*.rb'].each do |ruby_file|
|
13
|
+
sh "ruby -c #{ruby_file}" unless ruby_file =~ /spec\/fixtures/
|
14
|
+
end
|
15
|
+
Dir['templates/**/*.erb'].each do |template|
|
16
|
+
sh "erb -P -x -T '-' #{template} | ruby -c"
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
this is where module code would live
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# == Class: demo
|
2
|
+
#
|
3
|
+
# Full description of class demo here.
|
4
|
+
#
|
5
|
+
# === Parameters
|
6
|
+
#
|
7
|
+
# Document parameters here.
|
8
|
+
#
|
9
|
+
# [*sample_parameter*]
|
10
|
+
# Explanation of what this parameter affects and what it defaults to.
|
11
|
+
# e.g. "Specify one or more upstream ntp servers as an array."
|
12
|
+
#
|
13
|
+
# === Variables
|
14
|
+
#
|
15
|
+
# Here you should define a list of variables that this module would require.
|
16
|
+
#
|
17
|
+
# [*sample_variable*]
|
18
|
+
# Explanation of how this variable affects the funtion of this class and if
|
19
|
+
# it has a default. e.g. "The parameter enc_ntp_servers must be set by the
|
20
|
+
# External Node Classifier as a comma separated list of hostnames." (Note,
|
21
|
+
# global variables should be avoided in favor of class parameters as
|
22
|
+
# of Puppet 2.6.)
|
23
|
+
#
|
24
|
+
# === Examples
|
25
|
+
#
|
26
|
+
# class { 'demo':
|
27
|
+
# servers => [ 'pool.ntp.org', 'ntp.local.company.com' ],
|
28
|
+
# }
|
29
|
+
#
|
30
|
+
# === Authors
|
31
|
+
#
|
32
|
+
# Author Name <author@domain.com>
|
33
|
+
#
|
34
|
+
# === Copyright
|
35
|
+
#
|
36
|
+
# Copyright 2015 Your name here, unless otherwise noted.
|
37
|
+
#
|
38
|
+
class demo {
|
39
|
+
|
40
|
+
|
41
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"name": "user-demo",
|
3
|
+
"version": "0.0.1",
|
4
|
+
"author": "alice.nodelman",
|
5
|
+
"summary": "For use in testing beaker.",
|
6
|
+
"license": "Apache 2.0",
|
7
|
+
"source": "no_source",
|
8
|
+
"project_page": "no_page",
|
9
|
+
"issues_url": "no_url",
|
10
|
+
"dependencies": [
|
11
|
+
{"name":"puppetlabs-stdlib","version_requirement":">= 1.0.0"}
|
12
|
+
]
|
13
|
+
}
|
14
|
+
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'spec_helper_acceptance'
|
2
|
+
|
3
|
+
describe "my tests" do
|
4
|
+
|
5
|
+
# an example using the beaker DSL
|
6
|
+
# use http://www.rubydoc.info/github/puppetlabs/beaker/Beaker/DSL
|
7
|
+
it "should say hello!" do
|
8
|
+
result = shell( 'echo hello' )
|
9
|
+
expect(result.stdout).to match(/hello/)
|
10
|
+
end
|
11
|
+
|
12
|
+
# an example using Serverspec
|
13
|
+
# use http://serverspec.org/resource_types.html
|
14
|
+
describe package('puppet') do
|
15
|
+
it { should be_installed }
|
16
|
+
end
|
17
|
+
|
18
|
+
it "can create and confirm a file" do
|
19
|
+
shell( 'rm -f demo.txt' )
|
20
|
+
create_remote_file(default, 'demo.txt', 'foo\nfoo\nfoo\n')
|
21
|
+
shell( 'grep foo demo.txt' )
|
22
|
+
shell( 'grep bar demo.txt', :acceptable_exit_codes => [1] )
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should be able to apply manifests" do
|
26
|
+
manifest_1 = "user {'foo':
|
27
|
+
ensure => present,}"
|
28
|
+
manifest_2 = "user {'foo':
|
29
|
+
ensure => absent,}"
|
30
|
+
manifest_3 = "user {'root':
|
31
|
+
ensure => present,}"
|
32
|
+
apply_manifest( manifest_1, :expect_changes => true )
|
33
|
+
apply_manifest( manifest_2, :expect_changes => true )
|
34
|
+
apply_manifest( manifest_3 )
|
35
|
+
end
|
36
|
+
|
37
|
+
describe service('sshd') do
|
38
|
+
it { should be_running }
|
39
|
+
end
|
40
|
+
|
41
|
+
describe user('root') do
|
42
|
+
it { should exist }
|
43
|
+
end
|
44
|
+
|
45
|
+
describe user('foo') do
|
46
|
+
it { should_not exist }
|
47
|
+
end
|
48
|
+
|
49
|
+
context "can use both serverspec and Beaker DSL" do
|
50
|
+
|
51
|
+
it "can create a file" do
|
52
|
+
shell( 'rm -f /tmp/demo.txt' )
|
53
|
+
manifest = "file {'demofile':
|
54
|
+
path => '/tmp/demo.txt',
|
55
|
+
ensure => present,
|
56
|
+
mode => 0640,
|
57
|
+
content => \"this is my file.\",
|
58
|
+
}"
|
59
|
+
apply_manifest(manifest, :expect_changes => true)
|
60
|
+
end
|
61
|
+
|
62
|
+
describe file('/tmp/demo.txt') do
|
63
|
+
it { should be_file }
|
64
|
+
end
|
65
|
+
|
66
|
+
describe file('/tmp/demo.txt') do
|
67
|
+
it { should contain 'this is my file.' }
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
|
72
|
+
end
|