Sha256: fd29247c0596430a69032805dbb999f0edd768ec4f07e5c3cf645e5e8639ee1b

Contents?: true

Size: 1.09 KB

Versions: 116

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'
require 'specinfra/helper/detect_os/eos'

describe Specinfra::Helper::DetectOs::Eos do
  eos = Specinfra::Helper::DetectOs::Eos.new(:exec)
  it 'Should return eos family and the correct version.' do
    allow(eos).to receive(:run_command).with('ls /etc/Eos-release') {
      CommandResult.new(:stdout => '/etc/Eos-release', :exit_status => 0)
    }
    allow(eos).to receive(:run_command).with('cat /etc/Eos-release') {
      CommandResult.new(:stdout => 'Arista Networks EOS 4.15.3F', :exit_status => 0)
    }
    expect(eos.detect).to include(
      :family  => 'eos',
      :release => '4.15.3F'
    )
  end

  it 'Should return eos nil when a non-conforming EOS version is installed.' do
    allow(eos).to receive(:run_command).with('ls /etc/Eos-release') {
      CommandResult.new(:stdout => '/etc/Eos-release', :exit_status => 0)
    }
    allow(eos).to receive(:run_command).with('cat /etc/Eos-release') {
      CommandResult.new(:stdout => 'Arista Networks EOS foo', :exit_status => 0)
    }
    expect(eos.detect).to include(
      :family  => 'eos',
      :release => nil
    )
  end
end

Version data entries

116 entries across 116 versions & 1 rubygems

Version Path
specinfra-2.91.0 spec/helper/detect_os/eos_spec.rb
specinfra-2.90.1 spec/helper/detect_os/eos_spec.rb
specinfra-2.90.0 spec/helper/detect_os/eos_spec.rb
specinfra-2.89.0 spec/helper/detect_os/eos_spec.rb
specinfra-2.88.2 spec/helper/detect_os/eos_spec.rb
specinfra-2.88.1 spec/helper/detect_os/eos_spec.rb
specinfra-2.88.0 spec/helper/detect_os/eos_spec.rb
specinfra-2.87.2 spec/helper/detect_os/eos_spec.rb
specinfra-2.87.1 spec/helper/detect_os/eos_spec.rb
specinfra-2.87.0 spec/helper/detect_os/eos_spec.rb
specinfra-2.86.0 spec/helper/detect_os/eos_spec.rb
specinfra-2.85.1 spec/helper/detect_os/eos_spec.rb
specinfra-2.85.0 spec/helper/detect_os/eos_spec.rb
specinfra-2.84.1 spec/helper/detect_os/eos_spec.rb
specinfra-2.84.0 spec/helper/detect_os/eos_spec.rb
specinfra-2.83.4 spec/helper/detect_os/eos_spec.rb
specinfra-2.83.3 spec/helper/detect_os/eos_spec.rb
specinfra-2.83.2 spec/helper/detect_os/eos_spec.rb
specinfra-2.83.1 spec/helper/detect_os/eos_spec.rb
specinfra-2.83.0 spec/helper/detect_os/eos_spec.rb