beaker 2.18.0 → 2.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/HISTORY.md +699 -2
- data/acceptance/lib/beaker/acceptance/install_utils.rb +58 -0
- data/acceptance/pre_suite/puppet_gem/install.rb +1 -8
- data/acceptance/pre_suite/puppet_git/install.rb +6 -65
- data/acceptance/pre_suite/puppet_pkg/install.rb +1 -1
- data/acceptance/tests/foss_utils/clone_git_repo_on.rb +49 -0
- data/beaker.gemspec +2 -0
- data/lib/beaker/command.rb +1 -1
- data/lib/beaker/dsl/helpers/puppet_helpers.rb +8 -6
- data/lib/beaker/dsl/helpers/web_helpers.rb +2 -1
- data/lib/beaker/dsl/install_utils/aio_defaults.rb +0 -3
- data/lib/beaker/dsl/install_utils/foss_defaults.rb +19 -0
- data/lib/beaker/dsl/install_utils/foss_utils.rb +164 -67
- data/lib/beaker/dsl/install_utils/pe_defaults.rb +9 -11
- data/lib/beaker/dsl/install_utils/pe_utils.rb +48 -64
- data/lib/beaker/dsl/install_utils/puppet_utils.rb +43 -0
- data/lib/beaker/dsl/install_utils/windows_utils.rb +144 -0
- data/lib/beaker/dsl/roles.rb +20 -3
- data/lib/beaker/dsl/structure.rb +14 -3
- data/lib/beaker/host/freebsd/pkg.rb +18 -0
- data/lib/beaker/host/freebsd.rb +2 -0
- data/lib/beaker/host/unix/exec.rb +3 -3
- data/lib/beaker/host/unix/pkg.rb +37 -0
- data/lib/beaker/host/windows/exec.rb +3 -0
- data/lib/beaker/host.rb +38 -9
- data/lib/beaker/host_prebuilt_steps.rb +21 -11
- data/lib/beaker/hypervisor/aws_sdk.rb +22 -18
- data/lib/beaker/hypervisor/docker.rb +7 -0
- data/lib/beaker/hypervisor/openstack.rb +1 -0
- data/lib/beaker/hypervisor/vagrant_virtualbox.rb +10 -5
- data/lib/beaker/hypervisor/vmpooler.rb +4 -0
- data/lib/beaker/logger.rb +12 -1
- data/lib/beaker/options/command_line_parser.rb +9 -0
- data/lib/beaker/options/options_hash.rb +3 -296
- data/lib/beaker/options/parser.rb +12 -0
- data/lib/beaker/options/presets.rb +0 -1
- data/lib/beaker/platform.rb +3 -1
- data/lib/beaker/ssh_connection.rb +48 -23
- data/lib/beaker/test_case.rb +1 -1
- data/lib/beaker/version.rb +1 -1
- data/spec/beaker/dsl/helpers/puppet_helpers_spec.rb +0 -1
- data/spec/beaker/dsl/helpers/web_helpers_spec.rb +10 -1
- data/spec/beaker/dsl/install_utils/foss_utils_spec.rb +247 -49
- data/spec/beaker/dsl/install_utils/pe_utils_spec.rb +116 -26
- data/spec/beaker/dsl/install_utils/puppet_utils_spec.rb +57 -0
- data/spec/beaker/dsl/install_utils/windows_utils_spec.rb +132 -0
- data/spec/beaker/dsl/roles_spec.rb +36 -5
- data/spec/beaker/dsl/structure_spec.rb +9 -2
- data/spec/beaker/host/unix/pkg_spec.rb +26 -6
- data/spec/beaker/host_prebuilt_steps_spec.rb +3 -2
- data/spec/beaker/host_spec.rb +24 -6
- data/spec/beaker/hypervisor/aixer_spec.rb +1 -1
- data/spec/beaker/hypervisor/aws_sdk_spec.rb +595 -58
- data/spec/beaker/hypervisor/docker_spec.rb +2 -1
- data/spec/beaker/hypervisor/solaris_spec.rb +1 -0
- data/spec/beaker/hypervisor/vagrant_spec.rb +20 -5
- data/spec/beaker/hypervisor/vagrant_virtualbox_spec.rb +1 -1
- data/spec/beaker/logger_spec.rb +39 -0
- data/spec/beaker/options/command_line_parser_spec.rb +2 -2
- data/spec/beaker/options/options_hash_spec.rb +1 -102
- data/spec/beaker/options/parser_spec.rb +19 -0
- data/spec/beaker/options/pe_version_scaper_spec.rb +11 -1
- data/spec/beaker/options/presets_spec.rb +8 -0
- data/spec/beaker/ssh_connection_spec.rb +39 -21
- data/spec/helpers.rb +9 -3
- data/spec/mocks.rb +2 -0
- metadata +35 -11
- data/lib/beaker/answers/version20.rb +0 -120
- data/lib/beaker/answers/version28.rb +0 -121
- data/lib/beaker/answers/version30.rb +0 -227
- data/lib/beaker/answers/version32.rb +0 -44
- data/lib/beaker/answers/version34.rb +0 -51
- data/lib/beaker/answers/version38.rb +0 -29
- data/lib/beaker/answers/version40.rb +0 -44
- data/lib/beaker/answers.rb +0 -143
- data/spec/beaker/answers_spec.rb +0 -547
data/spec/beaker/host_spec.rb
CHANGED
|
@@ -186,7 +186,7 @@ module Beaker
|
|
|
186
186
|
it "does nothing if the key/value pair already exists" do
|
|
187
187
|
result = Beaker::Result.new(host, '')
|
|
188
188
|
result.exit_code = 0
|
|
189
|
-
expect( Beaker::Command ).to receive(:new).with("grep KEY=.*\\/my\\/first\\/value ~/.ssh/environment")
|
|
189
|
+
expect( Beaker::Command ).to receive(:new).with("grep ^KEY=.*\\/my\\/first\\/value ~/.ssh/environment")
|
|
190
190
|
expect( host ).to receive(:exec).once.and_return(result)
|
|
191
191
|
|
|
192
192
|
host.add_env_var('key', '/my/first/value')
|
|
@@ -195,9 +195,9 @@ module Beaker
|
|
|
195
195
|
it "adds new line to environment file if no env var of that name already exists" do
|
|
196
196
|
result = Beaker::Result.new(host, '')
|
|
197
197
|
result.exit_code = 1
|
|
198
|
-
expect( Beaker::Command ).to receive(:new).with("grep KEY=.*\\/my\\/first\\/value ~/.ssh/environment")
|
|
198
|
+
expect( Beaker::Command ).to receive(:new).with("grep ^KEY=.*\\/my\\/first\\/value ~/.ssh/environment")
|
|
199
199
|
expect( host ).to receive(:exec).and_return(result)
|
|
200
|
-
expect( Beaker::Command ).to receive(:new).with(/grep KEY ~\/\.ssh\/environment/)
|
|
200
|
+
expect( Beaker::Command ).to receive(:new).with(/grep \^KEY ~\/\.ssh\/environment/)
|
|
201
201
|
expect( host ).to receive(:exec).and_return(result)
|
|
202
202
|
expect( Beaker::Command ).to receive(:new).with("echo \"KEY=/my/first/value\" >> ~/.ssh/environment")
|
|
203
203
|
host.add_env_var('key', '/my/first/value')
|
|
@@ -206,13 +206,13 @@ module Beaker
|
|
|
206
206
|
it "updates existing line in environment file when adding additional value to existing variable" do
|
|
207
207
|
result = Beaker::Result.new(host, '')
|
|
208
208
|
result.exit_code = 1
|
|
209
|
-
expect( Beaker::Command ).to receive(:new).with("grep KEY=.*\\/my\\/first\\/value ~/.ssh/environment")
|
|
209
|
+
expect( Beaker::Command ).to receive(:new).with("grep ^KEY=.*\\/my\\/first\\/value ~/.ssh/environment")
|
|
210
210
|
expect( host ).to receive(:exec).and_return(result)
|
|
211
211
|
result = Beaker::Result.new(host, '')
|
|
212
212
|
result.exit_code = 0
|
|
213
|
-
expect( Beaker::Command ).to receive(:new).with(/grep KEY ~\/\.ssh\/environment/)
|
|
213
|
+
expect( Beaker::Command ).to receive(:new).with(/grep \^KEY ~\/\.ssh\/environment/)
|
|
214
214
|
expect( host ).to receive(:exec).and_return(result)
|
|
215
|
-
expect( Beaker::SedCommand ).to receive(:new).with('unix', 's
|
|
215
|
+
expect( Beaker::SedCommand ).to receive(:new).with('unix', 's/^KEY=/KEY=\\/my\\/first\\/value:/', '~/.ssh/environment')
|
|
216
216
|
host.add_env_var('key', '/my/first/value')
|
|
217
217
|
end
|
|
218
218
|
|
|
@@ -243,6 +243,9 @@ module Beaker
|
|
|
243
243
|
host.instance_variable_set :@logger, logger
|
|
244
244
|
conn = double(:connection)
|
|
245
245
|
allow( conn ).to receive(:execute).and_return(result)
|
|
246
|
+
allow( conn ).to receive(:ip).and_return(host['ip'])
|
|
247
|
+
allow( conn ).to receive(:vmhostname).and_return(host['vmhostname'])
|
|
248
|
+
allow( conn ).to receive(:hostname).and_return(host.name)
|
|
246
249
|
host.instance_variable_set :@connection, conn
|
|
247
250
|
end
|
|
248
251
|
|
|
@@ -399,6 +402,9 @@ module Beaker
|
|
|
399
402
|
|
|
400
403
|
expect( logger ).to receive(:trace)
|
|
401
404
|
expect( conn ).to receive(:scp_to).with( *conn_args ).and_return(Beaker::Result.new(host, 'output!'))
|
|
405
|
+
allow( conn ).to receive(:ip).and_return(host['ip'])
|
|
406
|
+
allow( conn ).to receive(:vmhostname).and_return(host['vmhostname'])
|
|
407
|
+
allow( conn ).to receive(:hostname).and_return(host.name)
|
|
402
408
|
|
|
403
409
|
host.do_scp_to *args
|
|
404
410
|
end
|
|
@@ -466,6 +472,9 @@ module Beaker
|
|
|
466
472
|
expect( conn ).to_not receive(:scp_to).with( *conn_args )
|
|
467
473
|
end
|
|
468
474
|
end
|
|
475
|
+
allow( conn ).to receive(:ip).and_return(host['ip'])
|
|
476
|
+
allow( conn ).to receive(:vmhostname).and_return(host['vmhostname'])
|
|
477
|
+
allow( conn ).to receive(:hostname).and_return(host.name)
|
|
469
478
|
|
|
470
479
|
host.do_scp_to *args
|
|
471
480
|
end
|
|
@@ -527,6 +536,9 @@ module Beaker
|
|
|
527
536
|
expect( conn ).to_not receive(:scp_to).with( *conn_args )
|
|
528
537
|
end
|
|
529
538
|
end
|
|
539
|
+
allow( conn ).to receive(:ip).and_return(host['ip'])
|
|
540
|
+
allow( conn ).to receive(:vmhostname).and_return(host['vmhostname'])
|
|
541
|
+
allow( conn ).to receive(:hostname).and_return(host.name)
|
|
530
542
|
|
|
531
543
|
host.do_scp_to *args
|
|
532
544
|
end
|
|
@@ -555,6 +567,9 @@ module Beaker
|
|
|
555
567
|
expect( conn ).to receive(:scp_to).with( *conn_args ).and_return(Beaker::Result.new(host, 'output!'))
|
|
556
568
|
end
|
|
557
569
|
|
|
570
|
+
allow( conn ).to receive(:ip).and_return(host['ip'])
|
|
571
|
+
allow( conn ).to receive(:vmhostname).and_return(host['vmhostname'])
|
|
572
|
+
allow( conn ).to receive(:hostname).and_return(host.name)
|
|
558
573
|
host.do_scp_to *args
|
|
559
574
|
end
|
|
560
575
|
end
|
|
@@ -572,6 +587,9 @@ module Beaker
|
|
|
572
587
|
expect( logger ).to receive(:debug)
|
|
573
588
|
expect( conn ).to receive(:scp_from).with( *conn_args ).and_return(Beaker::Result.new(host, 'output!'))
|
|
574
589
|
|
|
590
|
+
allow( conn ).to receive(:ip).and_return(host['ip'])
|
|
591
|
+
allow( conn ).to receive(:vmhostname).and_return(host['vmhostname'])
|
|
592
|
+
allow( conn ).to receive(:hostname).and_return(host.name)
|
|
575
593
|
host.do_scp_from *args
|
|
576
594
|
end
|
|
577
595
|
end
|