Sha256: 44836f811d47f48a090c359e781d641366deed26034682abb9d2f75b1a3a4ddc

Contents?: true

Size: 1.66 KB

Versions: 125

Compression:

Stored size: 1.66 KB

Contents

require 'spec_helper'

module Aix
  describe Host do
    let(:options)  { @options ? @options : {} }
    let(:platform) {
      if @platform
        { :platform => Beaker::Platform.new( @platform) }
      else
        { :platform => Beaker::Platform.new( 'aix-vers-arch-extra' ) }
      end
    }
    let(:host)    { make_host( 'name', options.merge(platform) ) }

    describe '#ssh_service_restart' do
      it 'invokes the correct commands on the host' do
        expect( Beaker::Command ).to receive( :new ).with( 'stopsrc -g ssh'  ).once.ordered
        expect( Beaker::Command ).to receive( :new ).with( 'startsrc -g ssh' ).once.ordered
        host.ssh_service_restart
      end
    end

    describe '#ssh_permit_user_environment' do
      it 'calls echo to set PermitUserEnvironment' do
        expect( Beaker::Command ).to receive( :new ).with( /^echo\ / ).once.ordered
        allow( host ).to receive( :ssh_service_restart )
        host.ssh_permit_user_environment
      end

      it 'uses the correct ssh config file' do
        expect( Beaker::Command ).to receive( :new ).with( /#{Regexp.escape(' >> /etc/ssh/sshd_config')}$/ ).once
        allow( host ).to receive( :ssh_service_restart )
        host.ssh_permit_user_environment
      end
    end

    describe '#reboot' do
      it 'invokes the correct command on the host' do
        expect( Beaker::Command ).to receive( :new ).with( 'shutdown -Fr' ).once
        host.reboot
      end
    end

    describe '#get_ip' do
      it 'invokes the correct command on the host' do
        expect( host ).to receive( :execute ).with( /^ifconfig\ \-a\ inet\|\ / ).once.and_return( '' )
        host.get_ip
      end
    end
  end
end

Version data entries

125 entries across 125 versions & 1 rubygems

Version Path
beaker-4.42.0 spec/beaker/host/aix_spec.rb
beaker-4.41.2 spec/beaker/host/aix_spec.rb
beaker-4.41.1 spec/beaker/host/aix_spec.rb
beaker-4.41.0 spec/beaker/host/aix_spec.rb
beaker-4.40.2 spec/beaker/host/aix_spec.rb
beaker-4.40.1 spec/beaker/host/aix_spec.rb
beaker-4.40.0 spec/beaker/host/aix_spec.rb
beaker-4.39.0 spec/beaker/host/aix_spec.rb
beaker-4.38.1 spec/beaker/host/aix_spec.rb
beaker-4.38.0 spec/beaker/host/aix_spec.rb
beaker-4.37.2 spec/beaker/host/aix_spec.rb
beaker-4.37.1 spec/beaker/host/aix_spec.rb
beaker-4.37.0 spec/beaker/host/aix_spec.rb
beaker-4.36.1 spec/beaker/host/aix_spec.rb
beaker-4.36.0 spec/beaker/host/aix_spec.rb
beaker-4.35.0 spec/beaker/host/aix_spec.rb
beaker-4.34.0 spec/beaker/host/aix_spec.rb
beaker-4.33.0 spec/beaker/host/aix_spec.rb
beaker-4.32.0 spec/beaker/host/aix_spec.rb
beaker-4.31.0 spec/beaker/host/aix_spec.rb