beaker 3.35.0 → 3.36.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +32 -9
- data/CHANGELOG.md +15 -1
- data/CONTRIBUTING.md +37 -31
- data/DOCUMENTING.md +68 -44
- data/README.md +14 -31
- data/acceptance/tests/base/dsl/helpers/host_helpers/curl_on_test.rb +3 -3
- data/beaker.gemspec +1 -1
- data/docs/README.md +5 -12
- data/docs/concepts/beaker_libraries.md +2 -2
- data/docs/concepts/glossary.md +11 -0
- data/docs/concepts/style_guide.md +24 -91
- data/docs/concepts/test_tagging.md +3 -10
- data/docs/concepts/testing_beaker_itself.md +3 -2
- data/docs/concepts/ticket_process.md +17 -45
- data/docs/how_to/archive_sut_files.md +7 -33
- data/docs/how_to/change_terminal_output_coloring.md +7 -4
- data/docs/how_to/confine.md +5 -16
- data/docs/how_to/debug_beaker_tests.md +14 -6
- data/docs/how_to/hosts/README.md +2 -5
- data/docs/how_to/hosts/archlinux.md +4 -2
- data/docs/how_to/hosts/cisco.md +9 -30
- data/docs/how_to/hosts/eos.md +5 -14
- data/docs/how_to/hypervisors/README.md +9 -31
- data/docs/how_to/install_puppet.md +16 -51
- data/docs/how_to/platform_specific_tag_confines.md +11 -31
- data/docs/how_to/preserve_hosts.md +13 -54
- data/docs/how_to/rake_tasks.md +1 -4
- data/docs/how_to/recipes.md +9 -2
- data/docs/how_to/run_in_parallel.md +10 -10
- data/docs/how_to/ssh_agent_forwarding.md +8 -13
- data/docs/how_to/ssh_connection_preference.md +10 -10
- data/docs/how_to/test_arbitrary_beaker_versions.md +5 -12
- data/docs/how_to/the_beaker_dsl.md +44 -21
- data/docs/how_to/upgrade_from_2_to_3.md +13 -53
- data/docs/how_to/use_hocon_helpers.md +10 -28
- data/docs/how_to/use_user_password_authentication.md +13 -10
- data/docs/how_to/write_a_beaker_test_for_a_module.md +6 -2
- data/docs/tutorials/README.md +14 -55
- data/docs/tutorials/creating_a_test_environment.md +47 -52
- data/docs/tutorials/installation.md +57 -21
- data/docs/tutorials/lets_write_a_test.md +8 -1
- data/docs/tutorials/quick_start_rake_tasks.md +63 -62
- data/docs/tutorials/subcommands.md +19 -32
- data/docs/tutorials/test_run.md +14 -16
- data/docs/tutorials/test_suites.md +14 -43
- data/docs/tutorials/the_command_line.md +14 -2
- data/lib/beaker/host/unix/pkg.rb +9 -2
- data/lib/beaker/host_prebuilt_steps.rb +1 -1
- data/lib/beaker/shared/host_manager.rb +6 -3
- data/lib/beaker/version.rb +1 -1
- data/spec/beaker/host/unix/pkg_spec.rb +66 -17
- data/spec/beaker/host/unix_spec.rb +4 -4
- data/spec/beaker/host_prebuilt_steps_spec.rb +10 -6
- data/spec/beaker/hypervisor/hypervisor_spec.rb +2 -2
- data/spec/beaker/shared/host_manager_spec.rb +8 -0
- metadata +9 -2
@@ -1,80 +1,40 @@
|
|
1
1
|
# How To Upgrade from 2.y to 3.0
|
2
2
|
|
3
|
-
This is a guide detailing all the issues to be aware of, and to help people make
|
4
|
-
any changes that you might need to move from beaker 2.y to 3.0. To test out
|
5
|
-
beaker 3.0.0, we recommend implementing the strategy outlined [here](test_arbitrary_beaker_versions.md)
|
6
|
-
to ensure this new major release does not break your existing testing.
|
3
|
+
This is a guide detailing all the issues to be aware of, and to help people make any changes that you might need to move from beaker 2.y to 3.0. To test out beaker 3.0.0, we recommend implementing the strategy outlined [here](test_arbitrary_beaker_versions.md) to ensure this new major release does not break your existing testing.
|
7
4
|
|
8
5
|
## Ruby version 1.9.3 no longer supported
|
9
6
|
|
10
|
-
Official support for 1.9.3 has been eol'd since Feb 2015; the beaker 3.0.0 release
|
11
|
-
drops support for ruby 1.9.3 and will not install with ruby 1.9.3. We suggest using
|
12
|
-
ruby >= 2.2.5, as that is the version we currently test and support at Puppet.
|
7
|
+
Official support for 1.9.3 has been eol'd since Feb 2015; the beaker 3.0.0 release drops support for ruby 1.9.3 and will not install with ruby 1.9.3. We suggest using ruby >= 2.2.5, as that is the version we currently test and support at Puppet.
|
13
8
|
|
14
9
|
## Locally Cached Files
|
15
10
|
|
16
11
|
This is a change of the `:cache_files_locally` preset from `true` to `false`.
|
17
12
|
|
18
|
-
At this time, the `:cache_files_locally` setting only affects the
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
If a file with the same destination name already exists on the coordinator,
|
25
|
-
Beaker would not fetch the file and use the cached copy instead. In general,
|
26
|
-
this wasn't a big problem because we typically have our version numbers in our
|
27
|
-
install artifacts, so file name matching is enough. In our Windows MSI
|
28
|
-
installers, however, we would many times not have versions built into the file
|
29
|
-
name. Since that's the case, you could get an old version installed because it
|
30
|
-
was already on your coordinator filesystem. The `:cache_files_locally` setting
|
31
|
-
allows you to set whether you want to use a local file cache, or get fresh
|
32
|
-
installers every time. This setting is now set to false, and will get installers
|
33
|
-
from the online source every time.
|
34
|
-
|
35
|
-
If you'd like to keep this setting the way it was in 2.y, then just set the
|
36
|
-
global option `:cache_files_locally` to `false`. Checkout the
|
37
|
-
[Argument Processing and Precedence](../concepts/argument_processing_and_precedence.md)
|
38
|
-
doc for info on how to do this.
|
13
|
+
At this time, the `:cache_files_locally` setting only affects the [`fetch_http_file` method](https://github.com/puppetlabs/beaker/blob/master/lib/beaker/dsl/helpers/web_helpers.rb#L44). This is an internal method used in both Puppet Enterprise (PE) and Open Source Puppet install helpers to download files from the internet to the Beaker coordinator.
|
14
|
+
|
15
|
+
If a file with the same destination name already exists on the coordinator, Beaker would not fetch the file and use the cached copy instead. In general, this wasn't a big problem because we typically have our version numbers in our install artifacts, so file name matching is enough. In our Windows MSI installers, however, we would many times not have versions built into the file name. Since that's the case, you could get an old version installed because it was already on your coordinator filesystem. The `:cache_files_locally` setting allows you to set whether you want to use a local file cache, or get fresh installers every time. This setting is now set to false, and will get installers from the online source every time.
|
16
|
+
|
17
|
+
If you'd like to keep this setting the way it was in 2.y, then just set the global option `:cache_files_locally` to `false`. Checkout the [Argument Processing and Precedence](../concepts/argument_processing_and_precedence.md) doc for info on how to do this.
|
39
18
|
|
40
19
|
## EPEL package update
|
41
20
|
|
42
|
-
In beaker < 3.0.0, the epel package names had hardcoded defaults listed in the
|
43
|
-
presets default; in beaker >= 3.0.0, beaker utilizes the `release-latest` file
|
44
|
-
provided on epel mirrors for el versions 5, 6, and 7. Since only the latest epel
|
45
|
-
packages are available on epel mirrors, beaker only supports installation of
|
46
|
-
that latest version.
|
21
|
+
In beaker < 3.0.0, the epel package names had hardcoded defaults listed in the presets default; in beaker >= 3.0.0, beaker utilizes the `release-latest` file provided on epel mirrors for el versions 5, 6, and 7. Since only the latest epel packages are available on epel mirrors, beaker only supports installation of that latest version.
|
47
22
|
|
48
23
|
## Solaris and AIX Hypervisors removed
|
49
24
|
|
50
|
-
Special cased hypervisor support for Solaris and AIX have been removed in favor
|
51
|
-
of a `hypervisor=none` workflow where the provisioning of SUTs is handled separately
|
52
|
-
outside of beaker itself. Solaris and AIX are still of course supported as `platform`
|
53
|
-
strings; only these special-cased hypervisors have been removed.
|
25
|
+
Special cased hypervisor support for Solaris and AIX have been removed in favor of a `hypervisor=none` workflow where the provisioning of SUTs is handled separately outside of beaker itself. Solaris and AIX are still of course supported as `platform` strings; only these special-cased hypervisors have been removed.
|
54
26
|
|
55
27
|
## Environment Variable DSL Methods
|
56
28
|
|
57
|
-
In [BKR-914](https://tickets.puppetlabs.com/browse/BKR-914) we fixed our host
|
58
|
-
methods that deal with environment variables (
|
59
|
-
[#add_env_var](http://www.rubydoc.info/github/puppetlabs/beaker/Unix/Exec#add_env_var-instance_method),
|
60
|
-
[#get_env_var](http://www.rubydoc.info/github/puppetlabs/beaker/Unix/Exec#get_env_var-instance_method),
|
61
|
-
and
|
62
|
-
[#clear_env_var](http://www.rubydoc.info/github/puppetlabs/beaker/Unix/Exec#clear_env_var-instance_method)).
|
29
|
+
In [BKR-914](https://tickets.puppetlabs.com/browse/BKR-914) we fixed our host methods that deal with environment variables ( [#add_env_var](http://www.rubydoc.info/github/puppetlabs/beaker/Unix/Exec#add_env_var-instance_method), [#get_env_var](http://www.rubydoc.info/github/puppetlabs/beaker/Unix/Exec#get_env_var-instance_method), and [#clear_env_var](http://www.rubydoc.info/github/puppetlabs/beaker/Unix/Exec#clear_env_var-instance_method)).
|
63
30
|
|
64
|
-
Before, these methods used regular expressions that were too loose. This means
|
65
|
-
that in an example of a call like `get_env_var('abc')`, the environment variables
|
66
|
-
`abc=123`, `xx_abc_xx=123`, and `123=abc` would all be matched, where the intent
|
67
|
-
is to get `abc=123` alone. From Beaker 3.0 forward, this will be the case.
|
31
|
+
Before, these methods used regular expressions that were too loose. This means that in an example of a call like `get_env_var('abc')`, the environment variables `abc=123`, `xx_abc_xx=123`, and `123=abc` would all be matched, where the intent is to get `abc=123` alone. From Beaker 3.0 forward, this will be the case.
|
68
32
|
|
69
33
|
## beaker-pe Import Changes
|
70
34
|
|
71
|
-
Starting in beaker 3.0, there is no explicit beaker-pe requirement in beaker. This
|
72
|
-
separates the two, meaning that you'll have to explicitly require beaker-pe if you
|
73
|
-
do need it in your testing. And if you don't need it, you won't get it, limiting
|
74
|
-
your dependencies & exposure to unnecessary code.
|
35
|
+
Starting in beaker 3.0, there is no explicit beaker-pe requirement in beaker. This separates the two, meaning that you'll have to explicitly require beaker-pe if you do need it in your testing. And if you don't need it, you won't get it, limiting your dependencies & exposure to unnecessary code.
|
75
36
|
|
76
|
-
Luckily, if you do need it, this shouldn't be hard to update. These are the steps
|
77
|
-
needed to use beaker-pe with beaker 3.0:
|
37
|
+
Luckily, if you do need it, this shouldn't be hard to update. These are the steps needed to use beaker-pe with beaker 3.0:
|
78
38
|
|
79
39
|
1. put a dependency on beaker-pe in your Gemfile as a sibling to your beaker
|
80
40
|
requirement (make sure beaker-pe is >= 1.0)
|
@@ -1,37 +1,19 @@
|
|
1
|
-
# How
|
1
|
+
# How to Use Hocon Helpers
|
2
2
|
|
3
|
-
Beaker provides a few convenience methods to help you use the
|
4
|
-
[HOCON](https://github.com/typesafehub/config/blob/master/HOCON.md)
|
5
|
-
configuration file format in your testing. This doc will give you an overview of
|
6
|
-
what each method does, but if you'd like more in-depth information, please
|
7
|
-
checkout our
|
8
|
-
[Hocon Helpers Rubydocs](http://www.rubydoc.info/github/puppetlabs/beaker/Beaker/DSL/Helpers/HoconHelpers).
|
3
|
+
Beaker provides a few convenience methods to help you use the [HOCON](https://github.com/typesafehub/config/blob/master/HOCON.md) configuration file format in your testing. This doc will give you an overview of what each method does, but if you'd like more in-depth information, please checkout our [Hocon Helpers Rubydocs](http://www.rubydoc.info/github/puppetlabs/beaker/Beaker/DSL/Helpers/HoconHelpers).
|
9
4
|
|
10
|
-
|
5
|
+
## hocon_file_read_on
|
11
6
|
|
12
|
-
If you'd just like to read the contents of a HOCON file from a System Under Test
|
13
|
-
(SUT), this is the method for you. Note that you will get back a
|
14
|
-
[ConfigValueFactory object](https://github.com/puppetlabs/ruby-hocon#basic-usage)
|
15
|
-
like in the other helper methods here.
|
7
|
+
If you'd just like to read the contents of a HOCON file from a System Under Test (SUT), this is the method for you. Note that you will get back a [ConfigValueFactory object](https://github.com/puppetlabs/ruby-hocon#basic-usage) like in the other helper methods here.
|
16
8
|
|
17
|
-
|
9
|
+
## hocon_file_edit_in_place_on
|
18
10
|
|
19
|
-
This method is specifically for editing a file on a SUT and saving it in-place,
|
20
|
-
meaning it'll save your changes in the place of the original file you read from.
|
11
|
+
This method is specifically for editing a file on a SUT and saving it in-place, meaning it'll save your changes in the place of the original file you read from.
|
21
12
|
|
22
|
-
The special thing to take note of here is that the Proc you pass to this method
|
23
|
-
will need to return the doc that you'd like saved in order for saving to work as
|
24
|
-
specified.
|
13
|
+
The special thing to take note of here is that the Proc you pass to this method will need to return the doc that you'd like saved in order for saving to work as specified.
|
25
14
|
|
26
|
-
|
15
|
+
## hocon_file_edit_on
|
27
16
|
|
28
|
-
This method is our generic open-ended method for editing a file from a SUT. This
|
29
|
-
is the most flexible method, doing nothing but providing you with the contents
|
30
|
-
of the file to edit yourself.
|
17
|
+
This method is our generic open-ended method for editing a file from a SUT. This is the most flexible method, doing nothing but providing you with the contents of the file to edit yourself.
|
31
18
|
|
32
|
-
This does not save the file edited. Our recommendation is to use the
|
33
|
-
[`create_remote_file` method](http://www.rubydoc.info/github/puppetlabs/beaker/Beaker/DSL/Helpers/HostHelpers#create_remote_file-instance_method),
|
34
|
-
as shown in the
|
35
|
-
[Rubydocs example](http://www.rubydoc.info/github/puppetlabs/beaker/Beaker/DSL/Helpers/HoconHelpers#hocon_file_edit_on-instance_method)
|
36
|
-
if you'd like to save. This allows us to have more flexibility to do things such
|
37
|
-
as moving the edited file to back up or version your changes.
|
19
|
+
This does not save the file edited. Our recommendation is to use the [`create_remote_file` method](http://www.rubydoc.info/github/puppetlabs/beaker/Beaker/DSL/Helpers/HostHelpers#create_remote_file-instance_method), as shown in the [Rubydocs example](http://www.rubydoc.info/github/puppetlabs/beaker/Beaker/DSL/Helpers/HoconHelpers#hocon_file_edit_on-instance_method) if you'd like to save. This allows us to have more flexibility to do things such as moving the edited file to back up or version your changes.
|
@@ -1,7 +1,8 @@
|
|
1
|
-
By default Beaker connects to hosts using public key authentication, but that may not be correct method for your particular testing set up.
|
1
|
+
By default Beaker connects to hosts using public key authentication, but that may not be correct method for your particular testing set up. To have beaker connect to a host using a username/password combination edit your hosts configuration file. You will need to create a new ssh hash to be used for logging into your SUT that includes (at least) entries for `user`, `password`, and `auth_method`. You may also include any additional supported [Net::SSH Options](http://net-ssh.github.io/ssh/v1/chapter-2.html#s3).
|
2
2
|
|
3
3
|
## Example 1: Use 'password' authentication
|
4
|
-
|
4
|
+
|
5
|
+
```yaml
|
5
6
|
HOSTS:
|
6
7
|
pe-centos6:
|
7
8
|
roles:
|
@@ -11,10 +12,10 @@ HOSTS:
|
|
11
12
|
- database
|
12
13
|
- myrole
|
13
14
|
platform: el-6-i386
|
14
|
-
snapshot
|
15
|
-
hypervisor
|
15
|
+
snapshot: clean-w-keys
|
16
|
+
hypervisor: fusion
|
16
17
|
ssh:
|
17
|
-
password
|
18
|
+
password: anode
|
18
19
|
user: anode
|
19
20
|
auth_methods:
|
20
21
|
- password
|
@@ -30,8 +31,10 @@ Attempting ssh connection to pe-centos6, user: anode, opts: {:config=>false, :ve
|
|
30
31
|
_/snip_
|
31
32
|
|
32
33
|
## Example 2: Use a list of authentication methods
|
33
|
-
|
34
|
-
|
34
|
+
|
35
|
+
If you want to try a sequence of authentication techniques that fall through on failure simply include them (in their desired order) in your list of `auth_methods`. If one of your methods is user/password be warned, after a failure Net::SSH will attempt keyboard-interactive password entry - if you do not want this behavior add `number_of_password_prompts: 0`.
|
36
|
+
|
37
|
+
```yaml
|
35
38
|
HOSTS:
|
36
39
|
pe-centos6:
|
37
40
|
roles:
|
@@ -41,13 +44,13 @@ HOSTS:
|
|
41
44
|
- database
|
42
45
|
- myrole
|
43
46
|
platform: el-6-i386
|
44
|
-
snapshot
|
45
|
-
hypervisor
|
47
|
+
snapshot: clean-w-keys
|
48
|
+
hypervisor: fusion
|
46
49
|
CONFIG:
|
47
50
|
ssh:
|
48
51
|
auth_methods:
|
49
52
|
- password
|
50
53
|
- publickey
|
51
54
|
number_of_password_prompts: 0
|
52
|
-
password
|
55
|
+
password: wootwoot
|
53
56
|
```
|
@@ -1,11 +1,15 @@
|
|
1
1
|
# Beaker for Modules
|
2
|
+
|
2
3
|
## Read the Beaker Docs
|
3
4
|
|
4
|
-
[Beaker How To](../tutorials/how_to_beaker.md)
|
5
|
-
|
5
|
+
- [Beaker How To](../tutorials/how_to_beaker.md)
|
6
|
+
|
7
|
+
- [Beaker DSL API](http://rubydoc.info/github/puppetlabs/beaker/frames)
|
6
8
|
|
7
9
|
## Understand the Difference Between beaker and beaker-rspec
|
10
|
+
|
8
11
|
[beaker vs. beaker-rspec](../concepts/beaker_vs_beaker_rspec.md)
|
9
12
|
|
10
13
|
## beaker-rspec Details
|
14
|
+
|
11
15
|
See the [beaker-rspec README](https://github.com/puppetlabs/beaker-rspec/blob/master/README.md) for details on how to use beaker-rspec with modules.
|
data/docs/tutorials/README.md
CHANGED
@@ -1,82 +1,41 @@
|
|
1
1
|
# Tutorials
|
2
2
|
|
3
|
-
This doc is here to help you get acquainted with beaker
|
4
|
-
|
5
|
-
|
6
|
-
you might need each one. The list has been organized as
|
7
|
-
a learning guide for someone new to using beaker, so be
|
8
|
-
aware of that if you're just dipping into a topic.
|
9
|
-
|
10
|
-
For more high level & motivation topics, checkout our
|
11
|
-
[concepts docs](../concepts). If you're looking for
|
12
|
-
more details on a topic than what is provided in the
|
13
|
-
tutorials, checkout our [how to docs](../how_to). And
|
14
|
-
if you'd like API level details, feel free to skip on
|
15
|
-
over to our
|
16
|
-
[Rubydocs](http://www.rubydoc.info/github/puppetlabs/beaker/frames).
|
17
|
-
And without further pre-amble, we beaker!
|
3
|
+
This doc is here to help you get acquainted with beaker and how we run our acceptance tests at Puppet. We'll go over the purpose of each doc, giving you an idea of when you might need each one. The list has been organized as a learning guide for someone new to using beaker, so be aware of that if you're just dipping into a topic.
|
4
|
+
|
5
|
+
For more high level & motivation topics, checkout our [concepts docs](../concepts). If you're looking for more details on a topic than what is provided in the tutorials, checkout our [how to docs](../how_to). And if you'd like API level details, feel free to skip on over to our [Rubydocs](http://www.rubydoc.info/github/puppetlabs/beaker/frames). And without further pre-amble, we beaker!
|
18
6
|
|
19
7
|
## Installation
|
20
8
|
|
21
|
-
If you haven't installed beaker yet, your guide to doing
|
22
|
-
so can be found [here](installation.md).
|
9
|
+
If you haven't installed beaker yet, your guide to doing so can be found [here](installation.md).
|
23
10
|
|
24
11
|
## Quick Start
|
25
12
|
|
26
|
-
As a completely new beaker user, the
|
27
|
-
[quick start rake tasks doc](quick_start_rake_tasks.md)
|
28
|
-
will take you through getting beaker running for the
|
29
|
-
first time.
|
13
|
+
As a completely new beaker user, the [quick start rake tasks doc](quick_start_rake_tasks.md) will take you through getting beaker running for the first time.
|
30
14
|
|
31
15
|
## OK, We're Running. Now What?
|
32
16
|
|
33
|
-
This is where things get interesting. There are a
|
34
|
-
number of directions you can go, based on your needs.
|
35
|
-
Here's a list of the common directions people take at
|
36
|
-
this point.
|
17
|
+
This is where things get interesting. There are a number of directions you can go, based on your needs. Here's a list of the common directions people take at this point.
|
37
18
|
|
38
19
|
### Test Writing
|
39
20
|
|
40
|
-
Most people reading this doc are in Quality orgs, or
|
41
|
-
are developers who need to get some testing done for
|
42
|
-
their current work. If getting a particular bit of
|
43
|
-
testing done is your next step, this is the direction
|
44
|
-
for you.
|
21
|
+
Most people reading this doc are in Quality orgs, or are developers who need to get some testing done for their current work. If getting a particular bit of testing done is your next step, this is the direction for you.
|
45
22
|
|
46
|
-
Checkout our [let's write a test](lets_write_a_test.md)
|
47
|
-
to start with test writing!
|
23
|
+
Checkout our [let's write a test](lets_write_a_test.md) to start with test writing!
|
48
24
|
|
49
25
|
### Running Beaker Itself
|
50
26
|
|
51
|
-
For the quick start guide, we resorted to using rake
|
52
|
-
tasks to get beaker running quickly and easily. In
|
53
|
-
the real world, people need much more customization
|
54
|
-
out of their testing environments. One of the main
|
55
|
-
ways people provide these options is through
|
56
|
-
command line arguments.
|
27
|
+
For the quick start guide, we resorted to using rake tasks to get beaker running quickly and easily. In the real world, people need much more customization out of their testing environments. One of the main ways people provide these options is through command line arguments.
|
57
28
|
|
58
|
-
If you want to find out more about running beaker
|
59
|
-
itself, checkout [the command line](the_command_line.md).
|
29
|
+
If you want to find out more about running beaker itself, checkout [the command line](the_command_line.md).
|
60
30
|
|
61
31
|
### Environment Details
|
62
32
|
|
63
|
-
If you don't need to get your tests running _anywhere_,
|
64
|
-
but need them on a ton of Operating Systems (OSes),
|
65
|
-
then your next stop is setting up your test environment.
|
33
|
+
If you don't need to get your tests running _anywhere_, but need them on a ton of Operating Systems (OSes), then your next stop is setting up your test environment.
|
66
34
|
|
67
|
-
Our
|
68
|
-
[creating a test environment doc](creating_a_test_environment.md)
|
69
|
-
is the next spot for you!
|
35
|
+
Our [creating a test environment doc](creating_a_test_environment.md) is the next spot for you!
|
70
36
|
|
71
37
|
### High Level Execution Details
|
72
38
|
|
73
|
-
For a higher level look at what happens during beaker
|
74
|
-
execution, which we call a _run_, checkout our
|
75
|
-
[test run doc](test_run.md). A _run_ is an entire
|
76
|
-
beaker execution cycle, from when the command is run
|
77
|
-
until beaker exits.
|
39
|
+
For a higher level look at what happens during beaker execution, which we call a _run_, checkout our [test run doc](test_run.md). A _run_ is an entire beaker execution cycle, from when the command is run until beaker exits.
|
78
40
|
|
79
|
-
As one phase of a test run, the test suites are executed.
|
80
|
-
To get more information about the test suites that
|
81
|
-
are available, and how you configure them, you can
|
82
|
-
checkout our [test suites doc](test_suites.md).
|
41
|
+
As one phase of a test run, the test suites are executed. To get more information about the test suites that are available, and how you configure them, you can check out our [test suites doc](test_suites.md).
|
@@ -1,36 +1,37 @@
|
|
1
|
-
Hosts/Nodes/SUTs are defined in the --hosts (--config) file in Yaml format.
|
2
|
-
This file defines each node in the test configuration. The file can be saved
|
3
|
-
anywhere and used with `beaker --hosts yourhost.yaml`
|
4
|
-
(see [The Command Line](the_command_line.md) for more info).
|
1
|
+
Hosts/Nodes/SUTs are defined in the --hosts (--config) file in Yaml format. This file defines each node in the test configuration. The file can be saved anywhere and used with `beaker --hosts yourhost.yaml` (see [The Command Line](the_command_line.md) for more info).
|
5
2
|
|
6
3
|
Example hosts file:
|
7
4
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
5
|
+
```yaml
|
6
|
+
HOSTS:
|
7
|
+
ubuntu-1404-x64-master:
|
8
|
+
roles:
|
9
|
+
- master
|
10
|
+
- agent
|
11
|
+
- dashboard
|
12
|
+
- database
|
13
|
+
platform: ubuntu-1404-x86_64
|
14
|
+
hypervisor: vagrant
|
15
|
+
box: puppetlabs/ubuntu-14.04-64-nocm
|
16
|
+
box_url: https://vagrantcloud.com/puppetlabs/boxes/ubuntu-14.04-64-nocm
|
17
|
+
ip: 192.168.20.20
|
18
|
+
ubuntu-1404-x64-agent:
|
19
|
+
roles:
|
20
|
+
- agent
|
21
|
+
platform: ubuntu-1404-x86_64
|
22
|
+
hypervisor: vagrant
|
23
|
+
box: puppetlabs/ubuntu-14.04-64-nocm
|
24
|
+
box_url: https://vagrantcloud.com/puppetlabs/boxes/ubuntu-14.04-64-nocm
|
25
|
+
ip: 192.168.21.21
|
26
|
+
CONFIG:
|
27
|
+
nfs_server: none
|
28
|
+
consoleport: 443
|
29
|
+
```
|
30
|
+
|
31
|
+
## Host Requirements
|
32
|
+
|
33
33
|
Hosts, or SUTs (Systems Under Test), must meet the following requirements:
|
34
|
+
|
34
35
|
* The SUT will need a properly configured network, hosts will need to be able to reach each other by hostname.
|
35
36
|
* On the SUT, you must configure passwordless SSH authentication for the root user.
|
36
37
|
* The SUT must have the `ntpdate` binary installed.
|
@@ -38,34 +39,28 @@ Hosts, or SUTs (Systems Under Test), must meet the following requirements:
|
|
38
39
|
* On Windows, `Cygwin` must be installed (with `curl`, `sshd`, `bash`) and the necessary windows gems (`sys-admin`, `win32-dir`, etc).
|
39
40
|
* FOSS install: you must have `git`, `ruby`, and `rdoc` installed on your SUT.
|
40
41
|
|
41
|
-
## Required Host Settings
|
42
|
+
## Required Host Settings
|
43
|
+
|
42
44
|
To properly define a host you must provide:
|
43
45
|
|
44
|
-
* name
|
45
|
-
|
46
|
-
|
47
|
-
|
46
|
+
* name: The string identifying this host.
|
47
|
+
* platform: One of the Beaker supported platforms.
|
48
|
+
|
49
|
+
## Optional Host Settings
|
48
50
|
|
49
|
-
## Optional Host Settings ##
|
50
51
|
Additionally, Beaker supports the following host options:
|
51
52
|
|
52
|
-
* ip
|
53
|
-
|
54
|
-
* hypervisor
|
55
|
-
* One of `docker`, `solaris`, `ec2`, `vsphere`, `fusion`, `aix`, `vcloud` or `vagrant`.
|
53
|
+
* ip: The IP address of the SUT.
|
54
|
+
* hypervisor: One of `docker`, `solaris`, `ec2`, `vsphere`, `fusion`, `aix`, `vcloud` or `vagrant`.
|
56
55
|
* 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.
|
57
|
-
* snapshot
|
58
|
-
|
59
|
-
*
|
60
|
-
|
61
|
-
*
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
* vagrant_memsize
|
66
|
-
* The memory size (in MB) for this host
|
67
|
-
|
68
|
-
## Supported Platforms ##
|
56
|
+
* snapshot: The name of the snapshot to revert to before testing.
|
57
|
+
* roles: The 'job' of this host, an array of `master`, `agent`, `frictionless`, `dashboard`, `database`, `default` or any user-defined string.
|
58
|
+
* pe_dir: The directory where PE builds are located, may be local directory or a URL.
|
59
|
+
* pe_ver: The version number of PE to install.
|
60
|
+
* vagrant_memsize: The memory size (in MB) for this host
|
61
|
+
|
62
|
+
## Supported Platforms
|
63
|
+
|
69
64
|
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).
|
70
65
|
|
71
66
|
The platform's format is `/^OSFAMILY-VERSION-ARCH.*$/` where `OSFAMILY` is one of:
|
@@ -83,4 +78,4 @@ The platform's format is `/^OSFAMILY-VERSION-ARCH.*$/` where `OSFAMILY` is one o
|
|
83
78
|
|
84
79
|
`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).
|
85
80
|
|
86
|
-
## [Supported Virtualization Providers](../how_to/hypervisors/README.md#external-hypervisors)
|
81
|
+
## [Supported Virtualization Providers](../how_to/hypervisors/README.md#external-hypervisors)
|
@@ -11,17 +11,26 @@ In most cases, beaker is running on a system separate from the SUT; we will comm
|
|
11
11
|
|
12
12
|
On a Debian or Ubuntu system you can install these using the command
|
13
13
|
|
14
|
-
|
14
|
+
```console
|
15
|
+
$ sudo apt-get install ruby-dev libxml2-dev libxslt1-dev g++ zlib1g-dev
|
16
|
+
```
|
15
17
|
|
16
18
|
On an EL or Fedora system use:
|
17
19
|
|
18
|
-
|
20
|
+
```console
|
21
|
+
$ sudo yum install make gcc gcc-c++ libxml2-devel libxslt-devel ruby-devel
|
22
|
+
```
|
19
23
|
|
20
24
|
## Installing Beaker
|
25
|
+
|
26
|
+
These instructions apply to installing Beaker for use; to set up a development environment for Beaker itself, [see below](#for-development).
|
27
|
+
|
21
28
|
### From Gem (Preferred)
|
22
29
|
|
23
|
-
|
24
|
-
|
30
|
+
```console
|
31
|
+
$ gem install beaker
|
32
|
+
$ beaker --help
|
33
|
+
```
|
25
34
|
|
26
35
|
### From Latest Git
|
27
36
|
|
@@ -29,26 +38,30 @@ If you need the latest and greatest (and mostly likely broken/untested/no warran
|
|
29
38
|
|
30
39
|
* Uses <a href = "http://bundler.io/">bundler</a>
|
31
40
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
41
|
+
```console
|
42
|
+
$ git clone https://github.com/puppetlabs/beaker
|
43
|
+
$ cd beaker
|
44
|
+
$ bundle install
|
45
|
+
$ bundle exec beaker --help
|
46
|
+
```
|
37
47
|
|
38
48
|
### From Latest Git, As Installed Gem
|
39
49
|
|
40
50
|
If you need the latest and greatest, but prefer to work from gem instead of through bundler.
|
41
51
|
|
52
|
+
```console
|
42
53
|
$ gem uninstall beaker
|
43
54
|
$ git clone https://github.com/puppetlabs/beaker
|
44
55
|
$ cd beaker
|
45
56
|
$ gem build beaker.gemspec
|
46
57
|
$ gem install ./beaker-*.gem
|
58
|
+
```
|
47
59
|
|
48
60
|
### Special Case Installation
|
49
61
|
|
50
62
|
The beaker gem can be built and installed in the context of the current test suite by adding the github repos as the source in the Gemspec file (see <a href = "http://bundler.io/git.html">bundler git documentation</a>).
|
51
63
|
|
64
|
+
```ruby
|
52
65
|
source 'https://rubygems.org'
|
53
66
|
group :testing do
|
54
67
|
gem 'cucumber', '~> 1.3.6'
|
@@ -57,18 +70,41 @@ The beaker gem can be built and installed in the context of the current test sui
|
|
57
70
|
gem 'chromedriver2-helper'
|
58
71
|
gem 'beaker', :github => 'puppetlabs/beaker', :branch => 'master', :ref => 'fffe7'
|
59
72
|
end
|
73
|
+
```
|
74
|
+
|
75
|
+
## For Development
|
76
|
+
|
77
|
+
If you intend to make changes to Beaker itself, follow these instructions.
|
78
|
+
|
79
|
+
### Recommended Tools
|
80
|
+
|
81
|
+
It may be necessary to test Beaker against multiple versions of Ruby. The maintainers use [`rbenv`](https://github.com/rbenv/rbenv) to manage multiple Ruby versions; you can install it with Homebrew. You'll also want [`rbenv-bundler`](https://github.com/carsomyr/rbenv-bundler) to keep Gem dependencies from conflicting.
|
82
|
+
|
83
|
+
### Setup for Development
|
84
|
+
|
85
|
+
While most users will use Beaker as a Gem installed from some repository, you will need a live repo to work with. Here's how to configure Beaker and its dependencies so you can start contributing:
|
86
|
+
|
87
|
+
* Clone your fork of Beaker
|
88
|
+
* Install Beaker's dependencies into `vendor/bundle`:
|
89
|
+
```console
|
90
|
+
$ cd beaker/
|
91
|
+
$ bundle install --path vendor/bundle
|
92
|
+
```
|
93
|
+
* Installing the dependencies globally ~~may~~ *will probably* cause conflicts and is not recommended.
|
94
|
+
* Please use `vendor/bundle`, not `_vendor` or `.vendor`.
|
95
|
+
* Test your new environment by seeing if the spec tests pass (beaker/master is maintained in an always-passing state):
|
96
|
+
```console
|
97
|
+
$ rake test:spec # assuming you have rbenv-bundler
|
98
|
+
# or
|
99
|
+
$ bundle exec rake test:spec # if you're *sure* your dependencies are tidy
|
100
|
+
```
|
101
|
+
|
102
|
+
### Contributing
|
103
|
+
|
104
|
+
Contributions to Beaker are welcomed, see [CONTRIBUTING.md](/CONTRIBUTING.md)) for instructions.
|
60
105
|
|
61
106
|
## Ruby Version
|
62
107
|
|
63
|
-
In moving to beaker 3.0, we added in a hard requirement that a
|
64
|
-
|
65
|
-
|
66
|
-
writing tests more difficult than it needed to be.
|
67
|
-
|
68
|
-
In order to make this easier, in beaker 3.13.0 we've relaxed
|
69
|
-
this requirement to Ruby 2.1.8. Note that the beaker team does
|
70
|
-
not internally test Ruby versions below 2.2.5, and that if bugs
|
71
|
-
are submitted that are found to be specific to versions below
|
72
|
-
2.2.5, they will not be worked on by the beaker team. This
|
73
|
-
doesn't mean we won't merge fixes to bugs that are specific to
|
74
|
-
those versions that are submitted by the community, however.
|
108
|
+
In moving to beaker 3.0, we added in a hard requirement that a beaker test writer be using Ruby 2.2.5 or higher. Since Puppet has versions that support earlier versions of Ruby, this made writing tests more difficult than it needed to be.
|
109
|
+
|
110
|
+
In order to make this easier, in beaker 3.13.0 we've relaxed this requirement to Ruby 2.1.8. Note that the beaker team does not internally test Ruby versions below 2.2.5, and that if bugs are submitted that are found to be specific to versions below 2.2.5, they will not be worked on by the beaker team. This doesn't mean we won't merge fixes to bugs that are specific to those versions that are submitted by the community, however.
|