beaker 3.5.0 → 3.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/acceptance/tests/base/host/group_test.rb +18 -0
- data/acceptance/tests/base/host/packages.rb +6 -2
- data/acceptance/tests/base/host/user_test.rb +18 -0
- data/lib/beaker/cli.rb +4 -3
- data/lib/beaker/host.rb +7 -0
- data/lib/beaker/host/pswindows/exec.rb +16 -6
- data/lib/beaker/host/pswindows/group.rb +1 -1
- data/lib/beaker/host/pswindows/user.rb +1 -1
- data/lib/beaker/host/windows/exec.rb +17 -7
- data/lib/beaker/host/windows/group.rb +1 -1
- data/lib/beaker/host/windows/pkg.rb +1 -1
- data/lib/beaker/host/windows/user.rb +1 -1
- data/lib/beaker/hypervisor/vagrant.rb +2 -1
- data/lib/beaker/options/parser.rb +39 -4
- data/lib/beaker/version.rb +1 -1
- data/spec/beaker/cli_spec.rb +3 -0
- data/spec/beaker/host/windows/exec_spec.rb +9 -0
- data/spec/beaker/host_spec.rb +5 -0
- data/spec/beaker/hypervisor/vagrant_spec.rb +2 -3
- data/spec/beaker/options/parser_spec.rb +46 -4
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmVmMDI1YTVjZDNjZmM4ODI2MGUzOTBiNDg2YmVlMDMwZGQyY2M2Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OWExZDNiOGU2NmRkNGJjYTM3MjlhZGRlODk3M2NiYzBjYTE3NmZkZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmRmNjhhMWYzZTEzZTk3ZDRiNTEzMzkwYjE3NzBmZDgzOGQzY2I0NTI4OGUy
|
10
|
+
ZjNmN2ZhNjM5ZDI0ZDY3YTRjOGJhMWRmMjViZWM3YzY0Y2QzNTE4ZjIxYzI4
|
11
|
+
NTQ1ZjU4YzVhMjAwMjUxMjY1Y2VlZmFmZDUzMjU1MGNiZGIwYzY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjA4NjRjYjVjMzEyMzg1ZTk2YWEwMDdhYzU1NTU2NjdlZjY1ZjNlN2EwMzc3
|
14
|
+
MWJlMzE4MGQ5Mzc1N2QxZDQ3YjU0M2U5Nzk3MjE1YWI5YWZhMmE4MzA5MjI2
|
15
|
+
ZjhlYTJjNGRiMTc4YTQzOTlmOTE4N2NhYTQwMjFjNzUxMDQwMGE=
|
@@ -0,0 +1,18 @@
|
|
1
|
+
test_name 'Group Test' do
|
2
|
+
step "#group_get: has an Administrators group on Windows" do
|
3
|
+
hosts.select { |h| h['platform'] =~ /windows/ }.each do |host|
|
4
|
+
host.group_get('Administrators') do |result|
|
5
|
+
refute_match(result.stdout, '1376', 'Output indicates Administrators not found')
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
step "#group_get: should not have CroMags group on Windows" do
|
11
|
+
hosts.select { |h| h['platform'] =~ /windows/ }.each do |host|
|
12
|
+
assert_raises Beaker::Host::CommandFailure do
|
13
|
+
host.group_get('CroMags') { |result| }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
@@ -60,7 +60,11 @@ hosts.each do |host|
|
|
60
60
|
|
61
61
|
assert_equal(false, host.check_for_package(package), "'#{package}' not should be installed")
|
62
62
|
logger.debug("#{package} should be installed on #{host}")
|
63
|
-
|
63
|
+
cmdline_args = ''
|
64
|
+
# Newer vmpooler hosts created by Packer templates, and running Cygwin 2.4,
|
65
|
+
# must have these switches passed
|
66
|
+
cmdline_args = '--local-install --download' if (host['platform'] =~ /windows/ and host.is_cygwin?)
|
67
|
+
host.install_package(package, cmdline_args)
|
64
68
|
assert(host.check_for_package(package), "'#{package}' should be installed")
|
65
69
|
|
66
70
|
# windows does not support uninstall_package
|
@@ -74,4 +78,4 @@ hosts.each do |host|
|
|
74
78
|
end
|
75
79
|
end
|
76
80
|
|
77
|
-
end
|
81
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
test_name 'User Test' do
|
2
|
+
step "#user_get: has an Administrator user on Windows" do
|
3
|
+
hosts.select { |h| h['platform'] =~ /windows/ }.each do |host|
|
4
|
+
host.user_get('Administrator') do |result|
|
5
|
+
refute_match(result.stdout, 'NET HELPMSG', 'Output indicates Administrator not found')
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
step "#user_get: should not have CaptainCaveman user on Windows" do
|
11
|
+
hosts.select { |h| h['platform'] =~ /windows/ }.each do |host|
|
12
|
+
assert_raises Beaker::Host::CommandFailure do
|
13
|
+
host.user_get('CaptainCaveman') { |result| }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
data/lib/beaker/cli.rb
CHANGED
@@ -13,11 +13,12 @@ module Beaker
|
|
13
13
|
@timestamp = Time.now
|
14
14
|
@options_parser = Beaker::Options::Parser.new
|
15
15
|
@options = @options_parser.parse_args
|
16
|
+
@attribution = @options_parser.attribution
|
16
17
|
@logger = Beaker::Logger.new(@options)
|
17
18
|
InParallel::InParallelExecutor.logger = @logger
|
18
|
-
@
|
19
|
-
@
|
20
|
-
@
|
19
|
+
@options_parser.update_option(:logger, @logger, 'runtime')
|
20
|
+
@options_parser.update_option(:timestamp, @timestamp, 'runtime')
|
21
|
+
@options_parser.update_option(:beaker_version, Beaker::Version::STRING, 'runtime')
|
21
22
|
beaker_version_string = VERSION_STRING % @options[:beaker_version]
|
22
23
|
@execute = true
|
23
24
|
|
data/lib/beaker/host.rb
CHANGED
@@ -340,6 +340,13 @@ module Beaker
|
|
340
340
|
@logger.debug "\n#{log_prefix} executed in %0.2f seconds" % seconds
|
341
341
|
end
|
342
342
|
|
343
|
+
if options[:reset_connection]
|
344
|
+
# Expect the connection to fail hard and possibly take a long time timeout.
|
345
|
+
# Pre-emptively reset it so we don't wait forever.
|
346
|
+
close
|
347
|
+
return result
|
348
|
+
end
|
349
|
+
|
343
350
|
unless options[:silent]
|
344
351
|
# What?
|
345
352
|
result.log(@logger)
|
@@ -42,13 +42,23 @@ module PSWindows::Exec
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def get_ip
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
45
|
+
# when querying for an IP this way the return value can be formatted like:
|
46
|
+
# IPAddress=
|
47
|
+
# IPAddress={"129.168.0.1"}
|
48
|
+
# IPAddress={"192.168.0.1","2001:db8:aaaa:bbbb:cccc:dddd:eeee:0001"}
|
49
|
+
|
50
|
+
ips = execute("wmic nicconfig where ipenabled=true GET IPAddress /format:list")
|
51
|
+
|
52
|
+
ip = ''
|
53
|
+
ips.each_line do |line|
|
54
|
+
matches = line.split('=')
|
55
|
+
next if matches.length <= 1
|
56
|
+
matches = matches[1].match(/^{"(.*?)"/)
|
57
|
+
next if matches.nil? || matches.captures.nil? || matches.captures.empty?
|
58
|
+
ip = matches.captures[0] if matches && matches.captures
|
59
|
+
break if ip != ''
|
51
60
|
end
|
61
|
+
|
52
62
|
ip
|
53
63
|
end
|
54
64
|
|
@@ -16,7 +16,7 @@ module PSWindows::Group
|
|
16
16
|
|
17
17
|
def group_get(name, &block)
|
18
18
|
execute("net localgroup \"#{name}\"") do |result|
|
19
|
-
fail_test "failed to get group #{name}"
|
19
|
+
fail_test "failed to get group #{name}" if result.exit_code != 0
|
20
20
|
|
21
21
|
yield result if block_given?
|
22
22
|
end
|
@@ -16,7 +16,7 @@ module PSWindows::User
|
|
16
16
|
|
17
17
|
def user_get(name, &block)
|
18
18
|
execute("net user \"#{name}\"") do |result|
|
19
|
-
fail_test "failed to get user #{name}"
|
19
|
+
fail_test "failed to get user #{name}" if result.exit_code != 0
|
20
20
|
|
21
21
|
yield result if block_given?
|
22
22
|
end
|
@@ -2,7 +2,7 @@ module Windows::Exec
|
|
2
2
|
include Beaker::CommandFactory
|
3
3
|
|
4
4
|
def reboot
|
5
|
-
exec(Beaker::Command.new('shutdown /f /r /t 0 /d p:4:1 /c "Beaker::Host reboot command issued"'), :
|
5
|
+
exec(Beaker::Command.new('shutdown /f /r /t 0 /d p:4:1 /c "Beaker::Host reboot command issued"'), :reset_connection => true)
|
6
6
|
# rebooting on windows is sloooooow
|
7
7
|
# give it some breathing room before attempting a reconnect
|
8
8
|
sleep(40)
|
@@ -24,13 +24,23 @@ module Windows::Exec
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def get_ip
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
27
|
+
# when querying for an IP this way the return value can be formatted like:
|
28
|
+
# IPAddress=
|
29
|
+
# IPAddress={"129.168.0.1"}
|
30
|
+
# IPAddress={"192.168.0.1","2001:db8:aaaa:bbbb:cccc:dddd:eeee:0001"}
|
31
|
+
|
32
|
+
ips = execute("wmic nicconfig where ipenabled=true GET IPAddress /format:list")
|
33
|
+
|
34
|
+
ip = ''
|
35
|
+
ips.each_line do |line|
|
36
|
+
matches = line.split('=')
|
37
|
+
next if matches.length <= 1
|
38
|
+
matches = matches[1].match(/^{"(.*?)"/)
|
39
|
+
next if matches.nil? || matches.captures.nil? || matches.captures.empty?
|
40
|
+
ip = matches.captures[0] if matches && matches.captures
|
41
|
+
break if ip != ''
|
33
42
|
end
|
43
|
+
|
34
44
|
ip
|
35
45
|
end
|
36
46
|
|
@@ -16,7 +16,7 @@ module Windows::Group
|
|
16
16
|
|
17
17
|
def group_get(name, &block)
|
18
18
|
execute("net localgroup \"#{name}\"") do |result|
|
19
|
-
fail_test "failed to get group #{name}"
|
19
|
+
fail_test "failed to get group #{name}" if result.exit_code != 0
|
20
20
|
|
21
21
|
yield result if block_given?
|
22
22
|
end
|
@@ -34,7 +34,7 @@ module Windows::Pkg
|
|
34
34
|
execute(command)
|
35
35
|
end
|
36
36
|
end
|
37
|
-
execute("#{cygwin} -q -n -N -d -R #{
|
37
|
+
execute("#{cygwin} -q -n -N -d -R #{rootdir} -s http://cygwin.osuosl.org -P #{name} #{cmdline_args}")
|
38
38
|
end
|
39
39
|
|
40
40
|
def uninstall_package(name, cmdline_args = '')
|
@@ -16,7 +16,7 @@ module Windows::User
|
|
16
16
|
|
17
17
|
def user_get(name, &block)
|
18
18
|
execute("net user \"#{name}\"") do |result|
|
19
|
-
fail_test "failed to get user #{name}"
|
19
|
+
fail_test "failed to get user #{name}" if result.exit_code != 0
|
20
20
|
|
21
21
|
yield result if block_given?
|
22
22
|
end
|
@@ -147,7 +147,8 @@ module Beaker
|
|
147
147
|
ip = m[2]
|
148
148
|
@logger.debug("Determined existing vagrant box #{hostname} ip to be: #{ip} ")
|
149
149
|
else
|
150
|
-
|
150
|
+
ip = nil
|
151
|
+
@logger.debug("Unable to determine ip for vagrant box #{hostname}")
|
151
152
|
end
|
152
153
|
else
|
153
154
|
raise("No vagrant file found (should be located at #{@vagrant_file})")
|
@@ -15,6 +15,7 @@ module Beaker
|
|
15
15
|
|
16
16
|
#The OptionsHash of all parsed options
|
17
17
|
attr_accessor :options
|
18
|
+
attr_reader :attribution
|
18
19
|
|
19
20
|
# Returns the git repository used for git installations
|
20
21
|
# @return [String] The git repository
|
@@ -165,6 +166,34 @@ module Beaker
|
|
165
166
|
@command_line_parser = Beaker::Options::CommandLineParser.new
|
166
167
|
@presets = Beaker::Options::Presets.new
|
167
168
|
@validator = Beaker::Options::Validator.new
|
169
|
+
@attribution = Beaker::Options::OptionsHash.new
|
170
|
+
end
|
171
|
+
|
172
|
+
# Update the @attribution hash with the source of each key in the options_hash
|
173
|
+
#
|
174
|
+
# @param [Hash] options_hash Options hash
|
175
|
+
# @param [String] source Where the options were specified
|
176
|
+
# @return [Hash] hash Hash of sources for each key
|
177
|
+
def tag_sources(options_hash, source)
|
178
|
+
hash = Beaker::Options::OptionsHash.new
|
179
|
+
options_hash.each do |key, value|
|
180
|
+
if value.is_a?(Hash)
|
181
|
+
hash[key] = tag_sources(value, source)
|
182
|
+
else
|
183
|
+
hash[key] = source
|
184
|
+
end
|
185
|
+
end
|
186
|
+
hash
|
187
|
+
end
|
188
|
+
|
189
|
+
# Update the @option hash with a value and the @attribution hash with a source
|
190
|
+
#
|
191
|
+
# @param [String] key The key to update in both hashes
|
192
|
+
# @param [Object] value The value to set in the @options hash
|
193
|
+
# @param [String] source The source to set in the @attribution hash
|
194
|
+
def update_option(key, value, source)
|
195
|
+
@options[key] = value
|
196
|
+
@attribution[key] = source
|
168
197
|
end
|
169
198
|
|
170
199
|
# Parses ARGV or provided arguments array, file options, hosts options and combines with environment variables and
|
@@ -181,9 +210,12 @@ module Beaker
|
|
181
210
|
# @raise [ArgumentError] Raises error on bad input
|
182
211
|
def parse_args(args = ARGV)
|
183
212
|
@options = @presets.presets
|
213
|
+
@attribution = @attribution.merge(tag_sources(@presets.presets, "preset"))
|
184
214
|
cmd_line_options = @command_line_parser.parse(args)
|
185
215
|
cmd_line_options[:command_line] = ([$0] + args).join(' ')
|
216
|
+
@attribution = @attribution.merge(tag_sources(cmd_line_options, "flag"))
|
186
217
|
file_options = Beaker::Options::OptionsFileParser.parse_options_file(cmd_line_options[:options_file])
|
218
|
+
@attribution = @attribution.merge(tag_sources(file_options, "options_file"))
|
187
219
|
|
188
220
|
# merge together command line and file_options
|
189
221
|
# overwrite file options with command line options
|
@@ -199,16 +231,19 @@ module Beaker
|
|
199
231
|
# merge in host file vars
|
200
232
|
# overwrite options (default, file options, command line) with host file options
|
201
233
|
@options = @options.merge(hosts_options)
|
234
|
+
@attribution = @attribution.merge(tag_sources(hosts_options, "host_file"))
|
202
235
|
|
203
236
|
# re-merge the command line options
|
204
237
|
# overwrite options (default, file options, hosts file ) with command line arguments
|
205
238
|
@options = @options.merge(cmd_line_options)
|
239
|
+
@attribution = @attribution.merge(tag_sources(cmd_line_options, "cmd"))
|
206
240
|
|
207
241
|
# merge in env vars
|
208
242
|
# overwrite options (default, file options, command line, hosts file) with env
|
209
243
|
env_vars = @presets.env_vars
|
210
244
|
|
211
245
|
@options = @options.merge(env_vars)
|
246
|
+
@attribution = @attribution.merge(tag_sources(env_vars, "env"))
|
212
247
|
|
213
248
|
normalize_args
|
214
249
|
end
|
@@ -280,15 +315,15 @@ module Beaker
|
|
280
315
|
#will end up being normalized into an array
|
281
316
|
LONG_OPTS.each do |opt|
|
282
317
|
if @options.has_key?(opt)
|
283
|
-
|
318
|
+
update_option(opt, split_arg(@options[opt]), 'runtime')
|
284
319
|
if RB_FILE_OPTS.include?(opt) && (not @options[opt] == [])
|
285
|
-
|
320
|
+
update_option(opt, file_list(@options[opt]), 'runtime')
|
286
321
|
end
|
287
322
|
if opt == :install
|
288
|
-
|
323
|
+
update_option(:install, parse_git_repos(@options[:install]), 'runtime')
|
289
324
|
end
|
290
325
|
else
|
291
|
-
|
326
|
+
update_option(opt, [], 'runtime')
|
292
327
|
end
|
293
328
|
end
|
294
329
|
|
data/lib/beaker/version.rb
CHANGED
data/spec/beaker/cli_spec.rb
CHANGED
@@ -35,6 +35,9 @@ module Beaker
|
|
35
35
|
|
36
36
|
expect( cli ).to receive(:run_suite).exactly( 2 ).times
|
37
37
|
expect{ cli.execute! }.to raise_error
|
38
|
+
expect(cli.instance_variable_get(:@attribution)[:logger]).to be == 'runtime'
|
39
|
+
expect(cli.instance_variable_get(:@attribution)[:timestamp]).to be == 'runtime'
|
40
|
+
expect(cli.instance_variable_get(:@attribution)[:beaker_version]).to be == 'runtime'
|
38
41
|
|
39
42
|
end
|
40
43
|
|
@@ -51,5 +51,14 @@ module Beaker
|
|
51
51
|
expect(instance.selinux_enabled?).to be === false
|
52
52
|
end
|
53
53
|
end
|
54
|
+
|
55
|
+
describe '#reboot' do
|
56
|
+
it 'invokes the correct command on the host' do
|
57
|
+
expect( Beaker::Command ).to receive( :new ).with( /^shutdown \/f \/r \/t 0 \/d p:4:1 \/c "Beaker::Host reboot command issued"/ ).and_return( :foo )
|
58
|
+
expect( instance ).to receive( :exec ).with( :foo, :reset_connection => true )
|
59
|
+
expect( instance ).to receive( :sleep )
|
60
|
+
instance.reboot
|
61
|
+
end
|
62
|
+
end
|
54
63
|
end
|
55
64
|
end
|
data/spec/beaker/host_spec.rb
CHANGED
@@ -315,6 +315,11 @@ module Beaker
|
|
315
315
|
expect { host.exec(command, opts) }.to_not raise_error
|
316
316
|
end
|
317
317
|
|
318
|
+
it 'explicitly closes the connection when :reset_connection is set' do
|
319
|
+
expect( host ).to receive( :close )
|
320
|
+
expect { host.exec(command, :reset_connection => true) }.to_not raise_error
|
321
|
+
end
|
322
|
+
|
318
323
|
context "controls the result objects logging" do
|
319
324
|
it "and passes a test if the exit_code doesn't match the default :acceptable_exit_codes of 0" do
|
320
325
|
result.exit_code = 0
|
@@ -375,9 +375,8 @@ EOF
|
|
375
375
|
|
376
376
|
end
|
377
377
|
|
378
|
-
it "
|
379
|
-
expect
|
380
|
-
|
378
|
+
it "returns nil if it is unable to find an ip" do
|
379
|
+
expect( vagrant.get_ip_from_vagrant_file("unknown") ).to be_nil
|
381
380
|
end
|
382
381
|
|
383
382
|
it "raises an error if no Vagrantfile is present" do
|
@@ -127,16 +127,35 @@ module Beaker
|
|
127
127
|
before { FakeFS.deactivate! }
|
128
128
|
|
129
129
|
it 'pulls the args into key called :command_line' do
|
130
|
-
my_args = ['--log-level', 'debug', '-h', hosts_path]
|
130
|
+
my_args = ['--log-level', 'debug', '-h', hosts_path]
|
131
|
+
|
131
132
|
expect(parser.parse_args(my_args)[:command_line]).to include(my_args.join(' '))
|
133
|
+
expect(parser.attribution[:command_line]).to be == 'cmd'
|
134
|
+
expect(parser.attribution[:hosts_file]).to be == 'cmd'
|
135
|
+
expect(parser.attribution[:log_level]).to be == 'cmd'
|
136
|
+
expect(parser.attribution[:pe_dir]).to be == 'preset'
|
132
137
|
end
|
133
138
|
|
134
139
|
describe 'does prioritization correctly' do
|
135
140
|
let(:env) { @env || {:level => 'highest'} }
|
136
141
|
let(:argv) { @argv || {:level => 'second'} }
|
137
142
|
let(:host_file) { @host_file || {:level => 'third'} }
|
138
|
-
let(:opt_file) { @opt_file || {:level => 'fourth'
|
139
|
-
|
143
|
+
let(:opt_file) { @opt_file || {:level => 'fourth',
|
144
|
+
:ssh => {
|
145
|
+
:auth_methods => 'auth123',
|
146
|
+
:user_known_hosts_file => 'hosts123'
|
147
|
+
}
|
148
|
+
} }
|
149
|
+
let(:presets) { {:level => 'lowest',
|
150
|
+
:ssh => {
|
151
|
+
:config => 'config123',
|
152
|
+
:paranoid => 'paranoid123',
|
153
|
+
:port => 'port123',
|
154
|
+
:forward_agent => 'forwardagent123',
|
155
|
+
:keys => 'keys123',
|
156
|
+
:keepalive => 'keepalive123'
|
157
|
+
}
|
158
|
+
} }
|
140
159
|
|
141
160
|
before :each do
|
142
161
|
expect(parser).to receive(:normalize_args).and_return(true)
|
@@ -161,7 +180,9 @@ module Beaker
|
|
161
180
|
mock_out_parsing
|
162
181
|
|
163
182
|
opts = parser.parse_args([])
|
183
|
+
attribution = parser.attribution
|
164
184
|
expect(opts[:level]).to be == 'lowest'
|
185
|
+
expect(attribution[:level]).to be == 'preset'
|
165
186
|
end
|
166
187
|
|
167
188
|
it 'options file has fourth priority' do
|
@@ -169,7 +190,18 @@ module Beaker
|
|
169
190
|
mock_out_parsing
|
170
191
|
|
171
192
|
opts = parser.parse_args([])
|
193
|
+
attribution = parser.attribution
|
194
|
+
expect(attribution[:ssh]).to be_a(Hash)
|
195
|
+
expect(attribution[:ssh][:auth_methods]).to be == 'options_file'
|
196
|
+
expect(attribution[:ssh][:user_known_hosts_file]).to be == 'options_file'
|
197
|
+
expect(attribution[:ssh][:config]).to be == 'preset'
|
198
|
+
expect(attribution[:ssh][:paranoid]).to be == 'preset'
|
199
|
+
expect(attribution[:ssh][:port]).to be == 'preset'
|
200
|
+
expect(attribution[:ssh][:forward_agent]).to be == 'preset'
|
201
|
+
expect(attribution[:ssh][:keys]).to be == 'preset'
|
202
|
+
expect(attribution[:ssh][:keepalive]).to be == 'preset'
|
172
203
|
expect(opts[:level]).to be == 'fourth'
|
204
|
+
expect(attribution[:level]).to be == 'options_file'
|
173
205
|
end
|
174
206
|
|
175
207
|
it 'host file CONFIG section has third priority' do
|
@@ -177,7 +209,9 @@ module Beaker
|
|
177
209
|
mock_out_parsing
|
178
210
|
|
179
211
|
opts = parser.parse_args([])
|
212
|
+
attribution = parser.attribution
|
180
213
|
expect(opts[:level]).to be == 'third'
|
214
|
+
expect(attribution[:level]).to be == 'host_file'
|
181
215
|
end
|
182
216
|
|
183
217
|
it 'command line arguments have second priority' do
|
@@ -185,14 +219,18 @@ module Beaker
|
|
185
219
|
mock_out_parsing
|
186
220
|
|
187
221
|
opts = parser.parse_args([])
|
222
|
+
attribution = parser.attribution
|
188
223
|
expect(opts[:level]).to be == 'second'
|
224
|
+
expect(attribution[:level]).to be == 'cmd'
|
189
225
|
end
|
190
226
|
|
191
227
|
it 'env vars have highest priority' do
|
192
228
|
mock_out_parsing
|
193
229
|
|
194
230
|
opts = parser.parse_args([])
|
231
|
+
attribution = parser.attribution
|
195
232
|
expect(opts[:level]).to be == 'highest'
|
233
|
+
expect(attribution[:level]).to be == 'env'
|
196
234
|
end
|
197
235
|
|
198
236
|
end
|
@@ -207,9 +245,13 @@ module Beaker
|
|
207
245
|
|
208
246
|
args = ["-h", hosts_path, "--log-level", log_level, "--type", type, "--install", "PUPPET/1.0,HIERA/hello"]
|
209
247
|
output = parser.parse_args(args)
|
210
|
-
|
248
|
+
attribution = parser.attribution
|
249
|
+
expect(output[:hosts_file]).to be == hosts_path
|
250
|
+
expect(attribution[:hosts_file]).to be == 'cmd'
|
211
251
|
expect(output[:jenkins_build_url]).to be == build_url
|
252
|
+
expect(attribution[:jenkins_build_url]).to be == 'env'
|
212
253
|
expect(output[:install]).to include('git://github.com/puppetlabs/hiera.git#hello')
|
254
|
+
expect(attribution[:install]).to be == 'runtime'
|
213
255
|
|
214
256
|
ENV["BUILD_URL"] = old_build_url
|
215
257
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beaker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppetlabs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -500,10 +500,12 @@ files:
|
|
500
500
|
- acceptance/tests/base/dsl/platform_tag_confiner_test.rb
|
501
501
|
- acceptance/tests/base/dsl/structure_test.rb
|
502
502
|
- acceptance/tests/base/external_resources_test.rb
|
503
|
+
- acceptance/tests/base/host/group_test.rb
|
503
504
|
- acceptance/tests/base/host/host_test.rb
|
504
505
|
- acceptance/tests/base/host/packages.rb
|
505
506
|
- acceptance/tests/base/host/packages_unix.rb
|
506
507
|
- acceptance/tests/base/host/reboot_test.rb
|
508
|
+
- acceptance/tests/base/host/user_test.rb
|
507
509
|
- acceptance/tests/base/host_prebuilt_steps/ssh_environment_test.rb
|
508
510
|
- acceptance/tests/base/test_suite/export.rb
|
509
511
|
- acceptance/tests/hypervisor/communication_test.rb
|