Sha256: bf90cdca5e98ffae6b371c526b8a8f3901aca2ea8ed58a2323761f3296acbeaa

Contents?: true

Size: 1.32 KB

Versions: 2

Compression:

Stored size: 1.32 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe "Lan" do

  before :each do
    user ||= ENV["ipmiuser"] || "admin"
    pass ||= ENV["ipmipass"] || "password"
    host ||= ENV["ipmihost"] || "10.0.1.16"
    provider ||= ENV["ipmiprovider"] || "ipmitool"
    @conn = Rubyipmi.connect(user, pass, host, provider)



  end

  it "get ip address" do
      @conn.bmc.lan.ip.should_not be nil
  end

  it "get netmask" do
    @conn.bmc.lan.netmask.should_not be nil
  end

  it "get gateway address" do
    @conn.bmc.lan.gateway.should_not be nil
  end

  it "get mac address" do
    @conn.bmc.lan.mac.should_not be nil
  end

  it "get static or dhcp" do
    @conn.bmc.lan.dhcp?.should_not be nil
  end

  it "static should be opposite of dhcp" do
    @conn.bmc.lan.dhcp?.should_not == @conn.bmc.lan.static?
  end

  it "dhcp should be opposite of static" do
      @conn.bmc.lan.static?.should_not == @conn.bmc.lan.dhcp?
  end


  it "should set gateway address" do
    gw = @conn.bmc.lan.gateway
    @conn.bmc.lan.gateway = gw
   (@conn.bmc.lan.gateway = gw).should_not be nil

  end

  it "should set netmask" do
    netmask = @conn.bmc.lan.netmask
    (@conn.bmc.lan.netmask = netmask).should_not be nil
  end

  it "should set ip address" do
    ip = @conn.bmc.lan.ip
    (@conn.bmc.lan.ip = ip).should_not be nil
  end


end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubyipmi-0.8.1 spec/integration/lan_spec.rb
rubyipmi-0.7.0 spec/integration/lan_spec.rb