beaker 2.10.0 → 2.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +8 -8
  2. data/HISTORY.md +292 -4
  3. data/acceptance/tests/base/host.rb +1 -0
  4. data/lib/beaker/answers/version30.rb +10 -10
  5. data/lib/beaker/cli.rb +10 -8
  6. data/lib/beaker/command.rb +1 -1
  7. data/lib/beaker/dsl/helpers/facter_helpers.rb +10 -1
  8. data/lib/beaker/dsl/helpers/hiera_helpers.rb +0 -11
  9. data/lib/beaker/dsl/helpers/host_helpers.rb +12 -3
  10. data/lib/beaker/dsl/helpers/puppet_helpers.rb +11 -3
  11. data/lib/beaker/dsl/helpers/tk_helpers.rb +0 -12
  12. data/lib/beaker/dsl/helpers/web_helpers.rb +0 -12
  13. data/lib/beaker/dsl/install_utils/module_utils.rb +9 -6
  14. data/lib/beaker/dsl/install_utils/pe_utils.rb +60 -8
  15. data/lib/beaker/dsl/install_utils/puppet_utils.rb +15 -2
  16. data/lib/beaker/host.rb +11 -145
  17. data/lib/beaker/host/mac.rb +3 -7
  18. data/lib/beaker/host/mac/pkg.rb +43 -0
  19. data/lib/beaker/host/pswindows.rb +1 -1
  20. data/lib/beaker/host/pswindows/exec.rb +83 -2
  21. data/lib/beaker/host/pswindows/pkg.rb +9 -6
  22. data/lib/beaker/host/unix/exec.rb +105 -0
  23. data/lib/beaker/host/unix/pkg.rb +22 -9
  24. data/lib/beaker/host/windows.rb +2 -1
  25. data/lib/beaker/host/windows/exec.rb +1 -1
  26. data/lib/beaker/host/windows/pkg.rb +4 -7
  27. data/lib/beaker/host_prebuilt_steps.rb +14 -14
  28. data/lib/beaker/hypervisor/aws_sdk.rb +198 -114
  29. data/lib/beaker/hypervisor/openstack.rb +48 -25
  30. data/lib/beaker/shared/host_manager.rb +11 -2
  31. data/lib/beaker/ssh_connection.rb +26 -0
  32. data/lib/beaker/version.rb +1 -1
  33. data/spec/beaker/answers_spec.rb +56 -0
  34. data/spec/beaker/cli_spec.rb +16 -12
  35. data/spec/beaker/command_spec.rb +3 -0
  36. data/spec/beaker/dsl/install_utils/module_utils_spec.rb +2 -2
  37. data/spec/beaker/dsl/install_utils/pe_utils_spec.rb +71 -3
  38. data/spec/beaker/dsl/install_utils/puppet_utils_spec.rb +4 -1
  39. data/spec/beaker/host/unix/pkg_spec.rb +10 -10
  40. data/spec/beaker/host_prebuilt_steps_spec.rb +3 -1
  41. data/spec/beaker/host_spec.rb +8 -2
  42. data/spec/beaker/hypervisor/vagrant_spec.rb +1 -0
  43. metadata +3 -2
@@ -376,6 +376,7 @@ describe Beaker do
376
376
 
377
377
  hosts.each do |host|
378
378
  windows_pkgs.each do |pkg|
379
+ allow( host ).to receive( :is_cygwin? ).and_return( true )
379
380
  expect( host ).to receive( :check_for_package ).with( pkg ).once.and_return( false )
380
381
  expect( host ).to receive( :install_package ).with( pkg ).once
381
382
  end
@@ -542,7 +543,8 @@ describe Beaker do
542
543
  def set_env_helper(platform_name, host_specific_commands_array)
543
544
  host = make_host('name', {
544
545
  :platform => platform_name,
545
- :ssh_env_file => 'ssh_env_file'
546
+ :ssh_env_file => 'ssh_env_file',
547
+ :is_cygwin => true,
546
548
  } )
547
549
  opts = {
548
550
  :env1_key => :env1_value,
@@ -330,6 +330,7 @@ module Beaker
330
330
 
331
331
  it "does the right thing on a bash host, identified as is_cygwin=true" do
332
332
  @options = {:is_cygwin => true}
333
+ @platform = 'windows'
333
334
  result = double
334
335
  allow( result ).to receive( :exit_code ).and_return( 0 )
335
336
  allow( host ).to receive( :exec ).and_return( result )
@@ -341,6 +342,7 @@ module Beaker
341
342
 
342
343
  it "does the right thing on a bash host, identified as is_cygwin=nil" do
343
344
  @options = {:is_cygwin => nil}
345
+ @platform = 'windows'
344
346
  result = double
345
347
  allow( result ).to receive( :exit_code ).and_return( 0 )
346
348
  allow( host ).to receive( :exec ).and_return( result )
@@ -352,6 +354,7 @@ module Beaker
352
354
 
353
355
  it "does the right thing on a non-bash host, identified as is_cygwin=false (powershell)" do
354
356
  @options = {:is_cygwin => false}
357
+ @platform = 'windows'
355
358
  result = double
356
359
  allow( result ).to receive( :exit_code ).and_return( 0 )
357
360
  allow( host ).to receive( :exec ).and_return( result )
@@ -609,12 +612,15 @@ module Beaker
609
612
  end
610
613
 
611
614
  it 'can be called on an unsupported host type without an error being thrown' do
612
- @platform = 'mac-osx-foo-tigerlion'
615
+ @options = { :is_cygwin => false }
616
+ @platform = 'windows-stuff-stuff'
613
617
  expect{ host.build_deprecated_keys() }.not_to raise_error
618
+ expect( host.build_deprecated_keys().empty? ).to be_truthy
614
619
  end
615
620
 
616
621
  it 'returns an empty array for unsupported host types' do
617
- @platform = 'mac-osx-foo-tigerlion'
622
+ @options = { :is_cygwin => false }
623
+ @platform = 'windows-stuff-stuff'
618
624
  expect( host.build_deprecated_keys().empty? ).to be_truthy
619
625
  end
620
626
 
@@ -151,6 +151,7 @@ EOF
151
151
  it "can copy to Administrator on windows" do
152
152
  host = @hosts[0]
153
153
  host[:platform] = 'windows'
154
+ expect( host ).to receive( :is_cygwin? ).and_return(true)
154
155
 
155
156
  expect( Command ).to receive( :new ).with("cp -r .ssh /cygdrive/c/Users/Administrator/.").once
156
157
  expect( Command ).to receive( :new ).with("chown -R Administrator /cygdrive/c/Users/Administrator/.ssh").once
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: 2.10.0
4
+ version: 2.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppetlabs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-22 00:00:00.000000000 Z
11
+ date: 2015-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -424,6 +424,7 @@ files:
424
424
  - lib/beaker/host/freebsd/exec.rb
425
425
  - lib/beaker/host/mac.rb
426
426
  - lib/beaker/host/mac/group.rb
427
+ - lib/beaker/host/mac/pkg.rb
427
428
  - lib/beaker/host/mac/user.rb
428
429
  - lib/beaker/host/pswindows.rb
429
430
  - lib/beaker/host/pswindows/exec.rb