beaker 2.52.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +8 -8
  2. data/HISTORY.md +27034 -2
  3. data/acceptance/tests/base/external_resources_test.rb +7 -25
  4. data/acceptance/tests/base/host/host_test.rb +106 -0
  5. data/beaker.gemspec +13 -12
  6. data/docs/concepts/shared_options_for_executing_beaker_commands.md +1 -1
  7. data/docs/how_to/hypervisors/openstack.md +9 -0
  8. data/docs/how_to/test_arbitrary_beaker_versions.md +46 -0
  9. data/docs/how_to/upgrade_from_2_to_3.md +76 -0
  10. data/docs/tutorials/README.md +82 -0
  11. data/lib/beaker/dsl.rb +0 -2
  12. data/lib/beaker/dsl/helpers/puppet_helpers.rb +2 -1
  13. data/lib/beaker/dsl/install_utils/windows_utils.rb +27 -1
  14. data/lib/beaker/host.rb +16 -1
  15. data/lib/beaker/host/unix/exec.rb +4 -4
  16. data/lib/beaker/host/unix/pkg.rb +3 -2
  17. data/lib/beaker/host_prebuilt_steps.rb +2 -46
  18. data/lib/beaker/hypervisor.rb +1 -1
  19. data/lib/beaker/hypervisor/openstack.rb +19 -34
  20. data/lib/beaker/options/presets.rb +1 -5
  21. data/lib/beaker/version.rb +1 -1
  22. data/spec/beaker/dsl/helpers/puppet_helpers_spec.rb +18 -4
  23. data/spec/beaker/dsl/helpers/web_helpers_spec.rb +26 -4
  24. data/spec/beaker/dsl/install_utils/windows_utils_spec.rb +47 -1
  25. data/spec/beaker/host/unix/pkg_spec.rb +1 -0
  26. data/spec/beaker/host_prebuilt_steps_spec.rb +2 -33
  27. data/spec/beaker/host_spec.rb +14 -2
  28. data/spec/beaker/hypervisor/hypervisor_spec.rb +0 -15
  29. data/spec/beaker/hypervisor/openstack_spec.rb +5 -0
  30. data/spec/helpers.rb +1 -0
  31. metadata +15 -105
  32. data/lib/beaker/hypervisor/aixer.rb +0 -48
  33. data/lib/beaker/hypervisor/solaris.rb +0 -59
  34. data/spec/beaker/hypervisor/aixer_spec.rb +0 -34
  35. data/spec/beaker/hypervisor/solaris_spec.rb +0 -40
@@ -1,59 +0,0 @@
1
- module Beaker
2
- class Solaris < Beaker::Hypervisor
3
-
4
- def initialize(solaris_hosts, options)
5
- @options = options
6
- @logger = options[:logger]
7
- @hosts = solaris_hosts
8
- @fog_file = nil
9
- if File.exists?( @options[:dot_fog] )
10
- @fog_file = YAML.load_file( @options[:dot_fog] )
11
- end
12
- raise "Cant load #{@options[:dot_fog]} config" unless @fog_file
13
-
14
- end
15
-
16
- def provision
17
- hypername = @fog_file[:default][:solaris_hypervisor_server]
18
- vmpath = @fog_file[:default][:solaris_hypervisor_vmpath]
19
- snappaths = @fog_file[:default][:solaris_hypervisor_snappaths]
20
-
21
- hyperopts = @options.dup
22
- hyperopts['HOSTS'] = {
23
- hypername => { 'platform' => 'solaris-11-sparc' }
24
- }
25
-
26
- @logger.notify "Connecting to hypervisor at #{hypername}"
27
- hypervisor = Beaker::Host.create( hypername, hyperopts, @options )
28
- hypervisor[:user] = @fog_file[:default][:solaris_hypervisor_username] || hypervisor[:user]
29
- hypervisor[:ssh][:keys] = [@fog_file[:default][:solaris_hypervisor_keyfile]] || hypervisor[:ssh][:keys]
30
-
31
- @hosts.each do |host|
32
- vm_name = host['vmname'] || host.name
33
- #use the snapshot provided for this host
34
- snapshot = host['snapshot']
35
-
36
- @logger.notify "Reverting #{vm_name} to snapshot #{snapshot}"
37
- start = Time.now
38
- hypervisor.exec(Command.new("sudo /sbin/zfs rollback -Rf #{vmpath}/#{vm_name}@#{snapshot}"))
39
- snappaths.each do |spath|
40
- @logger.notify "Reverting #{vm_name}/#{spath} to snapshot #{snapshot}"
41
- hypervisor.exec(Command.new("sudo /sbin/zfs rollback -Rf #{vmpath}/#{vm_name}/#{spath}@#{snapshot}"))
42
- end
43
- time = Time.now - start
44
- @logger.notify "Spent %.2f seconds reverting" % time
45
-
46
- @logger.notify "Booting #{vm_name}"
47
- start = Time.now
48
- hypervisor.exec(Command.new("sudo /sbin/zoneadm -z #{vm_name} boot"))
49
- @logger.notify "Spent %.2f seconds booting #{vm_name}" % (Time.now - start)
50
- end
51
- hypervisor.close
52
- end
53
-
54
- def cleanup
55
- @logger.notify "No cleanup for solaris boxes"
56
- end
57
-
58
- end
59
- end
@@ -1,34 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module Beaker
4
- describe Aixer do
5
- let( :aixer) { Beaker::Aixer.new( @hosts, make_opts ) }
6
-
7
- before :each do
8
- @hosts = make_hosts()
9
- allow( File ).to receive( :exists? ).and_return( true )
10
- allow( YAML ).to receive( :load_file ).and_return( fog_file_contents )
11
- allow_any_instance_of( Host ).to receive( :exec ).and_return( true )
12
- end
13
-
14
- it "can provision a set of hosts" do
15
- @hosts.each do |host|
16
- expect( Command ).to receive( :new ).with( "cd pe-aix && rake restore:#{host.name}" ).once
17
-
18
- end
19
- allow_any_instance_of(Host).to receive(:close)
20
- aixer.provision
21
-
22
- end
23
-
24
- it "does nothing for cleanup" do
25
- expect( Command ).to receive( :new ).never
26
- expect( Host ).to receive( :exec ).never
27
-
28
- aixer.cleanup
29
-
30
- end
31
-
32
-
33
- end
34
- end
@@ -1,40 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module Beaker
4
- describe Solaris do
5
- let( :solaris) { Beaker::Solaris.new( @hosts, make_opts ) }
6
-
7
- before :each do
8
- @hosts = make_hosts()
9
- allow( File ).to receive( :exists? ).and_return( true )
10
- allow( YAML ).to receive( :load_file ).and_return( fog_file_contents )
11
- allow_any_instance_of( Host ).to receive( :exec ).and_return( true )
12
- end
13
-
14
- it "can provision a set of hosts" do
15
- vmpath = "rpoooool/zs"
16
- spath = "rpoooool/USER/z0"
17
-
18
- @hosts.each do |host|
19
- vm_name = host['vmname'] || host.name
20
- snapshot = host['snapshot']
21
- expect( Command ).to receive( :new ).with("sudo /sbin/zfs rollback -Rf #{vmpath}/#{vm_name}@#{snapshot}").once
22
- expect( Command ).to receive( :new ).with("sudo /sbin/zfs rollback -Rf #{vmpath}/#{vm_name}/#{spath}@#{snapshot}").once
23
- expect( Command ).to receive( :new ).with("sudo /sbin/zoneadm -z #{vm_name} boot").once
24
- end
25
- allow_any_instance_of(Host).to receive(:close)
26
-
27
- solaris.provision
28
- end
29
-
30
- it "does nothing for cleanup" do
31
- expect( Command ).to receive( :new ).never
32
- expect( Host ).to receive( :exec ).never
33
-
34
- solaris.cleanup
35
- end
36
-
37
-
38
- end
39
-
40
- end