beaker 4.0.0 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -1
- data/acceptance/tests/base/dsl/helpers/host_helpers/create_remote_file_test.rb +13 -1
- data/acceptance/tests/base/dsl/helpers/host_helpers/rsync_to_test.rb +18 -1
- data/docs/how_to/the_beaker_dsl.md +18 -194
- data/docs/how_to/upgrade_from_3_to_4.md +10 -10
- data/lib/beaker/dsl/roles.rb +1 -1
- data/lib/beaker/host.rb +2 -2
- data/lib/beaker/host/unix/file.rb +5 -4
- data/lib/beaker/host/unix/pkg.rb +9 -9
- data/lib/beaker/host_prebuilt_steps.rb +20 -19
- data/lib/beaker/options/command_line_parser.rb +8 -0
- data/lib/beaker/perf.rb +1 -1
- data/lib/beaker/platform.rb +1 -1
- data/lib/beaker/subcommand.rb +10 -0
- data/lib/beaker/version.rb +1 -1
- data/spec/beaker/host/unix/file_spec.rb +17 -11
- data/spec/beaker/host/unix/pkg_spec.rb +9 -7
- data/spec/beaker/host_prebuilt_steps_spec.rb +38 -35
- data/spec/beaker/host_spec.rb +66 -3
- data/spec/beaker/platform_spec.rb +10 -8
- data/spec/beaker/subcommand_spec.rb +27 -0
- metadata +2 -3
- data/spec/beaker/hypervisor/hypervisor_spec.rb.orig +0 -80
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2607aad1f0cfd6109c43fedd0299d4b63e4bdaf4
|
4
|
+
data.tar.gz: 98b8eba8588799c8390c3795ffc8c119435cee7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 023baf9c93434352d5d14a9529a484608f089112cac04356ac5bae33f0df69c7cdeee7168d7c2c5f61624fda1e427a726d3d0d75d343f3aa26eb3cf39b8c0cd4
|
7
|
+
data.tar.gz: 2947ce85bb0fbbfbcbe673b721c7d6809df62dba9dadfb4d70bf618f6bf264492d3f58b45eee47c7d54d45baf963fbca9977ab2b84a8af67d8c0f8e015837126
|
data/CHANGELOG.md
CHANGED
@@ -11,7 +11,18 @@ Tracking in this Changelog began for this project in version 3.25.0.
|
|
11
11
|
If you're looking for changes from before this, refer to the project's
|
12
12
|
git logs & PR history.
|
13
13
|
|
14
|
-
# [Unreleased](https://github.com/puppetlabs/beaker/compare/4.
|
14
|
+
# [Unreleased](https://github.com/puppetlabs/beaker/compare/4.1.0...master)
|
15
|
+
|
16
|
+
# [4.1.0](https://github.com/puppetlabs/beaker/compare/4.0.0...4.1.0) - 2018.10.25
|
17
|
+
|
18
|
+
### Added
|
19
|
+
|
20
|
+
- `--preserve-state` flag will preserve a given host options hash across subcommand runs(BKR-1541)
|
21
|
+
|
22
|
+
### Changed
|
23
|
+
|
24
|
+
- Added additional tests for EL-like systems and added 'redhat' support where necessary
|
25
|
+
- Test if puppet module is installed in '/' and avoid stripping of path seperator
|
15
26
|
|
16
27
|
# [4.0.0](https://github.com/puppetlabs/beaker/compare/3.37.0...4.0.0) - 2018-08-06
|
17
28
|
|
@@ -112,7 +112,19 @@ test_name "dsl::helpers::host_helpers #create_remote_file" do
|
|
112
112
|
remote_filename = File.join(remote_tmpdir, "testfile.txt")
|
113
113
|
contents = fixture_contents("simple_text_file")
|
114
114
|
|
115
|
-
|
115
|
+
repeat_fibonacci_style_for(10) do
|
116
|
+
begin
|
117
|
+
result = create_remote_file(
|
118
|
+
default, remote_filename, contents, { :protocol => "rsync" }
|
119
|
+
) # return of block is whether or not we're done repeating
|
120
|
+
result.success?
|
121
|
+
rescue Beaker::Host::CommandFailure => err
|
122
|
+
logger.info("Rsync threw command failure, details: ")
|
123
|
+
logger.info(" #{err}")
|
124
|
+
logger.info("continuing back-off execution")
|
125
|
+
false
|
126
|
+
end
|
127
|
+
end
|
116
128
|
|
117
129
|
fails_intermittently("https://tickets.puppetlabs.com/browse/BKR-612",
|
118
130
|
"default" => default,
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "helpers/test_helper"
|
2
|
+
require "rsync"
|
2
3
|
|
3
4
|
test_name "dsl::helpers::host_helpers #rsync_to" do
|
4
5
|
|
@@ -123,7 +124,23 @@ test_name "dsl::helpers::host_helpers #rsync_to" do
|
|
123
124
|
on hosts, "mkdir -p #{remote_tmpdir}"
|
124
125
|
remote_filename = File.join(remote_tmpdir, "testfile.txt")
|
125
126
|
|
126
|
-
|
127
|
+
repeat_fibonacci_style_for(10) do
|
128
|
+
begin
|
129
|
+
result = rsync_to hosts, local_filename, remote_tmpdir
|
130
|
+
return result.success? if result.is_a? Rsync::Result
|
131
|
+
|
132
|
+
result.each do |individual_result|
|
133
|
+
next if individual_result.success?
|
134
|
+
return false
|
135
|
+
end
|
136
|
+
true
|
137
|
+
rescue Beaker::Host::CommandFailure => err
|
138
|
+
logger.info("Rsync threw command failure, details: ")
|
139
|
+
logger.info(" #{err}")
|
140
|
+
logger.info("continuing back-off execution")
|
141
|
+
false
|
142
|
+
end
|
143
|
+
end
|
127
144
|
|
128
145
|
hosts.each do |host|
|
129
146
|
fails_intermittently("https://tickets.puppetlabs.com/browse/QENG-3053",
|
@@ -1,6 +1,22 @@
|
|
1
|
-
|
1
|
+
# The Beaker DSL
|
2
2
|
|
3
|
+
The Beaker [Domain-Specific Language (DSL)](https://en.wikipedia.org/wiki/Domain-specific_language) is a set of Ruby convenience methods provided by Beaker to make testing easier.
|
3
4
|
|
5
|
+
Beaker maintains [yard documentation](http://www.rubydoc.info/github/puppetlabs/beaker/) covering the DSL to help you use it. That documentation can sometimes be difficult to navigate, however, so this doc has been created to help you find your way around.
|
6
|
+
|
7
|
+
## DSL Caveats
|
8
|
+
|
9
|
+
Note that if you're using a beaker-library, any methods provided there won't be documented here. You can refer to the [beaker-libraries listing doc](../concepts/beaker_libraries.md) for links to those projects which should include their own documentation.
|
10
|
+
|
11
|
+
Another common point of confusion about the Beaker DSL is that there is a similar set of methods that come along in Host objects themselves. You can tell these methods apart in a test by their invocation method. Host methods are Ruby instance methods on Host objects, so they'll be invoked on a Host object like so:
|
12
|
+
```ruby
|
13
|
+
host.host_method_name(host_method_params)
|
14
|
+
```
|
15
|
+
and they'll know by default which hosts to act on because you've provided them that through choosing which hosts to call them on. Beaker DSL methods are called in the wider context of the test itself, however, and often need to be passed the hosts you'd like them to act on:
|
16
|
+
```ruby
|
17
|
+
on(hosts, "cowsay 'the tortoise lives in agony'")
|
18
|
+
```
|
19
|
+
Another way you can tell them apart is their location in the codebase, & thus in the Rubydocs. Beaker DSL methods live under the [Beaker::DSL module](https://www.rubydoc.info/github/puppetlabs/beaker/Beaker/DSL), whereas Host methods are all included in the [Beaker::Host object itself](https://www.rubydoc.info/github/puppetlabs/beaker/Beaker/Host). Follow that link to the Host Rubydoc and checkout the Instance Method Summary to see a listing of Host methods. Note that they won't be listed here though.
|
4
20
|
|
5
21
|
## Assertions
|
6
22
|
|
@@ -12,14 +28,7 @@ To be used for confirming the result of a test is as expected. Beaker include a
|
|
12
28
|
|
13
29
|
## Helpers
|
14
30
|
|
15
|
-
DSL methods designed to help you interact with
|
16
|
-
|
17
|
-
### Facter
|
18
|
-
|
19
|
-
DSL methods for interacting with facter. As of Beaker 4.0, moved to `beaker-puppet`. See [upgrade_from_3_to_4.md](upgrade_from_3_to_4.md).
|
20
|
-
|
21
|
-
* [fact_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/FacterHelpers#fact_on-instance_method)
|
22
|
-
* [fact](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/FacterHelpers#fact-instance_method)
|
31
|
+
DSL methods designed to help you interact with hosts (like running arbitrary commands on them) or interacting with the web (checking is a given URL is alive or not).
|
23
32
|
|
24
33
|
### Host
|
25
34
|
|
@@ -49,48 +58,6 @@ DSL methods for host manipulation.
|
|
49
58
|
* [create_tmpdir_on](http://www.rubydoc.info/github/puppetlabs/beaker/Beaker/DSL/Helpers/HostHelpers#create_tmpdir_on-instance_method) As of Beaker 4.0, moved to `beaker-puppet`. See [upgrade_from_3_to_4.md](upgrade_from_3_to_4.md).
|
50
59
|
* [echo_on](http://www.rubydoc.info/github/puppetlabs/beaker/Beaker/DSL/Helpers/HostHelpers#echo_on-instance_method)
|
51
60
|
|
52
|
-
### Puppet
|
53
|
-
|
54
|
-
DSL methods for interacting with puppet. As of Beaker 4.0, moved to `beaker-puppet`. See [upgrade_from_3_to_4.md](upgrade_from_3_to_4.md).
|
55
|
-
|
56
|
-
* [puppet_user](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#puppet_user-instance_method)
|
57
|
-
* [puppet_group](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#puppet_group-instance_method)
|
58
|
-
* [with_puppet_running_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#with_puppet_running_on-instance_method)
|
59
|
-
* [with_puppet_running](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#with_puppet_running-instance_method)
|
60
|
-
* [restore_puppet_conf_from_backup](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#restore_puppet_conf_from_backup-instance_method)
|
61
|
-
* [start_puppet_from_source_on!](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#start_puppet_from_source_on!-instance_method)
|
62
|
-
* [stop_puppet_from_source_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#stop_puppet_from_source_on-instance_method)
|
63
|
-
* [dump_puppet_log](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#dump_puppet_log-instance_method)
|
64
|
-
* [lay_down_new_puppet_conf](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#lay_down_new_puppet_conf-instance_method)
|
65
|
-
* [puppet_conf_for](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#puppet_conf_for-instance_method)
|
66
|
-
* [bounce_service](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#bounce_service-instance_method)
|
67
|
-
* [apply_manifest_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#apply_manifest_on-instance_method)
|
68
|
-
* [apply_manifest](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#apply_manifest-instance_method)
|
69
|
-
* [run_agent_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#run_agent_on-instance_method)
|
70
|
-
* [stub_hosts_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#stub_hosts_on-instance_method)
|
71
|
-
* [with_host_stubbed_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#with_host_stubbed_on-instance_method)
|
72
|
-
* [stub_hosts](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#stub_hosts-instance_method)
|
73
|
-
* [stub_forge_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#stub_forge_on-instance_method)
|
74
|
-
* [with_forge_stubbed_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#with_forge_stubbed_on-instance_method)
|
75
|
-
* [with_forge_stubbed](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#with_forge_stubbed-instance_method)
|
76
|
-
* [stub_forge](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#stub_forge-instance_method)
|
77
|
-
* [sleep_until_puppetdb_started](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#sleep_until_puppetdb_started-instance_method)
|
78
|
-
* [sleep_until_puppetserver_started](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#sleep_until_puppetserver_started-instance_method)
|
79
|
-
* [sleep_until_nc_started](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#sleep_until_nc_started-instance_method)
|
80
|
-
* [stop_agent_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#stop_agent_on-instance_method)
|
81
|
-
* [stop_agent](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#stop_agent-instance_method)
|
82
|
-
* [wait_for_host_in_dashboard](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#wait_for_host_in_dashboard-instance_method)
|
83
|
-
* [sign_certificate_for](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#sign_certificate_for-instance_method)
|
84
|
-
* [sign_certificate](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#sign_certificate-instance_method)
|
85
|
-
* [create_tmpdir_for_user](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/PuppetHelpers#create_tmpdir_for_user-instance_method)
|
86
|
-
|
87
|
-
### TK
|
88
|
-
|
89
|
-
Convenience methods for TrapperKeeper configuration. As of Beaker 4.0, moved to `beaker-puppet`. See [upgrade_from_3_to_4.md](upgrade_from_3_to_4.md).
|
90
|
-
|
91
|
-
* [modify_tk_config](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/TkHelpers#modify_tk_config-instance_method)
|
92
|
-
* [read_tk_config_string](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Helpers/TkHelpers#read_tk_config_string-instance_method)
|
93
|
-
|
94
61
|
### Web
|
95
62
|
|
96
63
|
Helpers for web actions.
|
@@ -111,139 +78,6 @@ DSL methods for setting information about the current test.
|
|
111
78
|
* [set_current_test_filename](http://www.rubydoc.info/github/puppetlabs/beaker/Beaker/DSL/Helpers/TestHelpers#set_current_test_filename-instance_method)
|
112
79
|
* [set_current_step_name](http://www.rubydoc.info/github/puppetlabs/beaker/Beaker/DSL/Helpers/TestHelpers#set_current_step_name-instance_method)
|
113
80
|
|
114
|
-
## Install Utilities
|
115
|
-
|
116
|
-
DSL methods for installing PuppetLabs projects. As of Beaker 4.0, moved to `beaker-puppet`. See [upgrade_from_3_to_4.md](upgrade_from_3_to_4.md).
|
117
|
-
|
118
|
-
### EZBake
|
119
|
-
|
120
|
-
EZBake convenience methods. As of Beaker 4.0, moved to `beaker-puppet`. See [upgrade_from_3_to_4.md](upgrade_from_3_to_4.md).
|
121
|
-
|
122
|
-
* [install_from_ezbake](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/EzbakeUtils#install_from_ezbake-instance_method)
|
123
|
-
* [install_termini_from_ezbake](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/EzbakeUtils#install_termini_from_ezbake-instance_method)
|
124
|
-
* [ezbake_dev_build](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/EzbakeUtils#ezbake_dev_build-instance_method)
|
125
|
-
* [ezbake_validate_support](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/EzbakeUtils#ezbake_validate_support-instance_method)
|
126
|
-
* [install_ezbake_tarball_on_host](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/EzbakeUtils#install_ezbake_tarball_on_host-instance_method)
|
127
|
-
* [ezbake_tools_available?](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/EzbakeUtils#ezbake_tools_available?-instance_method)
|
128
|
-
* [ezbake_config](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/EzbakeUtils#ezbake_config-instance_method)
|
129
|
-
* [ezbake_lein_prefix](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/EzbakeUtils#ezbake_lein_prefix-instance_method)
|
130
|
-
* [ezbake_stage](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/EzbakeUtils#ezbake_stage-instance_method)
|
131
|
-
* [ezbake_local_cmd](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/EzbakeUtils#ezbake_local_cmd-instance_method)
|
132
|
-
* [ezbake_install_name](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/EzbakeUtils#ezbake_install_name-instance_method)
|
133
|
-
* [ezbake_install_dir](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/EzbakeUtils#ezbake_install_dir-instance_method)
|
134
|
-
* [ezbake_installsh](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/EzbakeUtils#ezbake_installsh-instance_method)
|
135
|
-
* [conditionally_clone](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/EzbakeUtils#conditionally_clone-instance_method)
|
136
|
-
|
137
|
-
### AIO
|
138
|
-
|
139
|
-
Agent-only installation utilities. As of Beaker 4.0, moved to `beaker-puppet`. See [upgrade_from_3_to_4.md](upgrade_from_3_to_4.md).
|
140
|
-
|
141
|
-
* [add_platform_aio_defaults](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/AIODefaults#add_platform_aio_defaults-instance_method)
|
142
|
-
* [add_aio_defaults_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/AIODefaults#add_aio_defaults_on-instance_method)
|
143
|
-
* [remove_platform_aio_defaults](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/AIODefaults#remove_platform_aio_defaults-instance_method)
|
144
|
-
* [remove_aio_defaults_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/AIODefaults#remove_aio_defaults_on-instance_method)
|
145
|
-
|
146
|
-
### FOSS
|
147
|
-
|
148
|
-
DSL methods for installing FOSS PuppetLabs projects. As of Beaker 4.0, moved to `beaker-puppet`. See [upgrade_from_3_to_4.md](upgrade_from_3_to_4.md).
|
149
|
-
|
150
|
-
* [add_platform_foss_defaults](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSDefaults#add_platform_foss_defaults-instance_method)
|
151
|
-
* [add_foss_defaults_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSDefaults#add_foss_defaults_on-instance_method)
|
152
|
-
* [remove_platform_foss_defaults](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSDefaults#remove_platform_foss_defaults-instance_method)
|
153
|
-
* [remove_foss_defaults_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSDefaults#remove_foss_defaults_on-instance_method)
|
154
|
-
* [lookup_in_env](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#lookup_in_env-instance_method)
|
155
|
-
* [build_git_url](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#build_git_url-instance_method)
|
156
|
-
* [extract_repo_info_from](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#extract_repo_info_from-instance_method)
|
157
|
-
* [order_packages](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#order_packages-instance_method)
|
158
|
-
* [find_git_repo_versions](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#find_git_repo_versions-instance_method)
|
159
|
-
* [clone_git_repo_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#clone_git_repo_on-instance_method)
|
160
|
-
* [install_from_git_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_from_git_on-instance_method)
|
161
|
-
* [install_puppet](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_puppet-instance_method)
|
162
|
-
* [install_puppet_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_puppet_on-instance_method)
|
163
|
-
* [install_puppet_agent_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_puppet_agent_on-instance_method)
|
164
|
-
* [configure_puppet](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#configure_puppet-instance_method)
|
165
|
-
* [configure_puppet_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#configure_puppet_on-instance_method)
|
166
|
-
* [install_puppet_from_rpm_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_puppet_from_rpm_on-instance_method)
|
167
|
-
* [install_puppet_from_deb_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_puppet_from_deb_on-instance_method)
|
168
|
-
* [install_puppet_from_msi_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_puppet_from_msi_on-instance_method)
|
169
|
-
* [compute_puppet_msi_name](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#compute_puppet_msi_name-instance_method)
|
170
|
-
* [install_puppet_agent_from_msi_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_puppet_agent_from_msi_on-instance_method)
|
171
|
-
* [install_a_puppet_msi_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_a_puppet_msi_on-instance_method)
|
172
|
-
* [install_puppet_from_freebsd_ports_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_puppet_from_freebsd_ports_on-instance_method)
|
173
|
-
* [install_puppet_from_dmg_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_puppet_from_dmg_on-instance_method)
|
174
|
-
* [install_puppet_agent_from_dmg_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_puppet_agent_from_dmg_on-instance_method)
|
175
|
-
* [install_puppet_from_openbsd_packages_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_puppet_from_openbsd_packages_on-instance_method)
|
176
|
-
* [install_puppet_from_gem_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_puppet_from_gem_on-instance_method)
|
177
|
-
* [install_puppetlabs_release_repo_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_puppetlabs_release_repo_on-instance_method)
|
178
|
-
* [install_puppetlabs_dev_repo](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_puppetlabs_dev_repo-instance_method)
|
179
|
-
* [install_packages_from_local_dev_repo](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_packages_from_local_dev_repo-instance_method)
|
180
|
-
* [install_puppet_agent_dev_repo_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_puppet_agent_dev_repo_on-instance_method)
|
181
|
-
* [install_puppet_agent_pe_promoted_repo_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_puppet_agent_pe_promoted_repo_on-instance_method)
|
182
|
-
* [install_cert_on_windows](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/FOSSUtils#install_cert_on_windows-instance_method)
|
183
|
-
|
184
|
-
### PE
|
185
|
-
|
186
|
-
DSL methods for installing Puppet Enterprise. As of Beaker 4.0, moved to `beaker-pe`. See [upgrade_from_3_to_4.md](upgrade_from_3_to_4.md).
|
187
|
-
|
188
|
-
* [add_platform_pe_defaults](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeDefaults#add_platform_pe_defaults-instance_method)
|
189
|
-
* [add_pe_defaults_on](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeDefaults#add_pe_defaults_on-instance_method)
|
190
|
-
* [remove_platform_pe_defaults](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeDefaults#remove_platform_pe_defaults-instance_method)
|
191
|
-
* [remove_pe_defaults_on](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeDefaults#remove_pe_defaults_on-instance_method)
|
192
|
-
* [sorted_hosts](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeUtils#sorted_hosts-instance_method)
|
193
|
-
* [installer_cmd](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeUtils#installer_cmd-instance_method)
|
194
|
-
* [fetch_pe_on_mac](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeUtils#fetch_pe_on_mac-instance_method)
|
195
|
-
* [fetch_pe_on_windows](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeUtils#fetch_pe_on_windows-instance_method)
|
196
|
-
* [fetch_pe_on_unix](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeUtils#fetch_pe_on_unix-instance_method)
|
197
|
-
* [fetch_pe](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeUtils#fetch_pe-instance_method)
|
198
|
-
* [deploy_frictionless_to_master](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeUtils#deploy_frictionless_to_master-instance_method)
|
199
|
-
* [do_install](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeUtils#do_install-instance_method)
|
200
|
-
* [create_agent_specified_arrays](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeUtils#create_agent_specified_arrays-instance_method)
|
201
|
-
* [setup_defaults_and_config_helper_on](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeUtils#setup_defaults_and_config_helper_on-instance_method)
|
202
|
-
* [install_pe](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeUtils#install_pe-instance_method)
|
203
|
-
* [install_pe_on](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeUtils#install_pe_on-instance_method)
|
204
|
-
* [upgrade_pe](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeUtils#upgrade_pe-instance_method)
|
205
|
-
* [upgrade_pe_on](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeUtils#upgrade_pe_on-instance_method)
|
206
|
-
* [higgs_installer_cmd](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeUtils#higgs_installer_cmd-instance_method)
|
207
|
-
* [do_higgs_install](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeUtils#do_higgs_install-instance_method)
|
208
|
-
* [install_higgs](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeUtils#install_higgs-instance_method)
|
209
|
-
* [fetch_and_push_pe](http://www.rubydoc.info/github/puppetlabs/beaker-pe/Beaker/DSL/InstallUtils/PeUtils#fetch_and_push_pe-instance_method)
|
210
|
-
|
211
|
-
### Puppet
|
212
|
-
|
213
|
-
DSL methods that can be used for both FOSS/PE puppet installations. As of Beaker 4.0, moved to `beaker-puppet`. See [upgrade_from_3_to_4.md](upgrade_from_3_to_4.md).
|
214
|
-
|
215
|
-
* [normalize_type](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/PuppetUtils#normalize_type-instance_method)
|
216
|
-
* [construct_puppet_path](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/PuppetUtils#construct_puppet_path-instance_method)
|
217
|
-
* [add_puppet_paths_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/PuppetUtils#add_puppet_paths_on-instance_method)
|
218
|
-
* [remove_puppet_paths_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/PuppetUtils#remove_puppet_paths_on-instance_method)
|
219
|
-
* [configure_defaults_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/PuppetUtils#configure_defaults_on-instance_method)
|
220
|
-
* [configure_type_defaults_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/PuppetUtils#configure_type_defaults_on-instance_method)
|
221
|
-
* [remove_defaults_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/PuppetUtils#remove_defaults_on-instance_method)
|
222
|
-
|
223
|
-
### Windows
|
224
|
-
|
225
|
-
DSL convenience methods for installing packages on Windows SUTs. As of Beaker 4.0, moved to `beaker-puppet`. See [upgrade_from_3_to_4.md](upgrade_from_3_to_4.md).
|
226
|
-
|
227
|
-
* [get_temp_path](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/WindowsUtils#get_temp_path-instance_method)
|
228
|
-
* [msi_install_script](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/WindowsUtils#msi_install_script-instance_method)
|
229
|
-
* [create_install_msi_batch_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/WindowsUtils#create_install_msi_batch_on-instance_method)
|
230
|
-
* [install_msi_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/WindowsUtils#install_msi_on-instance_method)
|
231
|
-
|
232
|
-
### Module
|
233
|
-
|
234
|
-
DSL methods for installing puppet modules. As of Beaker 4.0, moved to `beaker-puppet`. See [upgrade_from_3_to_4.md](upgrade_from_3_to_4.md).
|
235
|
-
|
236
|
-
* [install_dev_puppet_module_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/ModuleUtils#install_dev_puppet_module_on-instance_method)
|
237
|
-
* [install_dev_puppet_module](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/ModuleUtils#install_dev_puppet_module-instance_method)
|
238
|
-
* [install_puppet_module_via_pmt_on](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/ModuleUtils#install_puppet_module_via_pmt_on-instance_method)
|
239
|
-
* [install_puppet_module_via_pmt](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/ModuleUtils#install_puppet_module_via_pmt-instance_method)
|
240
|
-
* [copy_module_to](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/ModuleUtils#copy_module_to-instance_method)
|
241
|
-
* [parse_for_moduleroot](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/ModuleUtils#parse_for_moduleroot-instance_method)
|
242
|
-
* [parse_for_modulename](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/ModuleUtils#parse_for_modulename-instance_method)
|
243
|
-
* [get_module_name](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/ModuleUtils#get_module_name-instance_method)
|
244
|
-
* [split_author_modulename](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/ModuleUtils#split_author_modulename-instance_method)
|
245
|
-
* [build_ignore_list](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/InstallUtils/ModuleUtils#build_ignore_list-instance_method)
|
246
|
-
|
247
81
|
## Outcomes
|
248
82
|
|
249
83
|
Methods that indicate how the given test completed (fail, pass, skip or pending).
|
@@ -294,13 +128,3 @@ DSL methods that describe and define how a test is executed.
|
|
294
128
|
* [tag](http://www.rubydoc.info/github/puppetlabs/beaker/Beaker/DSL/Structure#tag-instance_method)
|
295
129
|
* [select_hosts](http://www.rubydoc.info/github/puppetlabs/beaker/Beaker/DSL/Structure#select_hosts-instance_method)
|
296
130
|
* [inspect_host](http://www.rubydoc.info/github/puppetlabs/beaker/Beaker/DSL/Structure#inspect_host-instance_method)
|
297
|
-
|
298
|
-
## Wrappers
|
299
|
-
|
300
|
-
Wrappers around commonly used commands. As of Beaker 4.0, moved to `beaker-puppet`. See [upgrade_from_3_to_4.md](upgrade_from_3_to_4.md).
|
301
|
-
|
302
|
-
* [facter](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Wrappers#facter-instance_method)
|
303
|
-
* [cfacter](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Wrappers#cfacter-instance_method)
|
304
|
-
* [hiera](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Wrappers#hiera-instance_method)
|
305
|
-
* [puppet](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Wrappers#puppet-instance_method)
|
306
|
-
* [powershell](http://www.rubydoc.info/github/puppetlabs/beaker-puppet/Beaker/DSL/Wrappers#powershell-instance_method)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# How To Upgrade from 3.y to 4.0
|
2
2
|
|
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
|
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 3.y to 4.0. To test out beaker 4.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.
|
4
4
|
|
5
5
|
## PE Dependency
|
6
6
|
|
@@ -33,15 +33,15 @@ Beaker will automatically load the appropriate hypervisors for any given hosts f
|
|
33
33
|
|
34
34
|
The following hypervisor libraries were removed in 4.0:
|
35
35
|
|
36
|
-
- [beaker-abs](github.com/puppetlabs/beaker-abs)
|
37
|
-
- [beaker-aws](github.com/puppetlabs/beaker-aws)
|
38
|
-
- [beaker-docker](github.com/puppetlabs/beaker-docker)
|
39
|
-
- [beaker-google](github.com/puppetlabs/beaker-google)
|
40
|
-
- [beaker-openstack](github.com/puppetlabs/beaker-openstack)
|
41
|
-
- [beaker-vagrant](github.com/puppetlabs/beaker-vagrant)
|
42
|
-
- [beaker-vcloud](github.com/puppetlabs/beaker-vcloud)
|
43
|
-
- [beaker-vmpooler](github.com/puppetlabs/beaker-vmpooler)
|
44
|
-
- [beaker-vmware](github.com/puppetlabs/beaker-vmware)
|
36
|
+
- [beaker-abs](https://github.com/puppetlabs/beaker-abs)
|
37
|
+
- [beaker-aws](https://github.com/puppetlabs/beaker-aws)
|
38
|
+
- [beaker-docker](https://github.com/puppetlabs/beaker-docker)
|
39
|
+
- [beaker-google](https://github.com/puppetlabs/beaker-google)
|
40
|
+
- [beaker-openstack](https://github.com/puppetlabs/beaker-openstack)
|
41
|
+
- [beaker-vagrant](https://github.com/puppetlabs/beaker-vagrant)
|
42
|
+
- [beaker-vcloud](https://github.com/puppetlabs/beaker-vcloud)
|
43
|
+
- [beaker-vmpooler](https://github.com/puppetlabs/beaker-vmpooler)
|
44
|
+
- [beaker-vmware](https://github.com/puppetlabs/beaker-vmware)
|
45
45
|
|
46
46
|
For acceptance testing, beaker-vmpooler, beaker-aws, and beaker-abs have been retained as development dependencies. These will be removed as the CI pipelines is upgraded, so *do not rely on them being there for your project*.
|
47
47
|
|
data/lib/beaker/dsl/roles.rb
CHANGED
@@ -139,7 +139,7 @@ module Beaker
|
|
139
139
|
return !version_is_less(version, '4.0') if version && !version.empty?
|
140
140
|
end
|
141
141
|
return true if host[:roles] && host[:roles].include?('aio')
|
142
|
-
return true if host[:type] && !!(host[:type] =~ /(\A|-)
|
142
|
+
return true if host[:type] && !!(host[:type] =~ /(\A|-)aio(\Z|-)/ )
|
143
143
|
false
|
144
144
|
end
|
145
145
|
|
data/lib/beaker/host.rb
CHANGED
@@ -452,7 +452,7 @@ module Beaker
|
|
452
452
|
require 'pathname'
|
453
453
|
required_dirs.each do |dir|
|
454
454
|
dir_path = Pathname.new(dir)
|
455
|
-
if dir_path.absolute?
|
455
|
+
if dir_path.absolute? and (File.dirname(File.absolute_path(source)).to_s != '/')
|
456
456
|
mkdir_p(File.join(target, dir.gsub(/#{Regexp.escape(File.dirname(File.absolute_path(source)))}/, '')))
|
457
457
|
else
|
458
458
|
mkdir_p( File.join(target, dir) )
|
@@ -466,7 +466,7 @@ module Beaker
|
|
466
466
|
next if File.directory?(s)
|
467
467
|
|
468
468
|
s_path = Pathname.new(s)
|
469
|
-
if s_path.absolute?
|
469
|
+
if s_path.absolute? and (File.dirname(File.absolute_path(source)).to_s != '/')
|
470
470
|
file_path = File.join(target, File.dirname(s).gsub(/#{Regexp.escape(File.dirname(File.absolute_path(source)))}/,''))
|
471
471
|
else
|
472
472
|
file_path = File.join(target, File.dirname(s))
|
@@ -80,7 +80,7 @@ module Unix::File
|
|
80
80
|
# @return [String] Path to package config dir
|
81
81
|
def package_config_dir
|
82
82
|
case self['platform']
|
83
|
-
when /fedora|el-|centos/
|
83
|
+
when /fedora|el-|redhat|centos/
|
84
84
|
'/etc/yum.repos.d/'
|
85
85
|
when /sles/
|
86
86
|
'/etc/zypp/repos.d/'
|
@@ -105,8 +105,9 @@ module Unix::File
|
|
105
105
|
repo_filename = "pl-%s-%s-" % [ package_name, build_version ]
|
106
106
|
|
107
107
|
case variant
|
108
|
-
when /fedora|el|centos|cisco_nexus|cisco_ios_xr|sles/
|
109
|
-
variant = 'el' if
|
108
|
+
when /fedora|el|redhat|centos|cisco_nexus|cisco_ios_xr|sles/
|
109
|
+
variant = 'el' if ['centos', 'redhat'].include?(variant)
|
110
|
+
|
110
111
|
if variant == 'cisco_nexus'
|
111
112
|
variant = 'cisco-wrlinux'
|
112
113
|
version = '5'
|
@@ -144,7 +145,7 @@ module Unix::File
|
|
144
145
|
# @return [String] Type of repo (rpm|deb)
|
145
146
|
def repo_type
|
146
147
|
case self['platform']
|
147
|
-
when /fedora|el-|centos|sles/
|
148
|
+
when /fedora|el-|redhat|centos|sles/
|
148
149
|
'rpm'
|
149
150
|
when /debian|ubuntu|cumulus|huaweios/
|
150
151
|
'deb'
|
data/lib/beaker/host/unix/pkg.rb
CHANGED
@@ -39,7 +39,7 @@ module Unix::Pkg
|
|
39
39
|
when /el-4/
|
40
40
|
@logger.debug("Package query not supported on rhel4")
|
41
41
|
return false
|
42
|
-
when /cisco|fedora|centos|eos|el-/
|
42
|
+
when /cisco|fedora|centos|redhat|eos|el-/
|
43
43
|
result = execute("rpm -q #{name}", opts) { |result| result }
|
44
44
|
when /ubuntu|debian|cumulus|huaweios/
|
45
45
|
result = execute("dpkg -s #{name}", opts) { |result| result }
|
@@ -82,7 +82,7 @@ module Unix::Pkg
|
|
82
82
|
name = "#{name}-#{version}"
|
83
83
|
end
|
84
84
|
execute("dnf -y #{cmdline_args} install #{name}", opts)
|
85
|
-
when /cisco|fedora|centos|eos|el-/
|
85
|
+
when /cisco|fedora|centos|redhat|eos|el-/
|
86
86
|
if version
|
87
87
|
name = "#{name}-#{version}"
|
88
88
|
end
|
@@ -170,7 +170,7 @@ module Unix::Pkg
|
|
170
170
|
@logger.debug("Package uninstallation not supported on rhel4")
|
171
171
|
when /edora-(2[2-9])/
|
172
172
|
execute("dnf -y #{cmdline_args} remove #{name}", opts)
|
173
|
-
when /cisco|fedora|centos|eos|el-/
|
173
|
+
when /cisco|fedora|centos|redhat|eos|el-/
|
174
174
|
execute("yum -y #{cmdline_args} remove #{name}", opts)
|
175
175
|
when /ubuntu|debian|cumulus|huaweios/
|
176
176
|
execute("apt-get purge #{cmdline_args} -y #{name}", opts)
|
@@ -200,7 +200,7 @@ module Unix::Pkg
|
|
200
200
|
@logger.debug("Package upgrade is not supported on rhel4")
|
201
201
|
when /fedora-(2[2-9])/
|
202
202
|
execute("dnf -y #{cmdline_args} update #{name}", opts)
|
203
|
-
when /cisco|fedora|centos|eos|el-/
|
203
|
+
when /cisco|fedora|centos|redhat|eos|el-/
|
204
204
|
execute("yum -y #{cmdline_args} update #{name}", opts)
|
205
205
|
when /ubuntu|debian|cumulus|huaweios/
|
206
206
|
update_apt_if_needed
|
@@ -285,7 +285,7 @@ module Unix::Pkg
|
|
285
285
|
case self['platform']
|
286
286
|
when /el-4/
|
287
287
|
@logger.debug("Package repo deploy is not supported on rhel4")
|
288
|
-
when /fedora|centos|eos|el-/
|
288
|
+
when /fedora|centos|redhat|eos|el-/
|
289
289
|
deploy_yum_repo(path, name, version)
|
290
290
|
when /ubuntu|debian|cumulus|huaweios/
|
291
291
|
deploy_apt_repo(path, name, version)
|
@@ -451,8 +451,8 @@ module Unix::Pkg
|
|
451
451
|
|
452
452
|
variant, version, arch, codename = self['platform'].to_array
|
453
453
|
case variant
|
454
|
-
when /^(fedora|el|centos|sles)$/
|
455
|
-
variant = ((
|
454
|
+
when /^(fedora|el|centos|redhat|sles)$/
|
455
|
+
variant = ((['centos', 'redhat'].include?(variant)) ? 'el' : variant)
|
456
456
|
release_file = "/repos/#{variant}/#{version}/#{puppet_collection}/#{arch}/puppet-agent-*.rpm"
|
457
457
|
download_file = "puppet-agent-#{variant}-#{version}-#{arch}.tar.gz"
|
458
458
|
when /^(debian|ubuntu|cumulus)$/
|
@@ -509,7 +509,7 @@ module Unix::Pkg
|
|
509
509
|
def install_local_package(onhost_package_file, onhost_copy_dir = nil)
|
510
510
|
variant, version, arch, codename = self['platform'].to_array
|
511
511
|
case variant
|
512
|
-
when /^(fedora|el|centos)$/
|
512
|
+
when /^(fedora|el|redhat|centos)$/
|
513
513
|
command_name = 'yum'
|
514
514
|
command_name = 'dnf 'if variant == 'fedora' && version > 21 && version <= 29
|
515
515
|
execute("#{command_name} --nogpgcheck localinstall -y #{onhost_package_file}")
|
@@ -539,7 +539,7 @@ module Unix::Pkg
|
|
539
539
|
def uncompress_local_tarball(onhost_tar_file, onhost_base_dir, download_file)
|
540
540
|
variant, version, arch, codename = self['platform'].to_array
|
541
541
|
case variant
|
542
|
-
when /^(fedora|el|centos|sles|debian|ubuntu|cumulus)$/
|
542
|
+
when /^(fedora|el|centos|redhat|sles|debian|ubuntu|cumulus)$/
|
543
543
|
execute("tar -zxvf #{onhost_tar_file} -C #{onhost_base_dir}")
|
544
544
|
when /^solaris$/
|
545
545
|
# uncompress PE puppet-agent tarball
|
@@ -561,30 +561,31 @@ module Beaker
|
|
561
561
|
|
562
562
|
block_on host do |host|
|
563
563
|
skip_msg = host.skip_set_env?
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
if host['platform'] =~ /windows/ and host.is_cygwin?
|
568
|
-
env['CYGWIN'] = 'nodosfilewarning'
|
569
|
-
end
|
570
|
-
host.ssh_permit_user_environment
|
571
|
-
host.ssh_set_user_environment(env)
|
572
|
-
else
|
573
|
-
logger.debug(skip_msg)
|
564
|
+
unless skip_msg.nil?
|
565
|
+
logger.debug( skip_msg )
|
566
|
+
next
|
574
567
|
end
|
575
568
|
|
576
|
-
|
577
|
-
#close the host to re-establish the connection with the new sshd settings
|
578
|
-
host.close
|
569
|
+
env = construct_env(host, opts)
|
579
570
|
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
host.exec(Command.new("cat #{host[:ssh_env_file]}"))
|
585
|
-
end
|
571
|
+
logger.debug("setting local environment on #{host.name}")
|
572
|
+
|
573
|
+
if host['platform'] =~ /windows/ && host.is_cygwin?
|
574
|
+
env['CYGWIN'] = 'nodosfilewarning'
|
586
575
|
end
|
587
576
|
|
577
|
+
host.ssh_permit_user_environment
|
578
|
+
host.ssh_set_user_environment(env)
|
579
|
+
|
580
|
+
#close the host to re-establish the connection with the new sshd settings
|
581
|
+
host.close
|
582
|
+
|
583
|
+
# print out the working env
|
584
|
+
if host.is_powershell?
|
585
|
+
host.exec(Command.new("SET"))
|
586
|
+
else
|
587
|
+
host.exec(Command.new("cat #{host[:ssh_env_file]}"))
|
588
|
+
end
|
588
589
|
end
|
589
590
|
end
|
590
591
|
|
@@ -61,6 +61,14 @@ module Beaker
|
|
61
61
|
@cmd_options[:pre_cleanup] = value
|
62
62
|
end
|
63
63
|
|
64
|
+
opts.on '--preserve-state',
|
65
|
+
'Preserve the state of the host vm hash for a beaker exec run',
|
66
|
+
'This adds any additional host settings that are defined',
|
67
|
+
'during a beaker subcommand run to .beaker/subcommand_options.yaml,',
|
68
|
+
'allowing us to preserve state across beaker subcommand runs.' do |bool|
|
69
|
+
@cmd_options[:preserve_state] = bool
|
70
|
+
end
|
71
|
+
|
64
72
|
opts.on '--[no-]provision',
|
65
73
|
'Do not provision vm images before testing',
|
66
74
|
'(default: true)' do |bool|
|
data/lib/beaker/perf.rb
CHANGED
@@ -50,7 +50,7 @@ module Beaker
|
|
50
50
|
@logger.perf_output("Enabling aggressive sysstat polling")
|
51
51
|
if host['platform'] =~ /debian|ubuntu/
|
52
52
|
host.exec(Command.new('sed -i s/5-55\\\/10/*/ /etc/cron.d/sysstat'))
|
53
|
-
elsif host['platform'] =~ /centos|el|fedora|oracle|
|
53
|
+
elsif host['platform'] =~ /centos|el|fedora|oracle|redhat|scientific/
|
54
54
|
host.exec(Command.new('sed -i s/*\\\/10/*/ /etc/cron.d/sysstat'))
|
55
55
|
end
|
56
56
|
end
|
data/lib/beaker/platform.rb
CHANGED
@@ -3,7 +3,7 @@ module Beaker
|
|
3
3
|
# all String methods while adding several platform-specific use cases.
|
4
4
|
class Platform < String
|
5
5
|
# Supported platforms
|
6
|
-
PLATFORMS = /^(huaweios|cisco_nexus|cisco_ios_xr|(free|open)bsd|osx|centos|fedora|debian|oracle|redhat|scientific|sles|ubuntu|windows|solaris|aix|archlinux|el|eos|cumulus|f5|netscaler)\-.+\-.+$/
|
6
|
+
PLATFORMS = /^(alpine|huaweios|cisco_nexus|cisco_ios_xr|(free|open)bsd|osx|centos|fedora|debian|oracle|redhat|scientific|sles|ubuntu|windows|solaris|aix|archlinux|el|eos|cumulus|f5|netscaler)\-.+\-.+$/
|
7
7
|
# Platform version numbers vs. codenames conversion hash
|
8
8
|
PLATFORM_VERSION_CODES =
|
9
9
|
{ :debian => { "stretch" => "9",
|
data/lib/beaker/subcommand.rb
CHANGED
@@ -30,6 +30,7 @@ module Beaker
|
|
30
30
|
class_option :'pre-cleanup', :type => :string, :group => 'Beaker run'
|
31
31
|
class_option :'provision', :type => :boolean, :group => 'Beaker run'
|
32
32
|
class_option :'preserve-hosts', :type => :string, :group => 'Beaker run'
|
33
|
+
class_option :'preserve-state', :type => :boolean, :group => 'Beaker run'
|
33
34
|
class_option :'root-keys', :type => :boolean, :group => 'Beaker run'
|
34
35
|
class_option :keyfile, :type => :string, :group => 'Beaker run'
|
35
36
|
class_option :timeout, :type => :string, :group => 'Beaker run'
|
@@ -202,6 +203,15 @@ module Beaker
|
|
202
203
|
end
|
203
204
|
|
204
205
|
@cli.execute!
|
206
|
+
|
207
|
+
if options['preserve-state']
|
208
|
+
@cli.logger.notify 'updating HOSTS key in subcommand_options'
|
209
|
+
hosts = SubcommandUtil.sanitize_options_for_save(@cli.combined_instance_and_options_hosts)
|
210
|
+
options_storage = YAML::Store.new(SubcommandUtil::SUBCOMMAND_OPTIONS)
|
211
|
+
options_storage.transaction do
|
212
|
+
options_storage['HOSTS'] = hosts
|
213
|
+
end
|
214
|
+
end
|
205
215
|
end
|
206
216
|
|
207
217
|
desc "destroy", "Destroys the provisioned VMs"
|
data/lib/beaker/version.rb
CHANGED
@@ -37,9 +37,11 @@ module Beaker
|
|
37
37
|
|
38
38
|
describe '#repo_type' do
|
39
39
|
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
['centos','redhat'].each do |platform|
|
41
|
+
it "returns correctly for platform '#{platform}'" do
|
42
|
+
@platform = "#{platform}-5-x86_64"
|
43
|
+
expect( instance.repo_type ).to be === 'rpm'
|
44
|
+
end
|
43
45
|
end
|
44
46
|
|
45
47
|
it 'returns correctly for debian-based platforms' do
|
@@ -57,9 +59,11 @@ module Beaker
|
|
57
59
|
|
58
60
|
describe '#package_config_dir' do
|
59
61
|
|
60
|
-
|
61
|
-
|
62
|
-
|
62
|
+
['centos','redhat'].each do |platform|
|
63
|
+
it "returns correctly for platform '#{platform}'" do
|
64
|
+
@platform = "#{platform}-5-x86_64"
|
65
|
+
expect( instance.package_config_dir ).to be === '/etc/yum.repos.d/'
|
66
|
+
end
|
63
67
|
end
|
64
68
|
|
65
69
|
it 'returns correctly for debian-based platforms' do
|
@@ -82,11 +86,13 @@ module Beaker
|
|
82
86
|
|
83
87
|
describe '#repo_filename' do
|
84
88
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
89
|
+
['centos','redhat'].each do |platform|
|
90
|
+
it "sets the el portion correctly for '#{platform}'" do
|
91
|
+
@platform = "#{platform}-5-x86_64"
|
92
|
+
allow( instance ).to receive( :is_pe? ) { false }
|
93
|
+
filename = instance.repo_filename( 'pkg_name', 'pkg_version7' )
|
94
|
+
expect( filename ).to match( /sion7\-el\-/ )
|
95
|
+
end
|
90
96
|
end
|
91
97
|
|
92
98
|
it 'sets the sles portion correctly for sles platforms' do
|
@@ -111,12 +111,14 @@ module Beaker
|
|
111
111
|
expect( instance.check_for_package(pkg) ).to be === true
|
112
112
|
end
|
113
113
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
114
|
+
['centos','redhat'].each do |platform|
|
115
|
+
it "checks correctly on #{platform}" do
|
116
|
+
@opts = {'platform' => "#{platform}-is-me"}
|
117
|
+
pkg = "#{platform}_package"
|
118
|
+
expect( Beaker::Command ).to receive(:new).with("rpm -q #{pkg}", [], {:prepend_cmds=>nil, :cmdexe=>false}).and_return('')
|
119
|
+
expect( instance ).to receive(:exec).with('', :accept_all_exit_codes => true).and_return(generate_result("hello", {:exit_code => 0}))
|
120
|
+
expect( instance.check_for_package(pkg) ).to be === true
|
121
|
+
end
|
120
122
|
end
|
121
123
|
|
122
124
|
it "checks correctly on EOS" do
|
@@ -534,7 +536,7 @@ module Beaker
|
|
534
536
|
|
535
537
|
it 'Centos & EL: uses yum' do
|
536
538
|
package_file = 'testing_789.yay'
|
537
|
-
['centos',
|
539
|
+
['centos','redhat'].each do |platform|
|
538
540
|
@platform = platform
|
539
541
|
expect( instance ).to receive( :execute ).with( /^yum.*#{package_file}$/ )
|
540
542
|
instance.install_local_package( package_file )
|
@@ -91,8 +91,8 @@ describe Beaker do
|
|
91
91
|
]
|
92
92
|
end
|
93
93
|
|
94
|
-
['centos','el-','redhat','fedora','eos'].each do |
|
95
|
-
it_should_behave_like 'enables_root_login',
|
94
|
+
['centos','el-','redhat','fedora','eos'].each do | redhat_like |
|
95
|
+
it_should_behave_like 'enables_root_login', redhat_like, [
|
96
96
|
"sudo su -c \"sed -ri 's/^#?PermitRootLogin no|^#?PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config\"",
|
97
97
|
"sudo -E /sbin/service sshd reload"
|
98
98
|
]
|
@@ -346,7 +346,7 @@ describe Beaker do
|
|
346
346
|
|
347
347
|
expect( Beaker::Command ).to receive( :new ).with(
|
348
348
|
"rpm -qa | grep epel-release"
|
349
|
-
).exactly(
|
349
|
+
).exactly( hosts.count ).times
|
350
350
|
hosts.each do |host|
|
351
351
|
expect(host).to receive( :install_package_with_rpm ).with(
|
352
352
|
"http://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm", "--replacepkgs", {:package_proxy => false}
|
@@ -354,13 +354,13 @@ describe Beaker do
|
|
354
354
|
end
|
355
355
|
expect( Beaker::Command ).to receive( :new ).with(
|
356
356
|
"sed -i -e 's;#baseurl.*$;baseurl=http://dl\\.fedoraproject\\.org/pub/epel/6/$basearch;' /etc/yum.repos.d/epel.repo"
|
357
|
-
).exactly(
|
357
|
+
).exactly( hosts.count ).times
|
358
358
|
expect( Beaker::Command ).to receive( :new ).with(
|
359
359
|
"sed -i -e '/mirrorlist/d' /etc/yum.repos.d/epel.repo"
|
360
|
-
).exactly(
|
360
|
+
).exactly( hosts.count ).times
|
361
361
|
expect( Beaker::Command ).to receive( :new ).with(
|
362
362
|
"yum clean all && yum makecache"
|
363
|
-
).exactly(
|
363
|
+
).exactly( hosts.count ).times
|
364
364
|
|
365
365
|
subject.add_el_extras( hosts, options )
|
366
366
|
|
@@ -485,38 +485,40 @@ describe Beaker do
|
|
485
485
|
end
|
486
486
|
end
|
487
487
|
|
488
|
-
|
489
|
-
|
490
|
-
:
|
491
|
-
|
492
|
-
|
488
|
+
['centos','redhat'].each do |platform|
|
489
|
+
context "on platform '#{platform}'" do
|
490
|
+
let(:host) { make_host( 'name', {
|
491
|
+
:platform => platform,
|
492
|
+
:stdout => stdout,
|
493
|
+
} ) }
|
493
494
|
|
494
|
-
|
495
|
-
|
496
|
-
|
495
|
+
before(:each) do
|
496
|
+
expect( Beaker::Command ).to receive( :new ).with( "cat /etc/resolv.conf" ).once
|
497
|
+
end
|
497
498
|
|
498
|
-
|
499
|
-
|
499
|
+
context "with a domain entry" do
|
500
|
+
let(:stdout) { "domain labs.lan d.labs.net dc1.labs.net labs.com\nnameserver 10.16.22.10\nnameserver 10.16.22.11" }
|
500
501
|
|
501
|
-
|
502
|
-
|
502
|
+
include_examples 'find domain name'
|
503
|
+
end
|
503
504
|
|
504
|
-
|
505
|
-
|
505
|
+
context "with a search entry" do
|
506
|
+
let(:stdout) { "search labs.lan d.labs.net dc1.labs.net labs.com\nnameserver 10.16.22.10\nnameserver 10.16.22.11" }
|
506
507
|
|
507
|
-
|
508
|
-
|
508
|
+
include_examples 'find domain name'
|
509
|
+
end
|
509
510
|
|
510
|
-
|
511
|
-
|
511
|
+
context "with a both a domain and a search entry" do
|
512
|
+
let(:stdout) { "domain labs.lan\nsearch d.labs.net dc1.labs.net labs.com\nnameserver 10.16.22.10\nnameserver 10.16.22.11" }
|
512
513
|
|
513
|
-
|
514
|
-
|
514
|
+
include_examples 'find domain name'
|
515
|
+
end
|
515
516
|
|
516
|
-
|
517
|
-
|
517
|
+
context "with a both a domain and a search entry, the search entry first" do
|
518
|
+
let(:stdout) { "search foo.example.net\ndomain labs.lan d.labs.net dc1.labs.net labs.com\nnameserver 10.16.22.10\nnameserver 10.16.22.11" }
|
518
519
|
|
519
|
-
|
520
|
+
include_examples 'find domain name'
|
521
|
+
end
|
520
522
|
end
|
521
523
|
end
|
522
524
|
end
|
@@ -584,15 +586,16 @@ describe Beaker do
|
|
584
586
|
subject.package_proxy(host, options.merge( {'package_proxy' => proxyurl}) )
|
585
587
|
end
|
586
588
|
|
587
|
-
|
588
|
-
|
589
|
+
['centos','redhat'].each do |platform|
|
590
|
+
it "can set proxy config on a '#{platform}' host" do
|
591
|
+
host = make_host('name', { :platform => platform } )
|
589
592
|
|
590
|
-
|
591
|
-
|
593
|
+
expect( Beaker::Command ).to receive( :new ).with( "echo 'proxy=#{proxyurl}/' >> /etc/yum.conf" ).once
|
594
|
+
expect( host ).to receive( :exec ).once
|
592
595
|
|
593
|
-
|
596
|
+
subject.package_proxy(host, options.merge( {'package_proxy' => proxyurl}) )
|
597
|
+
end
|
594
598
|
end
|
595
|
-
|
596
599
|
end
|
597
600
|
|
598
601
|
context "set_env" do
|
data/spec/beaker/host_spec.rb
CHANGED
@@ -363,9 +363,11 @@ module Beaker
|
|
363
363
|
expect( host.touch('touched_file') ).to be == "c:\\\\windows\\\\system32\\\\cmd.exe /c echo. 2> touched_file"
|
364
364
|
end
|
365
365
|
|
366
|
-
|
367
|
-
|
368
|
-
|
366
|
+
['centos','redhat'].each do |platform|
|
367
|
+
it "generates the right absolute command for a #{platform} host" do
|
368
|
+
@platform = platform
|
369
|
+
expect( host.touch('touched_file') ).to be == "/bin/touch touched_file"
|
370
|
+
end
|
369
371
|
end
|
370
372
|
|
371
373
|
it "generates the right absolute command for an osx host" do
|
@@ -487,6 +489,67 @@ module Beaker
|
|
487
489
|
host.do_scp_to *args
|
488
490
|
end
|
489
491
|
end
|
492
|
+
|
493
|
+
context "using an ignore array with an absolute source path in host root" do
|
494
|
+
let( :source_path ) { '/puppetlabs-inifile' }
|
495
|
+
let( :target_path ) { '/etc/puppetlabs/modules/inifile' }
|
496
|
+
|
497
|
+
before :each do
|
498
|
+
test_dir = "#{source_path}/tests"
|
499
|
+
other_test_dir = "#{source_path}/tests/tests2"
|
500
|
+
another_test_dir = "#{source_path}/tests/tests3"
|
501
|
+
|
502
|
+
files = [
|
503
|
+
'00_EnvSetup.rb', '035_StopFirewall.rb', '05_HieraSetup.rb',
|
504
|
+
'01_TestSetup.rb', '03_PuppetMasterSanity.rb',
|
505
|
+
'06_InstallModules.rb','02_PuppetUserAndGroup.rb',
|
506
|
+
'04_ValidateSignCert.rb', '07_InstallCACerts.rb' ]
|
507
|
+
|
508
|
+
@fileset1 = files.shuffle.map {|file| test_dir + '/' + file }
|
509
|
+
@fileset2 = files.shuffle.map {|file| other_test_dir + '/' + file }
|
510
|
+
@fileset3 = files.shuffle.map {|file| another_test_dir + '/' + file }
|
511
|
+
|
512
|
+
create_files( @fileset1 )
|
513
|
+
create_files( @fileset2 )
|
514
|
+
create_files( @fileset3 )
|
515
|
+
end
|
516
|
+
|
517
|
+
it "should create target dirs with correct path seperator" do
|
518
|
+
create_files(['source'])
|
519
|
+
exclude_file = '04_ValidateSignCert.rb'
|
520
|
+
logger = host[:logger]
|
521
|
+
conn = double(:connection)
|
522
|
+
@options = { :logger => logger }
|
523
|
+
host.instance_variable_set :@connection, conn
|
524
|
+
args = [ source_path, target_path, {:ignore => [exclude_file]} ]
|
525
|
+
conn_args = args
|
526
|
+
|
527
|
+
allow( Dir ).to receive( :glob ).and_return( @fileset1 + @fileset2 + @fileset3)
|
528
|
+
|
529
|
+
created_target_path = File.join(target_path, File.basename(source_path))
|
530
|
+
expect( host ).to receive( :mkdir_p ).with("#{created_target_path}/tests")
|
531
|
+
expect( host ).to receive( :mkdir_p ).with("#{created_target_path}/tests/tests2")
|
532
|
+
expect( host ).to receive( :mkdir_p ).with("#{created_target_path}/tests/tests3")
|
533
|
+
|
534
|
+
(@fileset1 + @fileset2 + @fileset3).each do |file|
|
535
|
+
if file !~ /#{exclude_file}/
|
536
|
+
file_args = [ file, File.join(created_target_path, File.dirname(file).gsub(source_path,'')), {:ignore => [exclude_file], :dry_run => false} ]
|
537
|
+
conn_args = file_args
|
538
|
+
expect( conn ).to receive(:scp_to).with( *conn_args ).and_return(Beaker::Result.new(host, 'output!'))
|
539
|
+
else
|
540
|
+
file_args = [ file, File.join(created_target_path, File.dirname(file).gsub(source_path,'')), {:ignore => [exclude_file], :dry_run => false} ]
|
541
|
+
conn_args = file_args
|
542
|
+
expect( conn ).to_not receive(:scp_to).with( *conn_args )
|
543
|
+
end
|
544
|
+
end
|
545
|
+
allow( conn ).to receive(:ip).and_return(host['ip'])
|
546
|
+
allow( conn ).to receive(:vmhostname).and_return(host['vmhostname'])
|
547
|
+
allow( conn ).to receive(:hostname).and_return(host.name)
|
548
|
+
|
549
|
+
host.do_scp_to *args
|
550
|
+
end
|
551
|
+
end
|
552
|
+
|
490
553
|
context "using an ignore array" do
|
491
554
|
|
492
555
|
before :each do
|
@@ -97,11 +97,12 @@ module Beaker
|
|
97
97
|
expect( platform.with_version_codename ).to be === 'ubuntu-lucid-xxx'
|
98
98
|
end
|
99
99
|
|
100
|
-
|
101
|
-
|
102
|
-
|
100
|
+
['centos','redhat'].each do |p|
|
101
|
+
it "leaves #{p}-7-xxx alone" do
|
102
|
+
@name = "#{p}-7-xxx"
|
103
|
+
expect( platform.with_version_codename ).to be === "#{p}-7-xxx"
|
104
|
+
end
|
103
105
|
end
|
104
|
-
|
105
106
|
end
|
106
107
|
|
107
108
|
context 'with_version_number' do
|
@@ -126,11 +127,12 @@ module Beaker
|
|
126
127
|
expect( platform.with_version_number ).to be === 'ubuntu-1210-xxx'
|
127
128
|
end
|
128
129
|
|
129
|
-
|
130
|
-
|
131
|
-
|
130
|
+
['centos','redhat'].each do |p|
|
131
|
+
it "leaves #{p}-7-xxx alone" do
|
132
|
+
@name = "#{p}-7-xxx"
|
133
|
+
expect( platform.with_version_number ).to be === "#{p}-7-xxx"
|
134
|
+
end
|
132
135
|
end
|
133
|
-
|
134
136
|
end
|
135
137
|
|
136
138
|
context 'round tripping from yaml', if: RUBY_VERSION =~ /^1\.9/ do
|
@@ -43,6 +43,7 @@ module Beaker
|
|
43
43
|
'pre-cleanup',
|
44
44
|
'provision',
|
45
45
|
'preserve-hosts',
|
46
|
+
'preserve-state',
|
46
47
|
'root-keys',
|
47
48
|
'keyfile',
|
48
49
|
'timeout',
|
@@ -248,6 +249,32 @@ module Beaker
|
|
248
249
|
subcommand.exec('pre-suite,tests/whoops')
|
249
250
|
}.to raise_error(ArgumentError, %r{Unable to parse pre-suite,tests/whoops})
|
250
251
|
end
|
252
|
+
|
253
|
+
|
254
|
+
let( :yaml_store_mock ) { double('yaml_store_mock') }
|
255
|
+
let( :host_hash ) { {'mynode.net' => {:name => 'mynode', :platform => Beaker::Platform.new('centos-6-x86_64')}}}
|
256
|
+
let( :cleaned_hosts ) {double()}
|
257
|
+
it 'updates the subcommand_options file with new host info if `preserve-state` is set' do
|
258
|
+
allow(yaml_store_mock).to receive(:[]).and_return(false)
|
259
|
+
allow(subcommand).to receive(:options).and_return('preserve-state' => true)
|
260
|
+
|
261
|
+
expect(subcommand.cli).to receive(:parse_options).and_return(subcommand.cli)
|
262
|
+
expect(subcommand.cli).to receive(:combined_instance_and_options_hosts).and_return(host_hash)
|
263
|
+
expect(SubcommandUtil).to receive(:sanitize_options_for_save).and_return(cleaned_hosts)
|
264
|
+
expect(YAML::Store).to receive(:new).with(SubcommandUtil::SUBCOMMAND_OPTIONS).and_return(yaml_store_mock)
|
265
|
+
expect(yaml_store_mock).to receive(:transaction).and_yield.once
|
266
|
+
expect(yaml_store_mock).to receive(:[]=).with('HOSTS', cleaned_hosts)
|
267
|
+
expect(subcommand.cli.logger).to receive(:notify)
|
268
|
+
|
269
|
+
subcommand.exec('tests')
|
270
|
+
end
|
271
|
+
|
272
|
+
it 'does not attempt preserve state if the flag is not passed in' do
|
273
|
+
subcommand.exec('tests')
|
274
|
+
|
275
|
+
expect(SubcommandUtil).to receive(:sanitize_options_for_save).never
|
276
|
+
expect(subcommand.cli.options['preserve-state']).to be_nil
|
277
|
+
end
|
251
278
|
end
|
252
279
|
|
253
280
|
context 'destroy' do
|
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: 4.
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -643,7 +643,6 @@ files:
|
|
643
643
|
- spec/beaker/host_prebuilt_steps_spec.rb
|
644
644
|
- spec/beaker/host_spec.rb
|
645
645
|
- spec/beaker/hypervisor/hypervisor_spec.rb
|
646
|
-
- spec/beaker/hypervisor/hypervisor_spec.rb.orig
|
647
646
|
- spec/beaker/logger_junit_spec.rb
|
648
647
|
- spec/beaker/logger_spec.rb
|
649
648
|
- spec/beaker/network_manager_spec.rb
|
@@ -1,80 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Beaker
|
4
|
-
describe Hypervisor do
|
5
|
-
let( :hypervisor ) { Beaker::Hypervisor }
|
6
|
-
|
7
|
-
it "creates an aix hypervisor for aix hosts" do
|
8
|
-
aix = double( 'aix' )
|
9
|
-
aix.stub( :provision ).and_return( true )
|
10
|
-
|
11
|
-
Aixer.should_receive( :new ).once.and_return( aix )
|
12
|
-
expect( hypervisor.create( 'aix', [], make_opts() ) ).to be === aix
|
13
|
-
end
|
14
|
-
|
15
|
-
it "creates a solaris hypervisor for solaris hosts" do
|
16
|
-
solaris = double( 'solaris' )
|
17
|
-
solaris.stub( :provision ).and_return( true )
|
18
|
-
Solaris.should_receive( :new ).once.and_return( solaris )
|
19
|
-
expect( hypervisor.create( 'solaris', [], make_opts() ) ).to be === solaris
|
20
|
-
end
|
21
|
-
|
22
|
-
it "creates a vsphere hypervisor for vsphere hosts" do
|
23
|
-
vsphere = double( 'vsphere' )
|
24
|
-
vsphere.stub( :provision ).and_return( true )
|
25
|
-
Vsphere.should_receive( :new ).once.and_return( vsphere )
|
26
|
-
expect( hypervisor.create( 'vsphere', [], make_opts() ) ).to be === vsphere
|
27
|
-
end
|
28
|
-
|
29
|
-
it "creates a fusion hypervisor for fusion hosts" do
|
30
|
-
fusion = double( 'fusion' )
|
31
|
-
fusion.stub( :provision ).and_return( true )
|
32
|
-
Fusion.should_receive( :new ).once.and_return( fusion )
|
33
|
-
expect( hypervisor.create( 'fusion', [], make_opts() ) ).to be === fusion
|
34
|
-
end
|
35
|
-
|
36
|
-
it "creates a vcloudpooled hypervisor for vcloud hosts that are pooled" do
|
37
|
-
vcloud = double( 'vcloud' )
|
38
|
-
vcloud.stub( :provision ).and_return( true )
|
39
|
-
VcloudPooled.should_receive( :new ).once.and_return( vcloud )
|
40
|
-
expect( hypervisor.create( 'vcloud', [], make_opts().merge( { 'pooling_api' => true } ) ) ).to be === vcloud
|
41
|
-
end
|
42
|
-
|
43
|
-
it "creates a vcloud hypervisor for vcloud hosts that are not pooled" do
|
44
|
-
vcloud = double( 'vcloud' )
|
45
|
-
vcloud.stub( :provision ).and_return( true )
|
46
|
-
Vcloud.should_receive( :new ).once.and_return( vcloud )
|
47
|
-
expect( hypervisor.create( 'vcloud', [], make_opts().merge( { 'pooling_api' => false } ) ) ).to be === vcloud
|
48
|
-
end
|
49
|
-
|
50
|
-
it "creates a vagrant hypervisor for vagrant hosts" do
|
51
|
-
vagrant = double( 'vagrant' )
|
52
|
-
vagrant.stub( :provision ).and_return( true )
|
53
|
-
Vagrant.should_receive( :new ).once.and_return( vagrant )
|
54
|
-
expect( hypervisor.create( 'vagrant', [], make_opts() ) ).to be === vagrant
|
55
|
-
end
|
56
|
-
|
57
|
-
it "creates a vagrant_fusion hypervisor for vagrant vmware fusion hosts" do
|
58
|
-
vagrant = double( 'vagrant_fusion' )
|
59
|
-
vagrant.stub( :provision ).and_return( true )
|
60
|
-
VagrantFusion.should_receive( :new ).once.and_return( vagrant )
|
61
|
-
expect( hypervisor.create( 'vagrant_fusion', [], make_opts() ) ).to be === vagrant
|
62
|
-
end
|
63
|
-
|
64
|
-
it "creates a vagrant_virtualbox hypervisor for vagrant virtualbox hosts" do
|
65
|
-
vagrant = double( 'vagrant_virtualbox' )
|
66
|
-
vagrant.stub( :provision ).and_return( true )
|
67
|
-
VagrantVirtualbox.should_receive( :new ).once.and_return( vagrant )
|
68
|
-
expect( hypervisor.create( 'vagrant_virtualbox', [], make_opts() ) ).to be === vagrant
|
69
|
-
end
|
70
|
-
|
71
|
-
it "creates a blimpy hypervisor for blimpy hosts" do
|
72
|
-
blimpy = double( 'blimpy' )
|
73
|
-
blimpy.stub( :provision ).and_return( true )
|
74
|
-
Blimper.should_receive( :new ).once.and_return( blimpy )
|
75
|
-
expect( hypervisor.create( 'blimpy', [], make_opts() ) ).to be === blimpy
|
76
|
-
end
|
77
|
-
|
78
|
-
|
79
|
-
end
|
80
|
-
end
|