Sha256: a783d6dd25f71b7cdd83dfcf8ede3057c017673848d59f16521fd0c158f3288e

Contents?: true

Size: 1.95 KB

Versions: 206

Compression:

Stored size: 1.95 KB

Contents

require 'spec_helper'
require 'specinfra/helper/detect_os/aix'

describe Specinfra::Helper::DetectOs::Aix do
  aix = Specinfra::Helper::DetectOs::Aix.new(:exec)
  it 'Should return aix 10.11 powerpc when (fictional) AIX 10.11 is installed.' do
    allow(aix).to receive(:run_command).with('uname -s') {
      CommandResult.new(:stdout => 'AIX', :exit_status => 0)
    }
    allow(aix).to receive(:run_command).with('uname -rvp') {
      CommandResult.new(:stdout => '11 10 powerpc', :exit_status => 0)
    }
    expect(aix.detect).to include(
      :family  => 'aix',
      :release => '10.11',
      :arch    => 'powerpc'
    )
  end
  it 'Should return aix 7.1 powerpc when AIX 7.1 is installed.' do
    allow(aix).to receive(:run_command).with('uname -s') {
      CommandResult.new(:stdout => 'AIX', :exit_status => 0)
    }
    allow(aix).to receive(:run_command).with('uname -rvp') {
      CommandResult.new(:stdout => '1 7 powerpc', :exit_status => 0)
    }
    expect(aix.detect).to include(
      :family  => 'aix',
      :release => '7.1',
      :arch    => 'powerpc'
    )
  end
  it 'Should return aix 6.1 powerpc when AIX 6.1 is installed.' do
    allow(aix).to receive(:run_command).with('uname -s') {
      CommandResult.new(:stdout => 'AIX', :exit_status => 0)
    }
    allow(aix).to receive(:run_command).with('uname -rvp') {
      CommandResult.new(:stdout => '1 6 powerpc', :exit_status => 0)
    }
    expect(aix.detect).to include(
      :family  => 'aix',
      :release => '6.1',
      :arch    => 'powerpc'
    )
  end
  it 'Should return aix nil nil when AIX FooBar is installed.' do
    allow(aix).to receive(:run_command).with('uname -s') {
      CommandResult.new(:stdout => 'AIX', :exit_status => 0)
    }
    allow(aix).to receive(:run_command).with('uname -rvp') {
      CommandResult.new(:stdout => 'Foo Bar batz', :exit_status => 1)
    }
    expect(aix.detect).to include(
      :family  => 'aix',
      :release => nil,
      :arch    => nil
    )
  end
end

Version data entries

206 entries across 206 versions & 3 rubygems

Version Path
specinfra-2.76.5 spec/helper/detect_os/aix_spec.rb
specinfra-2.76.4 spec/helper/detect_os/aix_spec.rb
specinfra-2.76.3 spec/helper/detect_os/aix_spec.rb
specinfra-2.76.2 spec/helper/detect_os/aix_spec.rb
specinfra-2.76.1 spec/helper/detect_os/aix_spec.rb
specinfra-2.76.0 spec/helper/detect_os/aix_spec.rb
specinfra-2.75.1 spec/helper/detect_os/aix_spec.rb
specinfra-rb19-2.44.7 spec/helper/detect_os/aix_spec.rb
specinfra-2.75.0 spec/helper/detect_os/aix_spec.rb
specinfra-2.74.0 spec/helper/detect_os/aix_spec.rb
specinfra-2.73.4 spec/helper/detect_os/aix_spec.rb
specinfra-2.73.3 spec/helper/detect_os/aix_spec.rb
specinfra-2.73.2 spec/helper/detect_os/aix_spec.rb
specinfra-2.73.1 spec/helper/detect_os/aix_spec.rb
specinfra-2.73.0 spec/helper/detect_os/aix_spec.rb
specinfra-2.72.1 spec/helper/detect_os/aix_spec.rb
specinfra-2.72.0 spec/helper/detect_os/aix_spec.rb
specinfra-2.71.3 spec/helper/detect_os/aix_spec.rb
specinfra-2.71.2 spec/helper/detect_os/aix_spec.rb
specinfra-2.71.1 spec/helper/detect_os/aix_spec.rb