beaker 1.7.0 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YjhhNzM3MzA5MGZmZTdjMDg5MGI1YmVlMDY1ZGI2NWFmMTUyZGE5YQ==
5
- data.tar.gz: !binary |-
6
- MTgxNDk2NTBkMWY0NzA2MDc0NGIwMjQzM2IxZjBlY2M0NGE3NWYxMA==
2
+ SHA1:
3
+ metadata.gz: 0ddacb87bc81e8c3dd6202f72ae3a473ceccbc7c
4
+ data.tar.gz: 60a5fad777e858fd5c513e77d0ead137b4b2c92e
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YWQ0ZGI3Yzk2NmQ5NDdlZDUzMmJkMzFiOGUyNjk0MzFkNmEwNjBlN2FhYTZj
10
- N2I3NjM3Zjk1NDM5MjhjMWEwZWFjNTQxZWFjNTljMDllZjA3NjAzZmUyMzg4
11
- ZThiMzBmM2U1ZjYxN2I0ZDUxYWIwNThhNzAxYTQxZjAyZWE0MGY=
12
- data.tar.gz: !binary |-
13
- ZWQwYmYxMGIxZjliYjA4NTNkZmZlNjI0MWEzNjcxNDI1ZGNlMDk0NDcyODg4
14
- ZDI0MDdiMmZhNzE4NDY4ZGE3MDQwMTZlOTRjNjQ4M2ZiMmQzZmE4NDlhNTY0
15
- ZWQzYTgyMThmYzNlYTkwZWYzNTliM2RmZjJlMzlmOGZkYTA3NDg=
6
+ metadata.gz: 8c2717c7c3f89852e420a3ccca43aa50cc906507f32cb1cd13ebb8c107fdaa28e27b9817da35333b68d3363e75906811a4a801092404df461102de7e027def31
7
+ data.tar.gz: 272665c288104489682261fec3928c6fce951adfb523b9cdd87f07066f92527ed6c78a6e4ce3a9b96fb53973e445212dbb183fa046fbb34d6bb73daa493da784
data/README.md CHANGED
@@ -1,385 +1,24 @@
1
- # Running the Distributed Test Harness #
1
+ # Beaker
2
2
 
3
- ## Install the harness on your 'Test Driver' ##
4
- How to install the test harness on your workstation:
3
+ Puppet Labs cloud enabled acceptance testing tool.
5
4
 
6
- Pre-requisites: Ruby 1.8.7+
5
+ #Documentation
7
6
 
8
- Automagically:
7
+ Documentation for Beaker can be found online at the
8
+ [Beaker Wiki](https://github.com/puppetlabs/beaker/wiki).
9
9
 
10
- git clone https://github.com/puppetlabs/beaker.git
11
- bundle install
10
+ #Beaker API
12
11
 
13
- Manually:
12
+ [RubyDoc Beaker Documentation Server](http://rubydoc.info/github/puppetlabs/beaker/frames)
14
13
 
15
- git clone https://github.com/puppetlabs/beaker.git
16
- gem install rubygems net-ssh net-scp systemu
14
+ #License
17
15
 
16
+ See [LICENSE](LICENSE) file.
18
17
 
19
- ## Configure Systems Under Test ##
20
- Running Systest requires at least one 'System Under Test' (SUT) upon which to run tests.
18
+ #Support
21
19
 
22
- System Under Test
23
- - SUT may be physical, virtual; local or remote.
24
- - The SUT will need a properly configured network and DNS or hosts file.
25
- - On the SUT, you must configure pass through ssh auth for the root user.
26
- - The SUT must have the "ntpdate" binary installed
27
- - The SUT must have the "curl" binary installed
28
- - On Windows, Cygwin must be installed (with curl, sshd, bash) and the necessary
29
- windows gems (sys-admin, win32-dir, etc).
30
- - FOSS install: you must have git, ruby, rdoc installed on your SUT.
31
- - PE install: PE will install git, ruby, rdoc.
20
+ Please log tickets and issues at our [Beaker Issue Tracker](https://github.com/puppetlabs/beaker/issues). In addition there is an active #puppet-dev channel on Freenode.
32
21
 
33
-
34
- ## Prepare a Test Configuration File ##
35
- - The test harness is configuration driven
36
- - The config file is yaml formatted
37
- - The type of insallation and configuration is dictated by the config file, especially for PE
38
-
39
- Here we have the host 'ubuntu-1004-64', a 64 bit Ubuntu box, serving as Puppet Master,
40
- Dashboard, and Agent; the host "ubuntu-1004-32", a 32-bit Ubunutu node, will be a
41
- Puppet Agent only. The Dashboard will be configured to run HTTPS on port 443.
42
-
43
- HOSTS:
44
- ubuntu-1004-64:
45
- roles:
46
- - master
47
- - agent
48
- - dashboard
49
- platform: ubuntu-10.04-amd64
50
- hypervisor: fusion
51
- snapshot: clean
52
- ubuntu-1004-32:
53
- roles:
54
- - agent
55
- platform: ubuntu-10.04-i386
56
- hypervisor: fusion
57
- snaphost: clean
58
- CONFIG:
59
- consoleport: 443
60
-
61
- You can setup a very different test scenario by simply re-arranging the "roles":
62
-
63
- HOSTS:
64
- ubuntu-1004-64:
65
- roles:
66
- - dashboard
67
- - agent
68
- platform: ubuntu-10.04-amd64
69
- hypervisor: fusion
70
- snapshot: clean
71
- ubuntu-1004-32:
72
- roles:
73
- - master
74
- - agent
75
- platform: ubuntu-10.04-i386
76
- hypervisor: fusion
77
- snapshot: clean
78
- CONFIG:
79
- consoleport: 443
80
-
81
- In this case, the host 'ubuntu-1004-32' is now the Puppet Master, while 'ubuntu-1004-64' is the
82
- Puppet Dashboard host, resulting in a split Master/Dashboard install. Systest will automagically
83
- prepare an appropriate answers file for use with the PE Installer.
84
-
85
- ## Required Host Settings ##
86
- To properly define a host you must provide:
87
-
88
- * name
89
- * The string identifying this host
90
- * platform
91
- * One of the Beaker supported platforms
92
-
93
- ## Optional Host Settings ##
94
- Additionaly, Beaker supports the following host options:
95
-
96
- * ip
97
- * the IP address of the SUT
98
- * hypervisor
99
- * one of `solaris`, `blimpy`, `vsphere`, `fusion`, `aix`, `vcloud` or `vagrant`
100
- * additional settings may be required depending on the selected hypervisor (ie, template, box, box_url, etc). Check the documentation below for your hypervisor for details
101
- * snapshot
102
- * the name of the snapshot to revert to before testing
103
- * roles
104
- * the 'job' of this host, an array of `master`, `agent`, `frictionless`, `dashboard`, `database`, `default` or any user-defined string
105
- * pe_dir
106
- * the directory where PE builds are located, may be local directory or a URL
107
- * pe_ver
108
- * the version number of PE to install
109
-
110
-
111
- ## Supported Platforms ##
112
- Beaker depends upon each host in the configuration file having a platform type that is correctly formatted and supported. The platform is used to determine how various operations are carried out internally (such as installing packages using the correct package manager for the given operating system).
113
-
114
- The platform's format is `/^OSFAMILY-VERSION-ARCH.*$/` where `OSFAMILY` is one of:
115
-
116
- * centos
117
- * fedora
118
- * debian
119
- * oracle
120
- * redhat
121
- * scientific
122
- * sles
123
- * ubuntu
124
- * windows
125
- * solaris
126
- * aix
127
- * el
128
-
129
- `VERSION`'s format is not enforced, but should reflect the `OSFAMILY` selected (ie, ubuntu-1204-i386-master, scientific-6-i386-agent, etc). `ARCH`'s format is also not enforced, but should be appropriate to the `OSFAMILY` selected (ie, ubuntu-1204-i386-master, sles-11-x86_64-master, debian-7-amd64-master, etc).
130
-
131
- # Provisioning #
132
- Systest has built in capabilites for managing VMs and provisioning SUTs:
133
-
134
- * VMWare vSphere via the RbVmomi gem
135
- * VMWare Fusion via the Fission gem
136
- * EC2 via blimpy
137
- * Solaris zones via SSHing to the global zone
138
- * Vagrant
139
-
140
- You may mix and match hypervisors as needed. Hypervisors and snapshot names are defined per-host in the node configuration file. Default behavior for Vagrant, vSphere and EC2 is to powerdown/terminate test instances on a successful run. This can be altered with the `--preserve-hosts` option.
141
- `--provision` indicates that you want to provision and revert VMs to snapshot before test execution, defaults to true. Use `--no-provision` to skip provisioning and reverting before test execution.
142
-
143
-
144
- For example:
145
-
146
-
147
- $ cat configs/my_hosts.yml
148
- lucid-alpha:
149
- roles:
150
- - master
151
- - agent
152
- platform: ubuntu-10.04-i386
153
- hypervisor: fusion
154
- snapshot: foss
155
- provision: false
156
- shared-host-in-the-cloud:
157
- roles:
158
- - agent
159
- platform: ubuntu-10.04-i386
160
- hypervisor: vsphere
161
- snaphost: base
162
-
163
- $ ./beaker.rb --config configs/my_hosts.yml ....
164
-
165
-
166
- ## VMWare Fusion support ##
167
- Pre-requisite: Fission gem installed and configured, including a `~/.fissionrc`
168
- that points to the `vmrun` executable and where virtual machines can be found.
169
- Example `.fissionrc` file (it's YAML):
170
-
171
- vm_dir: "/Directory/containing/my/.vmwarevm/files/"
172
- vmrun_bin: "/Applications/VMware Fusion.app/Contents/Library/vmrun"
173
-
174
- You can then use the following arguments in the node configuration:
175
- - `hypervisor: fusion` tells us to enable this feature for this host. This is required.
176
- - `snapshot: <name>`, where <name> is the snapshot name to revert to. This is required.
177
-
178
- We'll try and match up the hostname with a VM of the same name. Note that the VM is expected to be pre-configured for running acceptance tests; it should have all the right prerequisite libraries, password-less SSH access for root, etc.
179
-
180
- There are a few additional options available in your configuration file. Each host
181
- section can now use:
182
-
183
- - `vmname`: This is useful if the hostname of the VM doesn't match the name of
184
- the `.vmwarevm` file on disk. The alias should be something fission can load.
185
-
186
-
187
- Example:
188
-
189
- HOSTS:
190
- pe-debian6:
191
- roles:
192
- - master
193
- - agent
194
- platform: debian-6-i386
195
- vmname: super-awesome-vm-name
196
- hypervisor: fusion
197
- snapshot: acceptance-testing-5
198
-
199
- Diagnostics:
200
-
201
- When using `hypervisor fusion`, we'll log all the available VM names and for each
202
- host we'll log all the available snapshot names.
203
-
204
- ## EC2 Support ##
205
- Pre-requisite: Blimpy gem installed and .fog file correctly configured with your credentials.
206
-
207
- hypervisor: blimpy
208
-
209
- Currently, there is limited support EC2 nodes; we are adding support for new platforms shortly.
210
-
211
- AMIs are built for PE based installs on:
212
- - Enterprize Linux 6, 64 and 32 bit
213
- - Enterprize Linux 5, 32 bit
214
- - Ubuntu 10.04, 32 bit
215
-
216
- Systest will automagically provision EC2 nodes, provided the 'platform:' section of your config file lists a supported platform type: ubuntu-10.04-i386, el-6-x86_64, el-6-i386, el-5-i386.
217
-
218
- ## Solaris Support ##
219
-
220
- Used with `hypervisor: solaris`, the harness can connect to a Solaris host via SSH and revert zone snapshots.
221
-
222
- Example .fog file:
223
-
224
- :default:
225
- :solaris_hypervisor_server: solaris.example.com
226
- :solaris_hypervisor_username: harness
227
- :solaris_hypervisor_keyfile: /home/jenkins/.ssh/id_rsa-harness
228
- :solaris_hypervisor_vmpath: rpool/zoneds
229
- :solaris_hypervisor_snappaths:
230
- - rpool/ROOT/solaris
231
-
232
- ## vSphere Support ##
233
-
234
- The harness can use vms and snapshots that live within vSphere as well.
235
- To do this create a `~/.fog` file with your vSphere credentials:
236
-
237
- Example:
238
-
239
- :default:
240
- :vsphere_server: 'vsphere.example.com'
241
- :vsphere_username: 'joe'
242
- :vsphere_password: 'MyP@$$w0rd'
243
-
244
-
245
- These follow the conventions used by Cloud Provisioner and Fog.
246
-
247
- There are two possible `hypervisor` hypervisor-types to use for vSphere testing, `vsphere` and `vcloud`.
248
-
249
- ### `hypervisor: vsphere`
250
- This option locates an existing static VM, optionally reverts it to a pre-existing snapshot, and runs tests on it.
251
-
252
- ### `hypervisor: vcloud`
253
- This option clones a new VM from a pre-existing template, runs tests on the newly-provisioned clone, then deletes the clone once testing completes.
254
-
255
- The `vcloud` option requires a slightly-modified test configuration file, specifying both the target template as well as three additional parameters in the 'CONFIG' section ('datastore', 'resourcepool', and 'folder').
256
-
257
- HOSTS:
258
- master-vm:
259
- roles:
260
- - master
261
- - agent
262
- - dashboard
263
- platform: ubuntu-10.04-amd64
264
- template: ubuntu-1004-x86_64
265
- hypervisor: vcloud
266
- agent-vm:
267
- roles:
268
- - agent
269
- platform: ubuntu-10.04-i386
270
- template: ubuntu-1004-i386
271
- hypervisor: vcloud
272
- CONFIG:
273
- consoleport: 443
274
- datastore: instance0
275
- resourcepool: Delivery/Quality Assurance/FOSS/Dynamic
276
- folder: delivery/Quality Assurance/FOSS/Dynamic
277
-
278
-
279
- ## Vagrant support ##
280
- The option allows for testing against local Vagrant boxes. As a prerequisite the Vagrant package (greather than 1.1) needs to installed - see <a href = "http://downloads.vagrantup.com/">downloads.vagrantup.com</a> for downloads.
281
-
282
- The vm is identified by `box` or `box_url` in the config file. No snapshot name is required as the vm is reverted back to original state post testing using `vagrant destroy --force`.
283
-
284
- HOSTS:
285
- ubuntu-10-04-4-x64:
286
- roles:
287
- - master
288
- - agent
289
- - dashboard
290
- - cloudpro
291
- platform: ubuntu-10.04.4-x64
292
- hypervisor: vagrant
293
- box: ubuntu-server-10044-x64-vbox4210
294
- box_url: http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-10044-x64-vbox4210.box
295
- CONFIG:
296
- nfs_server: none
297
- consoleport: 443
298
-
299
- VagrantFiles are created per host configuration file. They can be found in the `.vagrant/beaker_vagrant_files` directory of the current working directory in a subdirectory named after the host configuration file.
300
-
301
- > beaker --hosts sample.cfg
302
- > cd .vagrant/beaker_vagrant_files; ls
303
- sample.cfg
304
- > cd sample.cfg; ls
305
- VagrantFile
306
-
307
- # Putting it all together #
308
-
309
- ## Running FOSS tests ##
310
- Puppet FOSS Acceptance tests are stored in their respective Puppet repository, so
311
- you must check out the tests first, then the harness, as such:
312
-
313
- ### Checkout the tests
314
- git://github.com/puppetlabs/puppet.git
315
- cd puppet
316
- ### Checkout the harness
317
- git clone git://github.com/puppetlabs/beaker.git
318
- cd beaker
319
- ln -s ../acceptance acceptance-tests
320
- ### Run the tests
321
- ./beaker.rb -c ci/ci-${platform}.cfg --type git -p origin/2.7rc -f 1.5.8 -t acceptance-tests/tests --no-color --xml --debug --pre-suite setup/git/
322
-
323
-
324
- ## Running PE tests ##
325
-
326
- When performing a PE install, Systest expects to find PE tarballs and a LATEST file in /opt/enterprise/dists; the LATEST file
327
- indicates the version string of the most recent tarball.
328
-
329
- $ [topo@gigio ]$ cat /opt/enterprise/dists/LATEST
330
- 2.5.3
331
-
332
- $ [topo@gigio ]$ ls -1 /opt/enterprise/dists
333
- LATEST
334
- puppet-enterprise-2.5.3-debian-6-amd64.tar.gz
335
- <snip>
336
- puppet-enterprise-2.5.3-ubuntu-12.04-i386.tar.gz
337
-
338
- You can also install from git. Use the `--install` option, which can install puppet along with other infrastructure. This option supports the following URI formats:
339
-
340
- - `PATH`: A full and complete path to a git repository
341
-
342
- --install git://github.com/puppetlabs/puppet#stable
343
-
344
- - `KEYWORD/name`: The name of the branch of KEYWORD git repository. Supported keywords are `PUPPET`, `FACTER`, `HIERA` and `HIERA-PUPPET`.
345
-
346
- --install PUPPET/3.1.0
347
-
348
- ### Checkout your tests
349
- git clone git@github.com:your/test_repo.git
350
- cd test_repo
351
- ### Checkout the harness
352
- git clone git@github.com:puppetlabs/beaker.git
353
- cd beaker
354
- ### Pre-suite and Post-suite
355
- The harness command line supports `--pre-suite` and `--post-suite`. `--pre-suite` describes steps to take after initial provisioning/configuring of the vms under test before the tests are run. `--post-suite` steps are run directly after tests.
356
-
357
- Both options support directories, individual files and comma separated lists of directories and files. Given a directory it will look for files of the type `*.rb` within that directory. Steps will be run in the order they appear in on the command line. Directories of steps will be run in alphabetic order of the `*.rb` files within the directory.
358
-
359
- --pre-suite setup/early/mystep.rb,setup/early/mydir
360
- ### Run the tests
361
- bundle exec beaker.rb -c your_config.cfg --type pe -t test_repo/tests --debug
362
-
363
- ### Failure management
364
- By default if a test fails the harness will move on and attempt the next test in the suite. This may be undesirable when debugging. The harness supports an optional `--fail-mode` to alter the default behavior on failure:
365
-
366
- - `fast`: After first failure do not test any subsequent tests in the given suite, simply run cleanup steps and then exit gracefully. This option short circuits test execution while leaving you with a clean test environment for any follow up testing.
367
-
368
- - `stop`: After first failure do not test any subsequent tests in the given suite, do not run any cleanup steps, exit immediately. This is useful while testing setup steps or if you plan to revert the test environment before every test.
369
-
370
- ## Topic branches, special test repo
371
- bundle exec beaker.rb -c your_cfg.cfg --debug --type git -p 2.7.x -f 1.5.8 -t path-to-your-tests
372
-
373
- path-to-test:
374
- If you are testing on FOSS, the test for each branch can be found in the puppet repo under acceptance/tests
375
-
376
- Special topic branch checkout with a targeted test:
377
-
378
- bundle exec beaker.rb -c your_cfg --type git -p https://github.com/SomeDude/puppet/tree/ticket/2.6.next/6856-dangling-symlinks -f 1.5.8 /
379
-
380
-
381
- ## Making extensions to the harness using `--load-path`
382
-
383
- You may need to extend the harness DSL (data specific language) to handle your particular test case. To run the harness with an addition to the LOAD_PATH use `--load-path`. You can specify a single directory or a comma separated list of directories to be added.
384
-
385
- bundle exec beaker.rb --debug --config ubuntu1004-32mda.cfg --tests ../puppet/acceptance/tests/resource/cron/should_allow_changing_parameters.rb --fail fast --root-keys --type pe --load-path ../puppet/acceptance/lib/
22
+ We use semantic version numbers for our releases, and recommend that users stay
23
+ as up-to-date as possible by upgrading to patch releases and minor releases as
24
+ they become available.
@@ -1,7 +1,7 @@
1
1
  require 'rubygems' unless defined?(Gem)
2
2
  module Beaker
3
3
 
4
- %w( version utils test_suite result command options network_manager cli ).each do |lib|
4
+ %w( version platform utils test_suite result command options network_manager cli ).each do |lib|
5
5
  begin
6
6
  require "beaker/#{lib}"
7
7
  rescue LoadError
@@ -25,7 +25,7 @@ module Beaker
25
25
  def self.answers(version, hosts, master_certname, options)
26
26
 
27
27
  case version
28
- when /\A3\.2/
28
+ when /\A3\.[2-3]/
29
29
  Version32.answers(hosts, master_certname, options)
30
30
  when /\A3\.1/
31
31
  Version30.answers(hosts, master_certname, options)
@@ -116,6 +116,7 @@ module Beaker
116
116
  master = only_host_with_role(hosts, 'master')
117
117
  hosts.each do |h|
118
118
  the_answers[h.name] = host_answers(h, master_certname, master, dashboard, options)
119
+ h[:answers] = the_answers[h.name]
119
120
  end
120
121
  return the_answers
121
122
  end
@@ -115,7 +115,8 @@ module Beaker
115
115
  dashboard = only_host_with_role(hosts, 'dashboard')
116
116
  master = only_host_with_role(hosts, 'master')
117
117
  hosts.each do |h|
118
- the_answers[h.name] = host_answers(h, master_certname, master, dashboard, options)
118
+ the_answers[h.name] = host_answers(h, master_certname, master, dashboard, options)
119
+ h[:answers] = the_answers[h.name]
119
120
  end
120
121
  return the_answers
121
122
  end