Sha256: a3a91b0cfb1f790e767d488ba682dcfd2f88000bd27f2af19d5cf0a6a575e476

Contents?: true

Size: 1.37 KB

Versions: 46

Compression:

Stored size: 1.37 KB

Contents

require File.dirname(__FILE__) + '/../test_helper'

class TC_SunOSTest < Test::Unit::TestCase
  def setup
    sample = IO.readlines("#{File.dirname(__FILE__)}"+
                          '/../../ifconfig_examples/sunos.txt').join
    @@cfg = IfconfigWrapper.new('SunOS',sample).parse
  end
  def test_interface_list
    assert(@@cfg.interfaces == ["le1", "lo0", "bge0"],
           "Fauled to parse all interfaces")
  end

  def test_mac_parse
    assert(@@cfg['bge0'].mac == "0:3:ba:42:9d:ef", 
    "Failed to parse MAC address: "+@@cfg['bge0'].mac)
  end

  def test_flags
    assert(@@cfg['bge0'].flags.include?('BROADCAST') &&
          @@cfg['bge0'].flags.include?('RUNNING') &&
          @@cfg['bge0'].flags.include?('MULTICAST') &&
          @@cfg['bge0'].up?,
           "FLAG Parsing failed: #{@@cfg['bge0'].flags}")
  end

  def test_addr_types
    assert(@@cfg['bge0'].addr_types.include?('inet') &&
           @@cfg['bge0'].addr_types.include?('inet6'),
           "Failed to parse all address types")
  end

  def test_networks
    assert(@@cfg['bge0'].addr_types.include?('inet') &&
           @@cfg['bge0'].addr_types.include?('inet6'),
           "Missing Address Types: #{@@cfg['bge0'].addr_types}")
  end

  def test_attribs
    assert(@@cfg['bge0'].rx['bytes'].class == Fixnum || NilClass&&
           @@cfg['bge0'].tx['bytes'].class == Fixnum || NilClass, "Wrong class")
  end

end

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
aaalex-ruby-ifconfig-1.2.1 test/unit/tc_sunos.rb
aaalex-ruby-ifconfig-1.2.2 test/unit/tc_sunos.rb
aaalex-ruby-ifconfig-1.2.3 test/unit/tc_sunos.rb
trema-0.4.7 vendor/ruby-ifconfig-1.2/test/unit/tc_sunos.rb
trema-0.4.6 vendor/ruby-ifconfig-1.2/test/unit/tc_sunos.rb
trema-0.4.5 vendor/ruby-ifconfig-1.2/test/unit/tc_sunos.rb
trema-0.4.4 vendor/ruby-ifconfig-1.2/test/unit/tc_sunos.rb
trema-0.4.3 vendor/ruby-ifconfig-1.2/test/unit/tc_sunos.rb
trema-0.4.2 vendor/ruby-ifconfig-1.2/test/unit/tc_sunos.rb
trema-0.4.1 vendor/ruby-ifconfig-1.2/test/unit/tc_sunos.rb
trema-0.4.0 vendor/ruby-ifconfig-1.2/test/unit/tc_sunos.rb
trema-0.3.21 vendor/ruby-ifconfig-1.2/test/unit/tc_sunos.rb
trema-0.3.20 vendor/ruby-ifconfig-1.2/test/unit/tc_sunos.rb
trema-0.3.19 vendor/ruby-ifconfig-1.2/test/unit/tc_sunos.rb
trema-0.3.18 vendor/ruby-ifconfig-1.2/test/unit/tc_sunos.rb
trema-0.3.17 vendor/ruby-ifconfig-1.2/test/unit/tc_sunos.rb
trema-0.3.16 vendor/ruby-ifconfig-1.2/test/unit/tc_sunos.rb
trema-0.3.15 vendor/ruby-ifconfig-1.2/test/unit/tc_sunos.rb
trema-0.3.14 vendor/ruby-ifconfig-1.2/test/unit/tc_sunos.rb
trema-0.3.13 vendor/ruby-ifconfig-1.2/test/unit/tc_sunos.rb