Sha256: 39dddc2a63c538e9c9c9573b108e0b175b16815201ee4f6fa77788792b5953aa

Contents?: true

Size: 1.2 KB

Versions: 40

Compression:

Stored size: 1.2 KB

Contents

require 'spec_helper'

module Beaker
  describe Solaris do
    let( :solaris) { Beaker::Solaris.new( @hosts, make_opts ) }

    before :each do
      @hosts = make_hosts()
      allow( File ).to receive( :exists? ).and_return( true )
      allow( YAML ).to receive( :load_file ).and_return( fog_file_contents )
      allow_any_instance_of( Host ).to receive( :exec ).and_return( true )
    end

    it "can provision a set of hosts" do
      vmpath = "rpoooool/zs"
      spath = "rpoooool/USER/z0"

      @hosts.each do |host|
        vm_name = host['vmname'] || host.name
        snapshot = host['snapshot']
        expect( Command ).to receive( :new ).with("sudo /sbin/zfs rollback -Rf #{vmpath}/#{vm_name}@#{snapshot}").once
        expect( Command ).to receive( :new ).with("sudo /sbin/zfs rollback -Rf #{vmpath}/#{vm_name}/#{spath}@#{snapshot}").once
        expect( Command ).to receive( :new ).with("sudo /sbin/zoneadm -z #{vm_name} boot").once
      end
      allow_any_instance_of(Host).to receive(:close)

      solaris.provision
    end

    it "does nothing for cleanup" do
      expect( Command ).to receive( :new ).never
      expect( Host ).to receive( :exec ).never

      solaris.cleanup
    end


  end

end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
beaker-2.52.0 spec/beaker/hypervisor/solaris_spec.rb
beaker-2.51.0 spec/beaker/hypervisor/solaris_spec.rb
beaker-2.50.0 spec/beaker/hypervisor/solaris_spec.rb
beaker-2.49.0 spec/beaker/hypervisor/solaris_spec.rb
beaker-2.48.1 spec/beaker/hypervisor/solaris_spec.rb
beaker-2.48.0 spec/beaker/hypervisor/solaris_spec.rb
beaker-2.47.1 spec/beaker/hypervisor/solaris_spec.rb
beaker-2.47.0 spec/beaker/hypervisor/solaris_spec.rb
beaker-2.46.0 spec/beaker/hypervisor/solaris_spec.rb
beaker-2.45.0 spec/beaker/hypervisor/solaris_spec.rb
beaker-2.44.0 spec/beaker/hypervisor/solaris_spec.rb
beaker-2.43.0 spec/beaker/hypervisor/solaris_spec.rb
beaker-2.42.0 spec/beaker/hypervisor/solaris_spec.rb
beaker-2.41.0 spec/beaker/hypervisor/solaris_spec.rb
beaker-2.40.0 spec/beaker/hypervisor/solaris_spec.rb
beaker-2.39.0 spec/beaker/hypervisor/solaris_spec.rb
beaker-2.38.1 spec/beaker/hypervisor/solaris_spec.rb
beaker-2.38.0 spec/beaker/hypervisor/solaris_spec.rb
beaker-2.37.0 spec/beaker/hypervisor/solaris_spec.rb
beaker-2.36.0 spec/beaker/hypervisor/solaris_spec.rb