Sha256: 71ab80716d0b6501676828ba543ab53f6f862c8f2dbf60b283e4231d5bf98d0a

Contents?: true

Size: 1.21 KB

Versions: 8

Compression:

Stored size: 1.21 KB

Contents

require 'spec_helper'

describe Sloe do
  context "invoked with block" do
    before(:all) do
      @login = {
        :target => 'capella',
        :username => 'netconf',
        :password => 'netconf'
      }
      @hostname = ''
    end

    it "calls Netconf RPC" do
      Sloe::Device.new( @login ) { |dut| 
        sw_info = dut.rpc.get_system_information
        @hostname = sw_info.xpath('//host-name').text
      }
      @hostname.should include @login[:target]
    end

    it "calls SNMP RPC" do
      Sloe::Device.new ( @login ) { |dut| 
        @hostname = dut.snmp.get_value( 'sysName.0' ).to_s
      }
      @hostname.should include @login[:target]
    end

  end

  context "Junos extensions" do
    before(:all) do
      @login = {
        :target => 'capella',
        :username => 'netconf',
        :password => 'netconf'
      }
    end

    it "Sloe::Junos responds to Junos specific RPCs" do
      Sloe::Junos.new ( @login ) { |dut|
        dut.rpc.respond_to?(:lock_configuration).should be true
      }
    end
    it "Sloe::Device does not respond to Junos specific RPCs" do
      Sloe::Device.new ( @login ) { |dut|
        dut.rpc.respond_to?(:lock_configuration).should be false
      }
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sloe-0.8.7 spec/blocks_spec.rb
sloe-0.8.5 spec/blocks_spec.rb
sloe-0.8.4 spec/blocks_spec.rb
sloe-0.8.3 spec/blocks_spec.rb
sloe-0.8.2 spec/blocks_spec.rb
sloe-0.8.1 spec/blocks_spec.rb
sloe-0.8.0 spec/blocks_spec.rb
sloe-0.7.2 spec/blocks_spec.rb